Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page does get refresh with data retrieved from mysql after refresh

Status
Not open for further replies.

swathip

Programmer
Oct 10, 2009
17
US
I have a code and the way it should work is,when they click on NEW CUSTOMER,it takes them to test1.php where in they enter the details and they hit submit.it saves all the details in properly in the database and when i go back and hit REFRESH ,it should come up with the customer details which they had entered in previously. But what happens is, when i click on the REFRESH,it refreshes the same old page which is empty.I wanted to find out where am i missing the logic.Thanks in advance. The sample code would be

<tr>
<td class="tdvisitbig" colspan="5">THIS IS A TEST</td>
</tr>



<tr>
<td class='tdvisitbig' colspan="5"><input type="button" onClick="openVisit('test1.php?id=<?=$key?>&name=<?=$name?>');return false;" value="NEW CUSTOMER" class="submit"> <input type="button" value="REFRESH" name="add_xyz" class="submit" onClick="document.add.target='_self';document.add.action='test3.php?redirect=visit&section=test page';document.add.submit();"></td>
</tr>
<?

$q = "SELECT address,customernum,status FROM customer WHERE name='$name' ORDER BY customernum";
$r = mysql_query( $q , $Link );
while( $rw = mysql_fetch_assoc( $r ) )
{
extract( $rw );

?>
<tr>
<tr>

<td class="tdvisitbig"><a href="#" onClick="openVisit('test2.php?id=<?=$key?>&name=<?=$name?>&orderkey=<?=$orderid?>');return false;">view customer details</a></td>
<td class="tdvisitbig"><a href="#" onClick="openVisit('test1.php?id=<?=$key?>&name=<?=$name?>&key=<?=$id?>');return false;">change customer details</a></td>
</tr>
<? } ?>
 
If by 'go back and hit refresh' you mean go back to test1.php with the query parameters (eg. id, etc) intact, then this is probably a PHP question and as such would best be asked in forum434. This is because with the correct ID, your PHP should have no problem retrieving the item from the DB.

If this is not the case, can you explain which page you end up at when you hit back, and what the URL looks like (i.e. so we can see what parameters are present). It may well still be a PHP issue, but at least that way it can be confirmed.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top