How 2 go back to previous visited page when I click on Chrom

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Ghoz
Forum Commoner
Posts: 38
Joined: Thu Jul 12, 2012 2:32 am

How 2 go back to previous visited page when I click on Chrom

Post by Ghoz »

Hi,
How to go back to previous visited page when I click on Chrome back button it said 'Confirm Form Resubmission'. How to go back to previous visited page without Chrome 'Confirm Form Resubmission' warning?
Thanks!

The code is as below:
<?php
// This will allow to use the css inside includes if editing this file directly... probably
$visitingfiledirectly = false;
if($visitingfiledirectly)
{
?>
<link rel="stylesheet" type="text/css" media="screen" href="../stylus.css">
<?php
}

?>
<b>Search Result:</b><br />
<div class="searchlist">
<?php
$uname = "";
if(isset($_POST["u"]) && !empty($_POST["u"]) && strlen($_POST["u"]) > 0)
{
$uname = PHP_slashes($_POST["u"]);
}
$result2 = mysql_query("SELECT Avatar, Name, Username, LastLoginDate, Email FROM users where Username Like '%".$uname."%'");

if(mysql_num_rows($result2) > 0)
{
?>
<table border = "1" width="100%">
<tr>
<td></td>
<td><b><p align="center">Name</b></td>
<?php
if($admin >= 1)
{
?>
<td><b><p align="center"><p align="center">Email Address</b></td>
<?php
}
?>
<td><b><p align="center">Last Login</b></td>
</tr>
<?php

while ($row2 = mysql_fetch_row($result2)){
?>
<tr>
<td><p align="center"><?php useLightbox($row2[0],$row2[1],50,50);?></td>
<td><p align="center"><a href="index.php?section=profile&uid=<?php echo getUserId($row2[2]);?>"><b><?php echo $row2[1];?></b></a></td>
<?php
if($admin >= 1)
{
?><td><p align="center"><?php echo $row2[4];?></td><?php
}
?><td><p align="center"><?php echo referencialHour($row2[3]);?></td>
</tr><?php
}

?>
</table>
</div>
<?php
}
else
{
?>
<font color="#FF0000">No user found!</b></font>
<?php
}

?>
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: How 2 go back to previous visited page when I click on C

Post by social_experiment »

Easiest would be to create a "Back" button of your own;

Code: Select all

 // works like the browsers' "back" button
 history.back();
 // or 
 // will take you back one page
 history.go(-1);
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Ghoz
Forum Commoner
Posts: 38
Joined: Thu Jul 12, 2012 2:32 am

Re: How 2 go back to previous visited page when I click on C

Post by Ghoz »

Thanks! Anyway that's not the solution that I need. I have other solution. This topic is closed.
Post Reply