I want to redirect the user back to the home page after submitting
their form inquiry and display a message on the home page. I tried
this in my send mail (apply.php) file -
$_SESSION['sent_message'] == "Thank you for your request! Someone will
be contacting you soon.";
header("location:index.php");
but got this error -
Notice: Undefined index: sent_message in /home/bigmoxy/public_html/
projects/senior/apply.php on line 12
Warning: Cannot modify header information - headers already sent by
(output started at /home/bigmoxy/public_html/projects/senior/apply.php:
12) in /home/bigmoxy/public_html/projects/senior/apply.php on line 13
Note that the redirection works without setting the message.
Can someone please advise me on how to accomplish this?
Thank you!
Tim
Re: redirect after send form to email with message
am 30.09.2007 18:12:53 von luiheidsgoeroe
On Sun, 30 Sep 2007 18:05:09 +0200, Big Moxy wrote:
> I want to redirect the user back to the home page after submitting
> their form inquiry and display a message on the home page. I tried
> this in my send mail (apply.php) file -
>
> $_SESSION['sent_message'] == "Thank you for your request! Someone =
will
> be contacting you soon.";
> header("location:index.php");
>
> but got this error -
>
> Notice: Undefined index: sent_message in /home/bigmoxy/public_html/
> projects/senior/apply.php on line 12
Change '==' to '=3D'... it's an assignment. And as soon as the error=
output =
there disappears, you can do a header redirect. (BTW: displaying errors =
is =
OK for development offcourse, disable it on a live server though).
-- =
Rik Wasmus
Re: redirect after send form to email with message
> I want to redirect the user back to the home page after submitting
> their form inquiry and display a message on the home page. I tried
> this in my send mail (apply.php) file -
>
> $_SESSION['sent_message'] == "Thank you for your request! Someone will
> be contacting you soon.";
> header("location:index.php");
>
Why not send the user straight to the index.php page instead of
apply.php page ? .
Put the following on your form page .....
Put the following in the index.php page .....
$msg=$_REQUEST['passform'];
if ($msg==1) {" Thank you for your request! Someone will be
contacting you soon. ";}
?>
The rest of your index.php page will de displayed as normal .
--
(c) The Amazing Krustov
Re: redirect after send form to email with message
am 30.09.2007 19:19:10 von Big Moxy
On Sep 30, 10:39 am, Krustov wrote:
>
>
>
> <1191168309.331313.203...@o80g2000hse.googlegroups.com>
>
> > I want to redirect the user back to the home page after submitting
> > their form inquiry and display a message on the home page. I tried
> > this in my send mail (apply.php) file -
>
> > $_SESSION['sent_message'] == "Thank you for your request! Someone will
> > be contacting you soon.";
> > header("location:index.php");
>
> Why not send the user straight to the index.php page instead of
> apply.php page ? .
>
> Put the following on your form page .....
>
>
>
> Put the following in the index.php page .....
>
>
> $msg=$_REQUEST['passform'];
> if ($msg==1) {" Thank you for your request! Someone will be
> contacting you soon. ";}
> ?>
>
> The rest of your index.php page will de displayed as normal .
>
> --
> (c) The Amazing Krustov
I set it up so the form posts to the apply page to processes the form
input and send the email. I suppose I could do it all on the index
page but generally prefer not to.
Thanks,
Tim
Re: redirect after send form to email with message
am 30.09.2007 19:20:15 von Big Moxy
On Sep 30, 10:12 am, "Rik Wasmus" wrote:
> On Sun, 30 Sep 2007 18:05:09 +0200, Big Moxy wrote:
> > I want to redirect the user back to the home page after submitting
> > their form inquiry and display a message on the home page. I tried
> > this in my send mail (apply.php) file -
>
> > $_SESSION['sent_message'] == "Thank you for your request! Someone will
> > be contacting you soon.";
> > header("location:index.php");
>
> > but got this error -
>
> > Notice: Undefined index: sent_message in /home/bigmoxy/public_html/
> > projects/senior/apply.php on line 12
>
> Change '==' to '='... it's an assignment. And as soon as the error output
> there disappears, you can do a header redirect. (BTW: displaying errors is
> OK for development offcourse, disable it on a live server though).
> --
> Rik Wasmus
Thank you for pointing out the double = sign!!
Re: redirect after send form to email with message
> >
> > $msg=$_REQUEST['passform'];
> > if ($msg==1) {" Thank you for your request! Someone will be
> > contacting you soon. ";}
> > ?>
> >
> > The rest of your index.php page will de displayed as normal .
> >
> > --
> > (c) The Amazing Krustov
>
> I set it up so the form posts to the apply page to processes the form
> input and send the email. I suppose I could do it all on the index
> page but generally prefer not to.
>
$msg=$_REQUEST['passform'];
if ($msg==1) {include('process.php');}
?>
With the following at the top of the process.php page ...
if ($msg<>1) {return;}
Although in general i suppose it isnt a good way to do it .
--
(c) The Amazing Krustov
Re: redirect after send form to email with message
am 30.09.2007 19:58:59 von Jerry Stuckle
Big Moxy wrote:
> On Sep 30, 10:39 am, Krustov wrote:
>>
>>
>>
>> <1191168309.331313.203...@o80g2000hse.googlegroups.com>
>>
>>> I want to redirect the user back to the home page after submitting
>>> their form inquiry and display a message on the home page. I tried
>>> this in my send mail (apply.php) file -
>>> $_SESSION['sent_message'] == "Thank you for your request! Someone will
>>> be contacting you soon.";
>>> header("location:index.php");
>> Why not send the user straight to the index.php page instead of
>> apply.php page ? .
>>
>> Put the following on your form page .....
>>
>>
>>
>> Put the following in the index.php page .....
>>
>>
>> $msg=$_REQUEST['passform'];
>> if ($msg==1) {" Thank you for your request! Someone will be
>> contacting you soon. ";}
>> ?>
>>
>> The rest of your index.php page will de displayed as normal .
>>
>> --
>> (c) The Amazing Krustov
>
> I set it up so the form posts to the apply page to processes the form
> input and send the email. I suppose I could do it all on the index
> page but generally prefer not to.
>
> Thanks,
> Tim
>
>
I'm the same way, Tim. I like to keep my processing separate, and do it
like you do. And it beats having an index.php page which dozens of
conditional include statements.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Re: redirect after send form to email with message
am 30.09.2007 21:03:04 von Shelly
"Big Moxy" wrote in message
news:1191172750.284452.225190@r29g2000hsg.googlegroups.com.. .
> On Sep 30, 10:39 am, Krustov wrote:
>>
>>
>>
>> <1191168309.331313.203...@o80g2000hse.googlegroups.com>
>>
>> > I want to redirect the user back to the home page after submitting
>> > their form inquiry and display a message on the home page. I tried
>> > this in my send mail (apply.php) file -
>>
>> > $_SESSION['sent_message'] == "Thank you for your request! Someone will
>> > be contacting you soon.";
>> > header("location:index.php");
>>
>> Why not send the user straight to the index.php page instead of
>> apply.php page ? .
>>
>> Put the following on your form page .....
>>
>>
>>
>> Put the following in the index.php page .....
>>
>>
>> $msg=$_REQUEST['passform'];
>> if ($msg==1) {" Thank you for your request! Someone will be
>> contacting you soon. ";}
>> ?>
>>
>> The rest of your index.php page will de displayed as normal .
>>
>> --
>> (c) The Amazing Krustov
>
> I set it up so the form posts to the apply page to processes the form
> input and send the email. I suppose I could do it all on the index
> page but generally prefer not to.
>
> Thanks,
> Tim
....or not have the apply page put up any html at all and at the end of
processing redirect to the index page via a header statement.
Shelly
Re: redirect after send form to email with message
am 30.09.2007 21:04:18 von Shelly
"Jerry Stuckle" wrote in message
news:W6adnfYtA_AaeWLbnZ2dnUVZ_g-dnZ2d@comcast.com...
> Big Moxy wrote:
>> On Sep 30, 10:39 am, Krustov wrote:
>>>
>>>
>>>
>>> <1191168309.331313.203...@o80g2000hse.googlegroups.com>
>>>
>>>> I want to redirect the user back to the home page after submitting
>>>> their form inquiry and display a message on the home page. I tried
>>>> this in my send mail (apply.php) file -
>>>> $_SESSION['sent_message'] == "Thank you for your request! Someone will
>>>> be contacting you soon.";
>>>> header("location:index.php");
>>> Why not send the user straight to the index.php page instead of
>>> apply.php page ? .
>>>
>>> Put the following on your form page .....
>>>
>>>
>>>
>>> Put the following in the index.php page .....
>>>
>>>
>>> $msg=$_REQUEST['passform'];
>>> if ($msg==1) {" Thank you for your request! Someone will be
>>> contacting you soon. ";}
>>> ?>
>>>
>>> The rest of your index.php page will de displayed as normal .
>>>
>>> --
>>> (c) The Amazing Krustov
>>
>> I set it up so the form posts to the apply page to processes the form
>> input and send the email. I suppose I could do it all on the index
>> page but generally prefer not to.
>>
>> Thanks,
>> Tim
>>
>>
>
> I'm the same way, Tim. I like to keep my processing separate, and do it
> like you do. And it beats having an index.php page which dozens of
> conditional include statements.
This is gettin dangerous, Jerry (after owu knock-down, drag-out :-) ), but
we are in agreement too often lately.
Shelly
Re: redirect after send form to email with message
am 30.09.2007 21:14:48 von luiheidsgoeroe
On Sun, 30 Sep 2007 18:39:01 +0200, Krustov wrote:
>
>
>
> <1191168309.331313.203090@o80g2000hse.googlegroups.com>
>
>> I want to redirect the user back to the home page after submitting
>> their form inquiry and display a message on the home page. I tried
>> this in my send mail (apply.php) file -
>>
>> $_SESSION['sent_message'] == "Thank you for your request! Someone=
will
>> be contacting you soon.";
>> header("location:index.php");
>>
>
> Why not send the user straight to the index.php page instead of
> apply.php page ? .
1. Having different scripts doing actual work keeps things clear and =
easily managable. Sure, You could have a whole site in just one index.ph=
p =
page. Would you do that?
2. On as side note: Doing a header redirect prevents those pesky 'do you=
=
want to resubmit you information?' alerts from UA's on a refresh.
-- =
Rik Wasmus
Re: redirect after send form to email with message
am 01.10.2007 00:11:56 von Bucky Kaufman
"Big Moxy" wrote in message
news:1191168309.331313.203090@o80g2000hse.googlegroups.com.. .
>I want to redirect the user back to the home page after submitting
> their form inquiry and display a message on the home page. I tried
> this in my send mail (apply.php) file -
>
> $_SESSION['sent_message'] == "Thank you for your request! Someone will
> be contacting you soon.";
> header("location:index.php");
>
> but got this error -
>
> Notice: Undefined index: sent_message in /home/bigmoxy/public_html/
> projects/senior/apply.php on line 12
After $_SESSION, you used two equals where you should have had one.
>
> Warning: Cannot modify header information - headers already sent by
> (output started at /home/bigmoxy/public_html/projects/senior/apply.php:
> 12) in /home/bigmoxy/public_html/projects/senior/apply.php on line 13
>
> Note that the redirection works without setting the message.
>
> Can someone please advise me on how to accomplish this?
>
> Thank you!
>
> Tim
>