Jump to content


This topic is now archived and is closed to further replies.


How pass Parameters in URL

Recommended Posts

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.



Share this post

Link to post
Share on other sites

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


Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.