refresh main window using PHP/Javascript
Posted: Mon Nov 04, 2002 4:35 pm
I have a script which shows customer info. This window is empty. What I want to do is select a customer ID in a new window and then refresh the main window with the customer ID.
I have taken a stab at embeding some javascript in my PHP script, but it does not work. Can anyone point me in the right direction. Please bear in mind I have little javascript experience. Find the code for the child window:
I have taken a stab at embeding some javascript in my PHP script, but it does not work. Can anyone point me in the right direction. Please bear in mind I have little javascript experience. Find the code for the child window:
Code: Select all
<?php
$query = "select * from customer where cust_name like '%$company%' ";
$queryResult = mysql_query($query);
$i=0;
while($row =mysql_Fetch_array($queryResult))
{
if (is_int($i/2))
{
$bgcolor = "#cccccc";
}
else
{
$bgcolor = "#ffcc99";
}
print "<tr>";
print "<td>";
print "<td bgcolor="$bgcolor">$rowїcust_id]</td>";
print "<td bgcolor="$bgcolor"><a href="javascript:;"window.opener.location.reload"('customeradmin.php?cust_id=$rowїcust_id]'">$rowїcust_name]</a></td>";
print "<td bgcolor="$bgcolor">$rowїpostcode]</td>";
print "<td bgcolor="$bgcolor">$rowїcust_phone]</td>";
print "</tr>";
$i++;
}
?>