Jump to content


Photo

How pass Parameters in URL


  • Please log in to reply
1 reply to this topic

#1 kberrien

kberrien
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 10 October 2004 - 09:58 PM

I'm starting to learn Dreamweaver, PHP.. etc.

I have a real project I'm looking to impliment as I learn. Its a simple 2 page database search. I have 2 pages, 1 with search string field, and some radio buttons to limit the search, the second is my results page.

How do I pass along the parameters (string, radio buttons) after clicking the SEARCH button to the second page. These parameters will be used to define the sql query to display.

Thanks!

#2 WesL

WesL
  • Members
  • Pip
  • Newbie
  • 7 posts

Posted 28 October 2004 - 06:56 AM

I did something similar with a sight that I'm working on right now. I was pasing the 'order number' on to the following page(s) and calling certain fields from the MySQL db.

I used a variable of $ID as the variable to track

I used a hyper link:
echo "<a href='phpscript.php?pid=$id'> Click here to continue with order # $id </a>";

Using a '?' after the *.php page name allows to you send variables to the next page and have those variables acted on.

Next, we need to receive the info:
$id = $_GET['pid'];


$result=mysql_query("SELCT * FROM images WHERE id={$id}");

Good Luck





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users