CodeIgniter Forums
hidden form - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: hidden form (/showthread.php?tid=54371)



hidden form - El Forum - 09-06-2012

[eluser]shahnawazahmed[/eluser]
hello developers

i want assign a randomly generated code to the database field hidden form . i generate code with $activation = md5(uniqid(rand(), true)); and now i want to assign to the activation field in the db , so i am using this code in the form

echo form_hidden('activation', '$activation');

but its not assigning the andom code to the field .




hidden form - El Forum - 09-06-2012

[eluser]SolarisDev[/eluser]
you have error in your code, try like this:
Code:
$activation = 'test field';
echo form_hidden('activation', $activation);
You don't need single quotes around $activation

Regards



hidden form - El Forum - 09-06-2012

[eluser]shahnawazahmed[/eluser]
it works .. Thank you friend Smile