SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Mar 2006
    Posts
    291
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question hidden from fields

    Having a hard time understanding <input type"hidden> within a form. Can someone clear this up for me once and for all with an example or 2 on when it would be useful to use it?

  2. #2
    SitePoint Zealot fatnic's Avatar
    Join Date
    Aug 2006
    Location
    Lincoln, UK
    Posts
    191
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hidden fields are best used when you want to pass data to another page but dont want it to be seen by the user. So you could have
    Code:
    <input type="hidden" name="date" value="29-10-2006">
    Than on the next page you could grab the data
    Code:
    $date = $_POST['date'];
    Or some thing similar. Hope this clears it up. Just remember this isn't secure. Anyone can see it just by viewing the page source.


Bookmarks

Posting Permissions

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