CodeIgniter Forums
POSTING hidden values - Printable Version

+- CodeIgniter Forums (
+-- Forum: Using CodeIgniter (
+--- Forum: General Help (
+--- Thread: POSTING hidden values (/showthread.php?tid=78178)

POSTING hidden values - richb201 - 12-09-2020

In my form I am setting these hidden values

<input type="hidden"  name="email"        value=<?php $emailString?>/>
<input type="hidden" name="campaign"  value=<?php $campaignString?>/>
<input type="hidden" name="taxyear"    value=<?php $dateString?> />

and then I submit it to  a function in the controller. This is the code that runs in the controller


But when I take a look at $campaign, $email, and $taxyear , once the form is submitted, they are all "/".  Why? 

RE: POSTING hidden values - InsiteFX - 12-09-2020

Maybe because the value is in double quotes.

RE: POSTING hidden values - sammyskills - 12-10-2020

You can try something like this:

<input type="hidden" name="email" value="<?php $emailString?>">

Enclose the php code in double quotes.

RE: POSTING hidden values - vitnibel - 12-10-2020

just need to add echo, like this

PHP Code:
<input type="hidden" name="email" value="<?php echo $emailString ?>"

RE: POSTING hidden values - richb201 - 12-10-2020

Thanks. The suggestions worked perfectly.