Panchami Panchami - 6 months ago 9
jQuery Question

setting a variable/ marker to use in a php function in the same php file

i want to set a marker like variable which will be set in a particular page and used for validation in common function. i tries $REQUEST. Its not working.. Any suggestion? also not able to read input hidden value..
in php section

<?php $GLOBALS['isRayaPromo'] = "rtrtr";
get_template_part('includingFilewithFunctionHere');
?>
<div class="btn_photo_wrapper">
code here invoking above function
</div>





also tried with regular php variable. I am a beginner so plz suggest

Answer

You can use constants if value to be used is fixed like this.

<?php
define("isRayaPromo", "rtrtr");
get_template_part('includingFunctionHere'); 
?>
<div class="btn_photo_wrapper">
  <?php echo isRayaPromo;?>
</div>
Comments