July 16, 200917 yr Hello I am working on a form submit thingy for my new site (php). On the page wit the form, I generate a random 16 digit srting, which is then to be used to verify the users post. This works fine. Except... I want to declare the value of the random string as a hidden form variable ($activatecode), something like: <input type="hidden" name="random" value= "<?php $activatecode ?>"> I need to do this so when the form is processed on the next page, the value of @activatecode is stored in my database, to be used later to activate the users posting. It doesnt seem to be working? The $activatecode variable is being created by my random string function correcly, and everything else being passed as hidden, and non-hidden values by the form to the next page is working perfect What is the correct syntax for declaring a variable as a value in a hidden form field
July 16, 200917 yr Use this: <input type="hidden" name="random" value="<?php echo $activatecode; ?>">
July 16, 200917 yr can you post the code? including the mysql query etc? when i did something like this for a members database, i didnt use a var to insert it into the database, i just used the function $query= mysql_query("INSERT INTO members(ID,username,password,email,sex,joindate,randomkey)VALUES ('NULL', '$username', '$password', '$email', '$sex', '$date', '".FUNCTIONAME(value, value)."')") or die(mysql_error());
Create an account or sign in to comment