return previous file after a window is closed
when i clicked the radio button in salesreport.php, a new window is open to let the user choose the category to view (act as a prompt box with list box). when the ok button is clicked, the user will return to the salesreport.php to make the rest of the things he needed to choose. My question is :
1. how to return to the previous salesreport.php when the ok button is clicked on the chosecat.php.
2. if the cancel button is clicked how am i going to return to the previous salesreport.php
because i need the user to go back to the salesreport.php to continue enter other data.
//salesreport.php
<input type="radio" name="view_by" value="specategory"
onclick="window.open('chosecat.php', 'mywindow', 'height=100, width=400')">View Specified Category<br>
//chosecat.php
//i think the problem is here in the action
<form name="catform" method=POST action="salesreport.php"> Please select the category name below <br><br>
<?php
$query = " SELECT CAT_NAME FROM CATEGORY ORDER BY CAT_NAME";
$result = mysql_query ($query);
if(!$result) error_message (sql_error());
while($row = mysql_fetch_array($result))
{
$CAT_NAME[ ] = $row["CAT_NAME"];
}
echo "<select name=\"viewhighcat\">";
for($i=0; $i<=7; $i++)
{
echo "<option>$CAT_NAME[$i] </option>";
}
echo "</select>";
?>
<input id="but1" type="submit" name="catsubmit" value="OK">
<input id="but2" type="button" name="btncancel" value="CANCEL" >
|