473,770 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Page Has Expired Message in between the php Page When I click Back in Explorer Menu

Could anyone please help me on this??

I have a php script page, which is basically quiz. Visitors (after login in
with their email address) are supposed to answer each question, and when
they click the button at the bottom, the next page will show which problems
they got right or wrong.

Now my visitors, after seeing some problems they got wrong, click Back
button at the Explorer menu, and if they do, they get the below message:
=============== =============== =============== =============== =============== =
=============== =========
Warning: Page has Expired The page you requested was created using
information you submitted in a form. This page is no longer available. As a
security precaution, Internet Explorer does not automatically resubmit your
information for you.

To resubmit your information and view this Web page, click the Refresh
button.
=============== =============== =============== =============== =============== =
=============== =========
Below are the script that I am using. This scripts are after initial login
page, which asks for visitor's email address. I have authorized visitors
already in my MySQL table, and only the visitors whose email address is in
my MySQL table are allowed to login.
=============== =============== =============== =============== =============
<?php
session_start() ;

define('HOST', 'mysql');
define('USER', 'byung');
define('PASS', 'xiclcvjq');
define('DB', 'Learning');

if (empty($HTTP_SE SSION_VARS['emailadd']))
{
mysql_connect(H OST, USER, PASS);
mysql_select_db (DB);
$result = mysql_query("SE LECT COUNT(*) AS numfound FROM emailAddress WHERE
emailaddress='{ $HTTP_POST_VARS['emailadd']}'") or die(mysql_error ());

$result_ar=mysq l_fetch_array($ result);
if ($result_ar['numfound']<1)
{
header('Locatio n: jinuform.php?er ror=1');
exit;
}

$emailadd=$HTTP _POST_VARS['emailadd'];
session_registe r('emailadd');
$insert = mysql_query("IN SERT INTO StuAccess (emailaddress, IssueNo)
VALUES ('{$HTTP_POST_V ARS['emailadd']}', 1)") or die(mysql_error ());
}

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>
<title>Jinu Math Study Guide</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<div align="center">
<table width="745" border="1" cellspacing="0" cellpadding="0" >
<tr>
<td width = "200">&nbsp ;</td>
<td width = "545">&nbsp ;</td>
</tr>
<tr>
<td>&nbsp;</td>

<td>>&nbsp;</td>

</tr>
<tr>
<td height="459">&n bsp;</td>
<td><form name="form1" method="post" action="grade.p hp">
<table width="545" border="1" cellspacing="0" cellpadding="0" >
<tr>
<td><div align="center"> Today's Exercise</div></td>
</tr>
<tr>
<td bgcolor="#E0E0E 0"><strong><fon t color="#0000A0" >Q<font
size="1">UESTIO N
</font>1</font></strong></td>
</tr>
<tr>
<td><p>What is the length of l times w?</p>
<input type="radio" name="Q1" value="1">
<input type="radio" name="Q1" value="2">
<input type="radio" name="Q1" value="3">
<input type="radio" name="Q1" value="4"><br>
</td>
</tr>
<tr>
=============== =============== =============== =============== =============
What above codes do is getting the email address from the login page (from
the previous page), and then allow login only if the visitors' email address
they typed in is in my MySQL database.

Below are the codes, which process the quiz form:

<?php

define('HOST', 'mysql');
define('USER', 'byung');
define('PASS', 'xiclcvjq');
define('DB', 'JinuAcademy');
mysql_connect(H OST, USER, PASS);
mysql_select_db (DB);

$q1 = $HTTP_POST_VARS['Q1'];
$q2 = $HTTP_POST_VARS['Q2'];
$q3 = $HTTP_POST_VARS['Q3'];
$q4 = $HTTP_POST_VARS['Q4'];
$q5 = $HTTP_POST_VARS['Q5'];
$q6 = $HTTP_POST_VARS['Q6'];
$q7 = $HTTP_POST_VARS['Q7'];

if ($q1 == '' || $q2 == '' || $q3 == '' || $q4 =='' || $q5 == '' || $q6 ==
'' || $q7 == '')
{
echo '<h1>Sorry!! You need to fill in your answer for all
questions</h1>';
}
else
{
$score = 0;
if ($q1 == 1)
{
$score++;
$q1Grade = "Correct";
echo '<B>1. Correct!!</B><p>';
}
else
{
$q1Grade = "Incorrect" ;
echo '<B>1. Incorrect..</B><p>';
}

if ($q2 == 1)
{
$score++;

.....

Now above codes present how the visitor did in the Quiz. But from this
page, if the visitor click the Back button, then they get the error message
above. How would I be able to make my visitor to go back to the previous
page with answers they have clicked in showing up again rather than getting
page expired message??

Any help or comment will be deeply appreciated.

Thanks.

Jul 17 '05 #1
4 6933
Hi John,

On Thu, 22 Apr 2004 05:10:35 GMT, "John" <pr******@earth link.net>
wrote:
Could anyone please help me on this??

I have a php script page, which is basically quiz. Visitors (after login in
with their email address) are supposed to answer each question, and when
they click the button at the bottom, the next page will show which problems
they got right or wrong.

Now my visitors, after seeing some problems they got wrong, click Back
button at the Explorer menu, and if they do, they get the below message:
(..)Warning: Page has Expired (...)
Now above codes present how the visitor did in the Quiz. But from this
page, if the visitor click the Back button, then they get the error message
above. How would I be able to make my visitor to go back to the previous
page with answers they have clicked in showing up again rather than getting
page expired message??


Redirect all POST request to a GET request (use header() ) by saving
the POST variables to a SESSION file and then reading it from the
SESSION file when you're on the GET request.

This way there is no page shpwing in the browser which has a POST
request, ergo no message because of a POST request.

HTH, Jochen
--
Jochen Daum - Cabletalk Group Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 17 '05 #2
Thank you so much for help, Jochen.

But would you explain in a bit more detailed way please??

Do you want me to use GET rather than POST??

I don't know what you mean by
(use header() ) by saving
the POST variables to a SESSION file and then reading it from the
SESSION file when you're on the GET request.
I am pretty new to php, and if you don't mind, would you write me a sample
codes please??

I am specially not understanding how I can use header() and use GET request
from SESSION file.

Thanks.

John

"Jochen Daum" <jo*********@ca bletalk.co.nz> wrote in message
news:pq******** *************** *********@4ax.c om... Hi John,

On Thu, 22 Apr 2004 05:10:35 GMT, "John" <pr******@earth link.net>
wrote:
Could anyone please help me on this??

I have a php script page, which is basically quiz. Visitors (after login inwith their email address) are supposed to answer each question, and when
they click the button at the bottom, the next page will show which problemsthey got right or wrong.

Now my visitors, after seeing some problems they got wrong, click Back
button at the Explorer menu, and if they do, they get the below message:


(..)
Warning: Page has Expired

(...)
Now above codes present how the visitor did in the Quiz. But from this
page, if the visitor click the Back button, then they get the error messageabove. How would I be able to make my visitor to go back to the previous
page with answers they have clicked in showing up again rather than gettingpage expired message??


Redirect all POST request to a GET request (use header() ) by saving
the POST variables to a SESSION file and then reading it from the
SESSION file when you're on the GET request.

This way there is no page shpwing in the browser which has a POST
request, ergo no message because of a POST request.

HTH, Jochen
--
Jochen Daum - Cabletalk Group Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/

Jul 17 '05 #3
Script or not, you cant change a users browser settings.
RG
Jul 17 '05 #4
> I am pretty new to php, and if you don't mind, would you write me a sample
codes please??

I am specially not understanding how I can use header() and use GET request
from SESSION file.


Have the following scripts:
page1.php
answer1.php
page2.php
answer2.php

page1.php has the first page of questions and POSTs the answers to
answer1.php.

answer1.php saves the answers from page 1 in a session variable and
issues header('Locatio n: page2.php');

page2.php displays the second page of questions.... and so on.

The browser cache will only have page1.php and page2.php, not the
intermediate answer1.php with posted data and you'll not get the
'expired page' error.
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
12978
by: Jarkko Kähkönen | last post by:
Hi! I have Windows XP&IE6.0.2... (SP1). I'm coding one project with PHP. I get "Warning: Page has Expired" when I try to get back to the "POSTed page" (page whither moved from FORM-page). Better explanation: - Pages are: * Page A: Front-page
1
2051
by: ddddd | last post by:
Regarding the Internet Explorer message below: "Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the Refresh button. " I'm developing an e-commerce site from scratch.
16
2432
by: | last post by:
At the moment I am getting the following Expired Warning if a user logins into a secure page and attempts to press the 'back' button: Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the...
12
10174
by: VB Programmer | last post by:
I know some sites will display the following message if you click on the BACK button in your browser. How do I implement this feature? Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the...
0
1120
by: Quentin Huo | last post by:
Hi: After the submit button is clicked, the page is posted back. Now if I click the "Back" button in the IE toolbar, I will get the warning message: Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.
15
4779
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update button will verify the information that has been entered and updates the data base if the data is correct. Update will throw an exception if the data is not validate based on some given rules. I also have a custom error handling page to show the...
2
2415
by: Chris Davoli | last post by:
How do I expire a page, and I want to get the following message when I hit the back button to that expired page? I get this message from my bank. Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page,...
8
3353
by: rn5a | last post by:
I have a HTML page named Index.html which is divided into 3 frames. The URL of 2 of the frames are HTML pages but the 3rd frame houses a ASP page. Now when I go to Windows Explorer, navigate to the folder in which the all the 4 files (3 HTML + 1 ASP) reside & select Index.html (by clicking with the mouse or by using the arrow keys on the keyboard), strangely the Windows "File Download" dialog box (with 'Open', 'Save', 'Cancel', 'More...
5
6798
by: =?Utf-8?B?Y2hlY2tyYWlzZXJAY29tbXVuaXR5Lm5vc3BhbQ== | last post by:
I have a site which I secure with forms authentication. When the user's sign on and hit one of the secure pages, I have this line in my code to ensure that the browser does not cache the page; and someone cannot navigate back to an cached image of the page in theory after the user has signed off. Response.Cache.SetCacheability(HttpCacheability.NoCache); This works all right, except when the user decides to use the browser's back...
0
9595
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9432
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10232
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8891
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.