How to do this? Form fill problem

M

Moozie

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!
 
D

Dirk Malorny

Moozie said:
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
 
T

Toby Inkster

<?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'] ?>">
 
M

Moozie

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!!!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top