Re: Do I need a script to do this?

by "Keith Sellars" <Keith(at)webgraffix.com>

 Date:  Mon, 15 Apr 2002 10:53:16 -0400
 To:  <hwg-basics(at)hwg.org>
 References:  nrc
  todo: View Thread, Original
Just as an added note here:  PHP is one of the easiest ways to do this
because it automatically creates the associated variables (for "item", it
creates "$item" for instance) whenever a form is parsed by the php engine.

This makes things really efficient from the "server load" viewpoint and
makes it much easier from the programming/coding viewpoint.

Thanks,
Keith D Sellars
WebGraffix
www.webgraffix.com

"Making database sites seem easy"
----- Original Message -----
From: "Martin Clifford" <MLC1(at)nrc.gov>
To: <steve.burrill(at)celtic-web.co.uk>; <hwg-basics(at)hwg.org>
Sent: Monday, April 15, 2002 9:44 AM
Subject: Re: Do I need a script to do this?


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="orderForm" method=GET action="processform.php">
Item: <input type=text size=20 maxlength=25 name="item"><br>
Price: <input type=text size=8 maxlength=10 name="price"><br>
<input type=hidden name="date" value="4/15/02">
<input type=submit value="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=hidden value="<?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: hwg-basics mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.