473,387 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

New2PHP. Need validation on form OR good BACK navigation in IE6.

1
I have following setup:

START PAGE:
"index.php"
--> User logs in by:
[PHP]
if (isset($_POST['login']))
{
//--> pull their user data from SQL table.
//--> Put SQL data to SESSION vars.
include"personal.php"}
else
{include "login.php"} //This has the actual html login form.
[/PHP]

PERSONAL PAGE:
"personal.php"
--> The session vars pull over successfully and are echoed into <input> boxes (like an auto-fill).
--> There are other things to fill out, too, you know!

** HERE IS THE PROBLEM **
I use a simple thing like this for insertion into the table:
[PHP]
if (isset($_POST['personaldone']))
{//connect to DB
$firstname = $_POST['firstname'];
//etc, etc.
$query = "INSERT INTO personaltable SET
firstname='$firstname'";

$result = mysql_query($query);

if ($result)
{
header("location: finished.php");
// I did header instead of include because a refresh
// would keep inserting into the personaltable
}
else
{
//HERE IS THE PROBLEM, READ ON
include "enterdataplease.php";
//HERE IS THE PROBLEM, READ ON
}
mysql_close();

// CLOSING if isset()
}
else
{
include "personalform.php";
/*this just displays the form the first time-around*/
}
[/PHP]

So, if the user FAILS to enter all the data, we go to "enterdataplease.php".
If I use the browser BACK in Firefox, no problem.
If I use the browser BACK in IE6 --- ehr!! I get "Warning: Page Has Expired"

CONCLUSION:
What is the best away around this?
I have read that a BACK with $_POST data can be an issue.
Really, my GOAL is to have 2 things happen:
1) a link on "enterdataplease.php" that returns to "personal.php" with the SAME session vars from index.php
2) BACK in IE6 would retain the SESSION vars....

MY THOUGHTS:
It seems to be a problem with how I'm doing sessions, no?
Or is it an inherent difficulty with POST pages?
Another option is to validate before the data before it ever hits the INSERTION into SQL and then I wouldn't need the "enterdataplease.php", correct?
Feb 20 '07 #1
0 879

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: peebrain | last post by:
I understand how to validate form data when a form is submitted to 'self' (ie. action="$_SERVER_"). In this case you simply validate before processing. However, what if submitting the form to...
11
by: Jim | last post by:
Hi, I keep getting form results emailed to me that would indicate a form from my web site is getting submitted with all fields blank or empty, but my code should preventing users from proceeding...
67
by: Scott Meyers | last post by:
I have a web site that, due to maintenance by several people, some of whom are fairly clueless about HTML and CSS, etc. (notably me), has gotten to the point where I'm pretty sure it's suffering...
7
by: Jack Addington | last post by:
I've got a fairly simple application implementation that over time is going to get a lot bigger. I'm really trying to implement it in a way that will facilitate the growth. I am first writing a...
3
by: Lewis Edward Moten III | last post by:
I am using smart navigation. I have a form with multiple panels. These panels are displayed and hidden, depending on links that a user may press at the top of the page. One panel has validation...
14
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2)...
4
by: usl2222 | last post by:
Hi folks, I appreciate any assistance in the following problem: I have a form with a bunch of dynamic controls on it. All the controls are dynamically generated on a server, including all...
1
by: IkBenHet | last post by:
Hello, Currently I am using a large input form on a website that is based on ASP and JavaScript. Depending on the values that are filled in by the user the forms does a refresh and makes...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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,...

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.