Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hidden Form Fields

    Hi,

    I'm new to PHP

    I have a html page with a form on. I would like the values from teh form to be hidden in the next form (i.e. the page that the first form posts to). When I try I get undefined variable.

    Here's my code:

    html page:

    <form name="form" method="post" action="test2.php">
    <Select name="cbotest">
    <option value="">Choose an option</option>
    <option value="one">One</option>
    <option value="two">Two</option>
    <option value="three">Three</option>
    <option value="four">Four</option>
    </select>
    </form>

    test2.php

    <input type="hidden" name="cbotest" value="<?php print $cbotest?>">


    This is the result:

    <input type="hidden" name="cbotest" value="<br />
    <b>Notice</b>: Undefined variable: cbotest in <b>**removed**</b> on line <b>151</b><br />


    I have removed where the script is Any ideas?

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts
    All sorted

    just needed a - $cbotest= $_POST['cbotest'];


  •  

    Posting Permissions

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