p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   PHP How-To (http://p2p.wrox.com/forumdisplay.php?f=98)
-   -   If Else linking to HTML page (http://p2p.wrox.com/showthread.php?t=58044)

nodster May 18th, 2007 06:03 AM

If Else linking to HTML page
Hi there,

Using the following code:

if $mailsent($to, $subject, $message, $headers) {
//success page;


//error page;

How do i link to an HTML page using PHP. I have tried using Header ("Location: http//url") but it isn't working[?]

However if i replace the URL link with a simple echo "success" it displays correctly.

Can anyone point me in the correct direction.
Many thanks.

astarsi June 7th, 2007 07:29 AM

I don't know if I really understand what would you like to do...I send the mail from an html page (using a form-redirecting on the php page) and the result(sent or failed) was displayed on a php page


   $subject = "Feedback from web site";
   $mailcontent = "test";
   $from = "sth@gmail.com";

mail($toaddress, $subject, $mailcontent, $from);
    $mailsent = @mail($toaddress, $subject, $mailcontent, $from);
echo $mailsent ? "Mail sent" : "Mail failed";


I hope this will help :)

All times are GMT -4. The time now is 08:13 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.