- Impact
- 2
I need help with this code. This is the 2nd page of the code. The first page has the form and everything is fine with it. Basically I want the response message to be within the body of the html page (see bolded code for location ) but this code is just showing the message and not the rest of my html page like my logo (see italicized code for location). Can anyone please help?
<?php
$page_to_send = $_GET['page'] . ".php";
$domain = "http://www.domainname.com/";
$complete_url = $domain . $page_to_send;
if (isset($_POST['submit'])) {
$sendername = $_POST['sendername'];
$senderemail = $_POST['senderemail'];
$recipname = $_POST['recipname'];
$recipemail = $_POST['recipemail'];
$custmessage = $_POST['message'];
$urltosend = $_POST['urlsent'];
$staticmsg = "Hi $recipname! \n Your Colleague $sendername has recommended that you read this article from domain name with the following message: \n $custmessage.";
$staticmsg = "$urltosend";
$staticmsg = "SITE PROMOTION TEXT AREA";
$staticmsg = "SITE PROMOTION TEXT AREA";
$staticmsg = "SITE PROMOTION TEXT AREA";
$ipaddress = $_SERVER['REMOTE_ADDR'];
$subject = "A colleague has recommended this article!";
$headers = "From: My Domain \r\n";
$headers .= "Reply-To: $senderemail";
if (mail($recipemail,$subject,$staticmsg,$headers)){
echo "<p>Success. Your message was sent. Go back to the <a href=\"$urltosend\">page you were previously browsing</a>?</p>";
} else {
echo "<p>Your message could not be sent at this time. Go back to the <a href=\"$urltosend\">page you were previously browsing</a>?</p>";
}
} else {
?>
<html>
<head>
<title>PAGE NAME</title>
<meta name="robots" content="noindex,nofollow">
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" language="JavaScript" src="scripts/rollover.js"></script>
<table width="600" border="0">
<tr>
<td colspan="3"><div align="left"><a href="index.htm"><img src="images/logo.gif" alt="" width="313" height="80" border="0"></a><br>
<br>
</div></td>
</tr>
<tr>
<td width="60">ย </td>
<td width="480" class="txt">Thanks for recommeding our article. An e-mail has been sent to <b>$recipemail</b>.<br><br></td>
<td width="60">ย </td>
</tr>
<tr>
<td width="60">ย </td>
<td width="480" align="center"><a href=\"$urltosend\">Back to the Article</a></td>
<td width="60">ย </td>
</tr>
</table>
</body>
</html>
<?php
}
?>
<?php
$page_to_send = $_GET['page'] . ".php";
$domain = "http://www.domainname.com/";
$complete_url = $domain . $page_to_send;
if (isset($_POST['submit'])) {
$sendername = $_POST['sendername'];
$senderemail = $_POST['senderemail'];
$recipname = $_POST['recipname'];
$recipemail = $_POST['recipemail'];
$custmessage = $_POST['message'];
$urltosend = $_POST['urlsent'];
$staticmsg = "Hi $recipname! \n Your Colleague $sendername has recommended that you read this article from domain name with the following message: \n $custmessage.";
$staticmsg = "$urltosend";
$staticmsg = "SITE PROMOTION TEXT AREA";
$staticmsg = "SITE PROMOTION TEXT AREA";
$staticmsg = "SITE PROMOTION TEXT AREA";
$ipaddress = $_SERVER['REMOTE_ADDR'];
$subject = "A colleague has recommended this article!";
$headers = "From: My Domain \r\n";
$headers .= "Reply-To: $senderemail";
if (mail($recipemail,$subject,$staticmsg,$headers)){
echo "<p>Success. Your message was sent. Go back to the <a href=\"$urltosend\">page you were previously browsing</a>?</p>";
} else {
echo "<p>Your message could not be sent at this time. Go back to the <a href=\"$urltosend\">page you were previously browsing</a>?</p>";
}
} else {
?>
<html>
<head>
<title>PAGE NAME</title>
<meta name="robots" content="noindex,nofollow">
<link href="style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" language="JavaScript" src="scripts/rollover.js"></script>
<table width="600" border="0">
<tr>
<td colspan="3"><div align="left"><a href="index.htm"><img src="images/logo.gif" alt="" width="313" height="80" border="0"></a><br>
<br>
</div></td>
</tr>
<tr>
<td width="60">ย </td>
<td width="480" class="txt">Thanks for recommeding our article. An e-mail has been sent to <b>$recipemail</b>.<br><br></td>
<td width="60">ย </td>
</tr>
<tr>
<td width="60">ย </td>
<td width="480" align="center"><a href=\"$urltosend\">Back to the Article</a></td>
<td width="60">ย </td>
</tr>
</table>
</body>
</html>
<?php
}
?>





