Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 18th, 2007, 06:03 AM
Registered User
 
Join Date: May 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default If Else linking to HTML page

Hi there,

Using the following code:
Code:
if $mailsent($to, $subject, $message, $headers) {
//success page;

ELSE

//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.
 
Old June 7th, 2007, 07:29 AM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to astarsi
Default

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

<?

   $toaddress="[email protected]";
   $subject = "Feedback from web site";
   $mailcontent = "test";
   $from = "[email protected]";

mail($toaddress, $subject, $mailcontent, $from);
?>
<html>
<header>
<title>test</title>
</header>
<body>
<?
    $mailsent = @mail($toaddress, $subject, $mailcontent, $from);
echo $mailsent ? "Mail sent" : "Mail failed";
?>

</body>
</html>

I hope this will help :)







Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking to specific areas in a new page CathyM BOOK: Beginning ASP 3.0 2 August 2nd, 2005 09:23 AM
Linking opml/xml files to a html page helensobrien XML 0 February 21st, 2005 01:48 PM
Linking to the last accessed page mahulda ASP.NET 1.0 and 1.1 Basics 4 July 27th, 2004 12:49 AM
Page Linking though DropDown Lists mahulda ASP.NET 1.0 and 1.1 Basics 2 April 23rd, 2004 02:58 PM
How to create HTML page from a dynamic ASP page musharaf Classic ASP Professional 2 March 18th, 2004 09:31 PM





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