Closed Thread Icon

Topic awaiting preservation: Retrieving URL w/ PHP and posting in form? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=12044" title="Pages that link to Topic awaiting preservation: Retrieving URL w/ PHP and posting in form? (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Retrieving URL w/ PHP and posting in form? <span class="small">(Page 1 of 1)</span>\

 
grats42
Nervous Wreck (II) Inmate

From: hoboken nj
Insane since: Feb 2002

posted posted 02-12-2002 19:51

Okay, what I'm trying to do is probably one of the simplest uses of PHP, I just don't know where to find out how to do it. This is it: I have a button that passes the part number to an order form. That's it. It passes it in the url as www.drisson.com/order2.php?pnum=200 for example...on that page, i have a form. I want the part number to be sent with the form. I can get the partnumber with parse_url(), I can show the partnumber on the page to the user, but I can't send it with the form...I tried just a <input type="hidden" name="partnumber" value=$pnum> but that isn't right. Is there a quick and simple answer to this, or do I have to do more complex encoding and whatnot?



bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 02-12-2002 22:06

You're close
You don't need to parse the URL, key value pairs show up as variable pairs in PHP. the key is "in PHP"

<input type="hidden" name="partnumber" value="<?= $pnum ?>">

So you have to drop into PHP mode to echo it "<?=" is a shorthand in PHP for echo usefull in these types of situations



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

« BackwardsOnwards »

Show Forum Drop Down Menu