leighgoodman
07-17-2007, 10:11 PM
Hi there
I havnt used php in a while, so im a bit rusty. My form doesnt seem to be working. I am not getting any errors, but the info that the user submits doesnt get emailed to the required email address.
I am working on a staging site - http://www.thequirky.co.uk/staging/signup.php
Can anyone please assist me
Thanks
Leigh
This is my code for the thanks page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>The Quirky - Psychedelic | Acoustic | Folk Rock </title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onload="MM_preloadImages('images/butMusicO.gif','images/butNewsO.gif','images/butMySpaceO.gif','images/butBuyO.gif','images/butContactO.gif')">
<div><img src="images/topImage.jpg" width="757" height="159" border="0" /></div>
<div id="container" style="float:left">
<div class="leftBlock">
<div><img src="images/LeftNavBarTop.gif" /></div>
<div class="leftBlockMiddle" style="float:left">
<p><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','images/butMusicO.gif',1)"><img src="images/butMusic.gif" name="Image4" width="93" height="21" border="0" id="Image4" /></a>
<br />
<a href="news.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','images/butNewsO.gif',1)"><img src="images/butNews.gif" name="Image5" width="93" height="21" border="0" id="Image5" / style="margin-top:4px;"></a>
<br />
<a href="gigs.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','images/butGigsO.gif',1)"><img src="images/butGigs.gif" name="Image6" width="93" height="21" border="0" id="Image6" / style="margin-top:4px;"></a>
<br />
<a href="photos.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image16','','images/butPhotosO.gif',1)"><img src="images/butPhotos.gif" name="Image16" width="93" height="21" border="0" id="Image16" / style="margin-top:4px;"></a></p>
</div>
<div><img src="images/LeftNavBarBottom.gif" /></div>
<div style="margin-top:20px; margin-left:18px; line-height:20px">
<p>> <a href="myspace.html"><strong>Myspace</strong></a><br />
> <a href="signup.php"><strong>Signup</strong></a><br />
> <a href="buy.html"><strong>Buy</strong></a><br />
> <a href="contact.html"><strong>Contact</strong></a><br />
> <a href="links.html"><strong>Links</strong></a></p>
</div>
</div>
<div class="middleContainer">
<?
// email to client
$clientmessage .= "Dear $txtFirstName\r\n\r\n";
$clientmessage .= "Thank you for subscribing to The Quirky. This is an automated response confirming that we have received your subscription. \r\n\r\n";
$clientmessage .= "Kind Regards,\r\n";
$clientmessage .= "The Quirky";
$toemail = $txtEmail;
$subject = "The Quirky - Subscription";
$fromemail = "info@thequirky.co.uk";
mail($toemail, $subject, stripslashes($clientmessage),
"From: $fromemail\r\n"
."X-Mailer: PHP/" . phpversion());
$fullmessage = "";
$fullmessage .= "---------------------------------------------------\r\n";
$fullmessage .= "The Quirky - Quick Enquiry\r\n";
$fullmessage .= "---------------------------------------------------\r\n\r\n";
$fullmessage .= "From: $txtFirstName $txtLastName\r\n";
$fullmessage .= "Email: $txtEmail\r\n";
$fullmessage .= "Telephone: $txtTel\r\n";
$fullmessage .= "Country: $txtCountry\r\n";
$fullmessage .= "---------------------------------------------------\r\n\r\n";
$fullmessage .= "AUTO-EMAIL SENT TO ENQUIRER ALREADY:\r\n\r\n";
$fullmessage .= "$clientmessage\r\n\r\n";
$fullmessage .= "---------------------------------------------------\r\n\r\n";
$toemail = "info@zouklambada.com, dance@zouklambada.com";
$subject = "The Quirky - Quick Enquiry";
$fromemail = $txtEmail;
mail($toemail, $subject, stripslashes($fullmessage),
"From: $fromemail\r\n"
."X-Mailer: PHP/" . phpversion());
?>
<div class="MiddleBlockLong">
<h1>Thanks for signing up!</h1>
<p>Text to go here </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</div>
</div>
<div><img src="images/containerBottom.gif" width="727" height="25" border="0" /></div>
</div>
</body>
</html>
I havnt used php in a while, so im a bit rusty. My form doesnt seem to be working. I am not getting any errors, but the info that the user submits doesnt get emailed to the required email address.
I am working on a staging site - http://www.thequirky.co.uk/staging/signup.php
Can anyone please assist me
Thanks
Leigh
This is my code for the thanks page:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>The Quirky - Psychedelic | Acoustic | Folk Rock </title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onload="MM_preloadImages('images/butMusicO.gif','images/butNewsO.gif','images/butMySpaceO.gif','images/butBuyO.gif','images/butContactO.gif')">
<div><img src="images/topImage.jpg" width="757" height="159" border="0" /></div>
<div id="container" style="float:left">
<div class="leftBlock">
<div><img src="images/LeftNavBarTop.gif" /></div>
<div class="leftBlockMiddle" style="float:left">
<p><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','images/butMusicO.gif',1)"><img src="images/butMusic.gif" name="Image4" width="93" height="21" border="0" id="Image4" /></a>
<br />
<a href="news.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','images/butNewsO.gif',1)"><img src="images/butNews.gif" name="Image5" width="93" height="21" border="0" id="Image5" / style="margin-top:4px;"></a>
<br />
<a href="gigs.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','images/butGigsO.gif',1)"><img src="images/butGigs.gif" name="Image6" width="93" height="21" border="0" id="Image6" / style="margin-top:4px;"></a>
<br />
<a href="photos.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image16','','images/butPhotosO.gif',1)"><img src="images/butPhotos.gif" name="Image16" width="93" height="21" border="0" id="Image16" / style="margin-top:4px;"></a></p>
</div>
<div><img src="images/LeftNavBarBottom.gif" /></div>
<div style="margin-top:20px; margin-left:18px; line-height:20px">
<p>> <a href="myspace.html"><strong>Myspace</strong></a><br />
> <a href="signup.php"><strong>Signup</strong></a><br />
> <a href="buy.html"><strong>Buy</strong></a><br />
> <a href="contact.html"><strong>Contact</strong></a><br />
> <a href="links.html"><strong>Links</strong></a></p>
</div>
</div>
<div class="middleContainer">
<?
// email to client
$clientmessage .= "Dear $txtFirstName\r\n\r\n";
$clientmessage .= "Thank you for subscribing to The Quirky. This is an automated response confirming that we have received your subscription. \r\n\r\n";
$clientmessage .= "Kind Regards,\r\n";
$clientmessage .= "The Quirky";
$toemail = $txtEmail;
$subject = "The Quirky - Subscription";
$fromemail = "info@thequirky.co.uk";
mail($toemail, $subject, stripslashes($clientmessage),
"From: $fromemail\r\n"
."X-Mailer: PHP/" . phpversion());
$fullmessage = "";
$fullmessage .= "---------------------------------------------------\r\n";
$fullmessage .= "The Quirky - Quick Enquiry\r\n";
$fullmessage .= "---------------------------------------------------\r\n\r\n";
$fullmessage .= "From: $txtFirstName $txtLastName\r\n";
$fullmessage .= "Email: $txtEmail\r\n";
$fullmessage .= "Telephone: $txtTel\r\n";
$fullmessage .= "Country: $txtCountry\r\n";
$fullmessage .= "---------------------------------------------------\r\n\r\n";
$fullmessage .= "AUTO-EMAIL SENT TO ENQUIRER ALREADY:\r\n\r\n";
$fullmessage .= "$clientmessage\r\n\r\n";
$fullmessage .= "---------------------------------------------------\r\n\r\n";
$toemail = "info@zouklambada.com, dance@zouklambada.com";
$subject = "The Quirky - Quick Enquiry";
$fromemail = $txtEmail;
mail($toemail, $subject, stripslashes($fullmessage),
"From: $fromemail\r\n"
."X-Mailer: PHP/" . phpversion());
?>
<div class="MiddleBlockLong">
<h1>Thanks for signing up!</h1>
<p>Text to go here </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</div>
</div>
<div><img src="images/containerBottom.gif" width="727" height="25" border="0" /></div>
</div>
</body>
</html>