Results 1 to 2 of 2

Thread: syntax for declaring a variable as a value in a hidden form field

  1. #1
    Join Date
    Apr 2009
    Posts
    13

    syntax for declaring a variable as a value in a hidden form field

    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

  2. #2
    Join Date
    Apr 2009
    Location
    The toon
    Posts
    1,225
    PHP Code:
    <input type="hidden" name="random" value= "<?php echo $activatecode?>">

Similar Threads

  1. binding a selection from a drop down menu to a form variable
    By eskimo in forum Web Design, HTML Reference and CSS
    Replies: 0
    Last Post: 10 May 2009, 09:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •