[snip]
{
header(Location: http://www.xx.com/page1.php;
);
print You have errors;
exit;
}
}
[/snip]
You either need to carry info about the error in a session variable or
url string or something...above your redirect happens before any error
can be sent to the
Now why didn't I think of that ! Thank you Jay!
Stuart
--- Jay Blanchard
[EMAIL PROTECTED] wrote:
[snip]
{
header(Location:
http://www.xx.com/page1.php;
);
print You have errors;
exit;
}
}
[/snip]
You either need to carry info about the error in a
On Saturday 23 October 2004 01:25, Stuart Felenstein wrote:
I'm not quite sure how to get an error message to
print out after a redirect. I know it's possible.
It's not possible. Think about it. How *can* you print something out when
you've already told the browser to go somewhere else? BTW
This isn't working:
Page2 (after page1 has been posted):
else
{
$_SESSION['er'] = 'Please make sure to fill in all 3
corresponding values .';
header(Location:
http://www.x.com/TestMulti4a.php; );
exit;
}
}
Page1:
Opening after session_start
$_SESSION['er'] =
On Saturday 23 October 2004 02:38, Stuart Felenstein wrote:
This isn't working:
Page2 (after page1 has been posted):
else
{
$_SESSION['er'] = 'Please make sure to fill in all 3
corresponding values .';
If you want keep changes to any session variables (so that they're
Sorry, all fixed now!
Thank you for the help!
Stuart
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
See below:
--- Jason Wong [EMAIL PROTECTED] wrote:
What are you trying to do here?
Is 'Page1' == TestMulti4a.php?
Are you trying to display $_SESSION['er'] as set in
Page2?
If so why are you assigning $_POST['er'] to
$_SESSION['er']? All you need to
do is echo $_SESSION['er'].
Yes
The only problem I'm having here is that if a user
goes backwards, the error from the session variable
will show up. I put an unset $.. underneath the
echo but that seems to have no effect.
Stuart
--- Stuart Felenstein [EMAIL PROTECTED] wrote:
See below:
--- Jason Wong [EMAIL PROTECTED]
You can pass the error in the redirect URL:
header(Location: http://www.xx.com/page1.php?errmsg=You missed
some stuff)
On your main page you just check if there is an errmsg to be displayed:
if(isset($_GET['errmsg'])) {
echo $_GET['errmsg'];
}
That a simplified version obviously. But
Brent - Thank you I will try that method.
Can you elaborate more on below. I take it to mean you
have one page/script that your pages are going to do
all the checks.
This form is 5 pages long. So I chose session
variables just to keep it neat and maybe, more
secure.
Stuart
--- Brent
PROTECTED]
Sent: 22 October 2004 21:55
To: Brent Baisley
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Redirect then error message to user
Brent - Thank you I will try that method.
Can you elaborate more on below. I take it to mean you
have one page/script that your pages are going to do
all
11 matches
Mail list logo