Jump to content

Page not going back by clicking back button of browser


f.ismayil

Recommended Posts

Please, take a look to the following code.After clicking Next it goes to overview.php.Why when I click back on my browser to return to this page again, it is not returning back? When I click back I receive "Confirm Form Resubmission" message. After refreshing page it loads page.

I guess problem is in "session_start();" part. Something to do with cookies.

Please, help me it is very urgent for me.

 

<?php

session_start();

 

echo "<html>

<head>

<title>Hello World</title>

<meta http-equiv='Content-Type' content='text/html; charset=Windows-1252'/>

</head>";

 

require_once ('functions.inc');

 

if(!isset($_POST['userid'])) {

echo "<script type='text/javascript'>";

echo "window.location = 'index.php'";

echo "</script>";

 

exit;

}else{

 

session_register("userid", "userpassword");

$username = auth_user($_POST['userid'], $_POST['userpassword']);

 

if(!$username) {

$PHP_SELF = $_SERVER['PHP_SELF'];

session_unregister("userid");

session_unregister("userpassword");

echo "Authentication failed " .

"Please, write correct username or password. " .

"try again ";

echo "<A HREF=\"index.php\">Login</A><BR>";

exit;

}

}

 

 

function auth_user($userid, $userpassword){

global $default_dbname, $user_tablename;

$user_tablename = 'user';

$link_id = db_connect($default_dbname);

mysql_select_db("d12826", $link_id);

 

$query = "SELECT username FROM $user_tablename WHERE username = '$userid' AND password = '$userpassword'";

$result = mysql_query($query) or die(mysql_error());

 

if(!mysql_num_rows($result)){

return 0;

}else{

$query_data = mysql_fetch_row($result);

return $query_data[0];

}

}

 

echo "hello";

echo "<form method='POST' name='myform' action='overview.php'>";

echo "<input type='submit' value='Next'>";

echo "</form>";

 

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.