Page 1 of 1

move information from one page and display it to another

Posted: Wed Mar 25, 2009 7:16 am
by selom86
hi, first of all, i'm quite new to php. i'm trying to send a set of information from one page to another through a link but i got stuck . :banghead:
Please I need help! the sentence in bold and italic is the whole problem.
this is where i've got to:

<php?

$i=0;
while($row = mysql_fetch_array($resultAllInfo ))
{
$Make[$i]=$row['Make'];
$Model[$i]=$row['Model'];
$Price[$i]=$row['Price'];
$Year[$i]=$row['Year'];
$queryLink = "SELECT Make, Model, Category, Price FROM carinfo LIMIT $i OFFSET $i";
$resultLink = mysql_query($queryLink)
or die("could not process $queryLink");

//declare variables
$rowLink = mysql_fetch_array($resultLink);
$selected_radio = $rowLink['Category'];
$make = $rowLink['Make'];
$model = $rowLink['Model'];

echo "<a href='search.php?$selected_radio=Category'>$Make[$i] $Model[$i]</a>"
?>

Re: move information from one page and display it to another

Posted: Wed Mar 25, 2009 7:29 am
by susrisha

Code: Select all

 
echo "<a href='search.php?Category=$selected_radio'>$Make[$i] $Model[$i]</a>"
 
I beleive this is what you have been trying to achieve

Re: move information from one page and display it to another

Posted: Wed Mar 25, 2009 8:29 am
by selom86
Thanks for replying but i still can't figure out how to use this information on the other page, assuming i want to display that information on the other page.Would please give me a sample?
Thanks in advance.

susrisha wrote:

Code: Select all

 
echo "<a href='search.php?Category=$selected_radio'>$Make[$i] $Model[$i]</a>"
 
I beleive this is what you have been trying to achieve

Re: move information from one page and display it to another

Posted: Wed Mar 25, 2009 9:38 am
by susrisha

Code: Select all

 
 
//on the search.php file you need to write this
$search_element = $_GET['Category'];
//
echo $search_element;
 
This will give the value of the selected radio in the next search page.

Re: move information from one page and display it to another

Posted: Thu Mar 26, 2009 4:22 am
by selom86
Great! It works, thank you very much.
susrisha wrote:

Code: Select all

 
 
//on the search.php file you need to write this
$search_element = $_GET['Category'];
//
echo $search_element;
 
This will give the value of the selected radio in the next search page.