Welcome Guest, Not a member yet? Register   Sign In
POSTING hidden values
#1

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

$campaign=$_POST["campaign"];
$email=$_POST["email"];
$taxyear=$_POST["taxyear"];


But when I take a look at $campaign, $email, and $taxyear , once the form is submitted, they are all "/".  Why? 
proof that an old dog can learn new tricks
Reply
#2

Maybe because the value is in double quotes.
value=""
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

You can try something like this:

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

Enclose the php code in double quotes.
Reply
#4

just need to add echo, like this

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

Thanks. The suggestions worked perfectly.
proof that an old dog can learn new tricks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB