Re: Do I need a script to do this?
by "Martin Clifford" <MLC1(at)nrc.gov>
|
Date: |
Mon, 15 Apr 2002 09:44:30 -0400 |
To: |
<steve.burrill(at)celtic-web.co.uk>, <hwg-basics(at)hwg.org> |
|
todo: View
Thread,
Original
|
|
You cannot pass values with scripting, the easiest of which I've seen is =
PHP. I'll give an example that you might be able to use if your server =
supports PHP.
<form name=3D"orderForm" method=3DGET action=3D"processform.php">
Item: <input type=3Dtext size=3D20 maxlength=3D25 name=3D"item"><br>
Price: <input type=3Dtext size=3D8 maxlength=3D10 name=3D"price"><br>
<input type=3Dhidden name=3D"date" value=3D"4/15/02">
<input type=3Dsubmit value=3D"Submit!">
</form>
Then, in processform.php, whenever you want to use the value of one of the =
fields, simply do this:
<?php echo "$item"; ?> costs <?php echo"$price"; ?> each.
You can also manipulate the data in different ways, but that's more =
advanced than the scope of your question. And just so you know, to pass =
the value on, you would just do this...
<input type=3Dhidden value=3D"<?php $date ?>">
Martin
>>> "Steve Burrill" <steve.burrill(at)celtic-web.co.uk> 04/15/02 08:58AM >>>
Is there a way of passing information from one web page to another without =
a
script of some sort?
I'd like to create a page - lets call it "orderform.htm" which contains a
form with various fields. One of the fields may be something like
"productcode".
Now, say, I've got other pages, each for a seperate product, how can I
create some sort of link to the order form on each of these pages that =
fills
in the product code field on the form automatically?
I thought of something like a small form on each of the pages with a =
hidden
field containing the product code which is somehow posted to the next page
when you hit submit?
I'd appreciate any pointers on what approach I should take.
Thanks
Steve
HTML Guild: hwg-basics mailing list archives,
maintained by Web Professionals @ IWA