Seems I always end up posting for the simplest questions. I've searched for this, but the answers I found I can't get to work for what I want.
I have 4 php pages:
page1.php - reads search criteria and calls page2.php
<form action="page2.php" method="get">
page2.php - runs query based on search criteria and performs action:
<?
$criteria_1 = $GET['var_1'];
$criteria_2 = $GET['var_2'];
$result = $mysql_query . . .
$num_rows = mysql_num_rows ($result);
if ($num_rows != 1)
{
header ("Location: page3.php");
exit;
}
else // only one record retrieved
{
while ($a_row = mysql_fetch_array($result))
{
$name_1 = $a_row['field_1'];
// same for remaining fields in array
}
header ("Location: page4.php");
}
?>
page3.php - loads fine; not worried about code at this point
page4.php - supposed to display info from query result
<?
$info = $_POST['result'];
echo $info;
echo "some html"
?>
I've tried several ways, and can't seem to get any information to print except the HTML. Can't get $_POST['name_1'] to work, either. Pages 2, 3, & 4 don't have any form tags. I don't think I can use a form method, which is what everybody else seems to do, because it should go to one of two pages, depending upon the results of the if statement. Maybe that's an incorrect assumption.
Hope I didn't take out too much code. Am willing to add to it.
Thanks for any help.