Hey all Im no PHP expert was hoping someone could help me with an issue on a site Im updating.
The site currently has some PHP forms, but there is not a clear confirmation/thank you page, and I am trying to install an Adwords conversion (javascript) to render after a form submission.
Here is the code in the header of each page
<?php
if($_SERVER['REQUEST_METHOD']=="POST") {
extract($_POST);
$IP=$_SERVER["REMOTE_ADDR"];
$SUBJECT="Lead";
$MESSAGE1.="<font style='font-family:Georgia, serif; font-size:12px;'>";
$MESSAGE1.="Message via contact form on website:<br /><br />
<strong>Name :</strong> ".$name."<br/>
<strong>Phone :</strong> ".$phone."<br/>
<strong>Address :</strong> ".$address."<br/>
<strong>Zip Code :</strong> ".$zipcode."<br/>
<strong>Job Type :</strong> ".$jobtype."<br/>
<strong>Urgency Level :</strong> ".$urgency."<br/>
<strong>IP address</strong> : ".$IP."<br/><br/>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $name\r\n";
$headers .= "Return-Path: $name <myemail@yahoo.com>\r\n";
// $email="myemail@yahoo.com";
$email="myemail@yahoo.com";
if(mail($email, $SUBJECT, $MESSAGE1, $headers)){
echo '<script>window.location.href="?s=success";</script>'; }
//echo "Email Sent Successfully to ".$fname." (".$femail.").";
}
and then... in the body of the html
<form method="POST" action="" >
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td> </td></tr>
<tr>
<td width="100%"><font size="2" face="Verdana" color="#18181D"><? if(isset($_REQUEST["s"])) { echo "<b>Your form has been submitted.</b>"; } else { echo "";}?></font></td>
</tr>
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td class="formtext" width="45%" valign="top">
<p style="margin-left: 5">Name</p>
</td>
<td width="55%"><input type="text" name="name" id="name" class="searchbox"></td>
</tr>
ETC
ETC
ETC
I was thinking of trying to get the conversion script somehow in the "echo" lines .. but not sure how to do that... otherwise if there is a way to just make it redirect to a static page, I could create the static thankyou.html page and take it from there.
Any advice?
Thanks guys I really appreciate any help you can give.
