need help! plz

------=_Part_1798_13836839.1206356640583
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

dear all,

I want to make a form-to-email page and I want to diplay a messagebox after
the mail is send and then I want it to be redirected to another page. I used
JS for the msgbox but the header function wont work in this case. please
help me!

here is the code
....
mail( "m <bomber6man [at] yahoo.com>e [at] mysite.com", "Feedbacks",$message, "From:
$email" );
echo "<script language=javascript>alert('Your message was sent
successfully!');</script>";
header( 'Location: http://www.blah blah.com" ) ;
?>


thank you
Hooman

------=_Part_1798_13836839.1206356640583--
Hooman Fatoorehchi [ Mo, 24 März 2008 12:04 ] [ ID #1930393 ]

Re: need help! plz

You could just do the header line in js as well, which would work. So change to:

mail( "m <bomber6man [at] yahoo.com>e [at] mysite.com", "Feedbacks",$message,
"From: $email" );
echo "echo "<script language=javascript>alert('Your message was sent
successfully!'); document.location.href = 'http://www.blah blah.com';</script>";

John

On Mon, Mar 24, 2008 at 7:04 AM, Hooman Fatoorehchi
<hfatoorehchi [at] gmail.com> wrote:
> dear all,
>
> I want to make a form-to-email page and I want to diplay a messagebox after
> the mail is send and then I want it to be redirected to another page. I used
> JS for the msgbox but the header function wont work in this case. please
> help me!
>
> here is the code
> ...
> mail( "m <bomber6man [at] yahoo.com>e [at] mysite.com", "Feedbacks",$message, "From:
> $email" );
> echo "<script language=javascript>alert('Your message was sent
> successfully!');</script>";
> header( 'Location: http://www.blah blah.com" ) ;
> ?>
>
>
> thank you
> Hooman
>



--
John Mertic
jmertic [at] gmail.com
http://jmertic.wordpress.com

"Explaining a joke is like dissecting a frog: you understand it
better, but the frog dies
in the process." --Mark Twain

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
John Mertic [ Mo, 24 März 2008 13:05 ] [ ID #1930394 ]

Re: need help! plz

You can't call the header after you've sent output to the client (i.e. the
'echo' statement).

Redirect first, then check the mail state, stored as a session variable or
something similar.

Hooman Fatoorehchi wrote:
> dear all,
>
> I want to make a form-to-email page and I want to diplay a messagebox after
> the mail is send and then I want it to be redirected to another page. I used
> JS for the msgbox but the header function wont work in this case. please
> help me!
>
> here is the code
> ...
> mail( "m <bomber6man [at] yahoo.com>e [at] mysite.com", "Feedbacks",$message, "From:
> $email" );
> echo "<script language=javascript>alert('Your message was sent
> successfully!');</script>";
> header( 'Location: http://www.blah blah.com" ) ;
> ?>
>
>
> thank you
> Hooman
>

--
Jarrett M. T. Meyer, M.B.A.
jmtmeyer [at] yahoo.com
http://www.jarrettmeyer.com

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Jarrett Meyer [ Mo, 24 März 2008 14:50 ] [ ID #1930395 ]
PHP » gmane.comp.php.windows » need help! plz

Vorheriges Thema: Issue with MSSQL and PHP under windows
Nächstes Thema: need help building php on windows