Jump to content

passing info from one page to another


OriginalSunny

Recommended Posts

Hi,
I am trying to pass info from one page to another. I have done it previously using the following code:

[i]echo "Please select from one of the following:";
foreach($food_categories as $key => $subarray)
{
echo "<h3>$key</h3>";
echo "<ul>";
foreach($subarray as $type)
{
if ($type != "")
{
echo "<input type='radio' name='interest'
value='$type'><b>$type</b><br>\n";
}
}
echo "</ul>";
}
echo "<p><input type='submit' name='Products'
value='Select Category'>\n
</form>\n";[/i]

However i am now trying to do it on another page using a link instead of a list of the products and then selecting one of them and pressing the select button. How do i modify the code below to do this??

[i]for($i=$n_start;$i<=$n_end;$i++)
{
echo "<td><a href=\"{$products[$i]['modelNum']}.php\">more info</a></td>";

}
echo "</tr>";[/i]

(As you can see the code simply outputs a link to the more info page i want it to go to.
Link to comment
Share on other sites

your url should be of the form page.php?info1=this&info2=that&info3=other

page.php then does all the the suff depending on what variables you have passed to teh script and what values you have given them. Its all down to your logic to dictate the flow of the coed after that.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.