How to do this? Form fill problem

Discussion in 'HTML' started by Moozie, May 9, 2005.

  1. Moozie

    Moozie Guest

    I have a form that people can fill out.

    Link looks like:
    http://www.myname.com/form.php
    A regular form, nothing special.

    Now I would like to fill out 1 field automatically by the link I give
    people.
    E.g. custommer number 14 will get a link from me like this one:
    http://www.myname.com/form.php?number=14
    Or something similar.

    What I would like to know is: how to put that "number 14" included in
    the link into the form. Or (even better) send it as a hidden field in
    the form?

    Is there maybe a cgi script or php script that does this job? Or a
    piece of javascript maybe?

    Any advice would be appreciated.

    Thanks for reading!
    Moozie, May 9, 2005
    #1
    1. Advertising

  2. Moozie

    Dirk Malorny Guest

    Moozie schrieb:
    > What I would like to know is: how to put that "number 14" included in
    > the link into the form. Or (even better) send it as a hidden field in
    > the form?
    >


    <?PHP
    print "<input type='hidden' name='number' value='$number'>";
    ?>



    Dirk
    Dirk Malorny, May 9, 2005
    #2
    1. Advertising

  3. Moozie

    Toby Inkster Guest

    On Mon, 09 May 2005 13:49:48 +0100, Dirk Malorny
    <> wrote:

    > <?PHP
    > print "<input type='hidden' name='number' value='$number'>";
    > ?>


    But will only work if register_globals is switched on. It's off by default
    in recent versions of PHP.

    Try:
    <input type="hidden" name="number" value="<?= $_GET['number'] ?>">

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
    Toby Inkster, May 9, 2005
    #3
  4. David Dorward, May 9, 2005
    #4
  5. Moozie

    Moozie Guest

    Thanks a lot: this is it!
    Looks simple, but I tried to implement it in a cgi file: all I have to
    do is put the small php file that creates the form in front of the
    cgi.

    THANKS!!!
    Moozie, May 10, 2005
    #5
  6. Moozie

    Moozie Guest

    THANKS TOU YOU I SOLVED IT.

    CLOSED
    Moozie, May 10, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dbuchanan
    Replies:
    0
    Views:
    4,655
    dbuchanan
    Dec 13, 2005
  2. tshad

    Form fill causing problem

    tshad, Jul 8, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    353
    tshad
    Jul 8, 2005
  3. Matt MC
    Replies:
    2
    Views:
    492
    Thomas 'PointedEars' Lahn
    May 25, 2005
  4. Moozie

    How to do this? Form fill problem

    Moozie, May 9, 2005, in forum: Perl Misc
    Replies:
    2
    Views:
    103
    Moozie
    May 10, 2005
  5. Matt MC
    Replies:
    2
    Views:
    145
    Thomas 'PointedEars' Lahn
    May 25, 2005
Loading...

Share This Page