In my project i have done some email code to receive the order details, 1 mail to admin and other mail for user..
But some users and admins are receiving the emails with html code.. I checked in many ways with gmail, webmail.. All are displaying good.. Finally I tested with outlook and in outlook mail was getting in html code.. By enquiring the users they said that they r using outlook.. So that issue was with outlook I think so..
Can anyone help me to solve this issue.. Here is the source code which was used for displaying in email message.
$to = $obj_check_out->email;
$subject = "NEW YORK PRODUCT ORDER";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Instyle Customer Accounts <vamsi#mail.com>" . "\r\n";
$message = '<table width="100%" align="center">
<tbody><tr><td bgcolor="#393939">
<br>
<br>
<table cellspacing="0" cellpadding="0" width="650" border="0" align="center">
<tbody>
<tr>
<td width="10" bgcolor="#efefef">
<img src="images/newsletter/top_left.jpg" class="CToWUd">
</td>
<td width="630" height="92" bgcolor="#efefef" background="images/newsletter/top_bg.jpg">
<table width="630">
<tbody>
<tr>
<td width="514">
<font color="#333333" style="font-family:Tahoma;font-size:12px">
<br>
<b><a target="_blank" href="#"><span class="il">NEWYORK</span>.COM</a> ORDER CONFIRMATION</b> </font>
<font color="#333333" style="font-family:Tahoma;font-size:10px">[ DATE: '.$response["date_ordered"].' ]</font>
</td>
<td width="104" align="right">
<font color="#333333" style="font-family:Tahoma;font-size:12px">
<br>
<b>ORDER#:</b></font>
<font color="#333333" style="font-family:Tahoma;font-size:10px"> '.$response["order_log_id"].'</font>
</td>
</tr>
</tbody>
</table>
<br>
</td>
<td width="10" bgcolor="#efefef">
<img src="images/newsletter/top_right.jpg" class="CToWUd">
</td>
</tr>
<tr>
<td bgcolor="#efefef"> </td>
<td bgcolor="#efefef">
<font color="#333333">
<table cellspacing="0" cellpadding="2" width="630" border="0">
<tbody>
<tr>
<td height="35" bgcolor="#767676" background="images/newsletter/bar_bg.jpg" colspan="2">
<font color="#ffffff" style="font-family:Tahoma;font-size:12px">
<b>SHIPPING DETAILS</b></font>
</td>
</tr>
<tr>
<td width="170"> <font style="font-family:Tahoma;font-size:10px"><b>Name :</b></font></td>
<td width="452"><font style="font-family:Tahoma;font-size:10px">'.$response["firstname"].' '.$response["lastname"].'</font></td>
</tr>
<tr>
<td> <font style="font-family:Tahoma;font-size:10px"><b>Address :</b></font></td>
<td><font style="font-family:Tahoma;font-size:10px">'.$response["ship_address1"].' '.$response["ship_address2"].'</font></td>
</tr>
<tr>
<td> <font style="font-family:Tahoma;font-size:10px"><b>City :</b></font></td>
<td><font style="font-family:Tahoma;font-size:10px">'.$response["ship_city"].'</font></td>
</tr>
<tr>
<td> <font style="font-family:Tahoma;font-size:10px"><b>State :</b></font></td>
<td><font style="font-family:Tahoma;font-size:10px">'.$response["ship_state"].'</font></td>
</tr>
<tr>
<td> <font style="font-family:Tahoma;font-size:10px"><b>Country :</b></font></td>
<td><font style="font-family:Tahoma;font-size:10px">'.$response["ship_country"].'</font></td>
</tr>
<tr>
<td> <font style="font-family:Tahoma;font-size:10px"><b>Zip :</b></font></td>
<td><font style="font-family:Tahoma;font-size:10px">'.$response["ship_zipcode"].'</font></td>
</tr>
<tr>
<td> <font style="font-family:Tahoma;font-size:10px"><b>Phone :</b></font></td>
<td><font style="font-family:Tahoma;font-size:10px">'.$response["telephone"].'</font></td>
</tr>
<tr>
<td> <font style="font-family:Tahoma;font-size:10px"><b>Email :</b></font></td>
<td><font style="font-family:Tahoma;font-size:10px"><a target="_blank" href="mailto:'.$response["email"].'">'.$response["email"].'</a></font></td>
</tr>
<tr>
<td> <font style="font-family:Tahoma;font-size:10px"><b>Courier :</b></font></td>
<td><font style="font-family:Tahoma;font-size:10px">'.$response["courier"].'</font></td>
</tr>
</tbody>
</table>
<br>
<table cellspacing="0" cellpadding="2" width="630" border="0">
<tbody><tr>
<td background="images/newsletter/bar_bg.jpg" align="center"><font color="#a1a1a1" style="font-family:Tahoma;font-size:11px"><b>Thumb</b></font></td>
<td background="images/newsletter/bar_bg.jpg" align="center"><font color="#a1a1a1" style="font-family:Tahoma;font-size:11px"><b>Item</b></font></td>
<td background="images/newsletter/bar_bg.jpg" align="center"><font color="#a1a1a1" style="font-family:Tahoma;font-size:11px"><b>Style Number</b></font></td>
<td background="images/newsletter/bar_bg.jpg" align="center"><font color="#a1a1a1" style="font-family:Tahoma;font-size:11px"><b>Size</b></font></td>
<td background="images/newsletter/bar_bg.jpg" align="center"><font color="#a1a1a1" style="font-family:Tahoma;font-size:11px"><b>Color</b></font></td>
<td background="images/newsletter/bar_bg.jpg" align="center"><font color="#a1a1a1" style="font-family:Tahoma;font-size:11px"><b>Quantity</b></font></td>
<td background="images/newsletter/bar_bg.jpg" align="center"><font color="#a1a1a1" style="font-family:Tahoma;font-size:11px"><b>Price</b></font></td>
<td background="images/newsletter/bar_bg.jpg" align="center"><font color="#a1a1a1" style="font-family:Tahoma;font-size:11px"><b>Subtotal</b></font></td>
</tr>
'.$ordermsg.'
<tr>
<td align="right" colspan="7"><font style="font-family:Tahoma;font-size:12px">Grand-Total : </font></td>
<td align="right"><font style="font-family:Tahoma;font-size:12px">$'.$grandtotal.'</font></td>
</tr>
<tr>
<td align="right" colspan="7"><font style="font-family:Tahoma;font-size:9px">( For countries other than United State, you will be contacted by customer service for shipping fees ) </font></td>
<td align="center"></td>
</tr>
<tr>
<td align="center" colspan="8"><font style="color:red;font-family:Tahoma;font-size:9px"><br><br>* NOTE: Your order was received and will ship according to the availability notice on product page. </font><br></td>
</tr>
</tbody></table>
<table width="630" align="center" style="border-top:1px solid black">
<tbody><tr>
<td width="630" align="center">
<font color="#333333" style="font-family:Tahoma;font-size:10px">
<span class="il">Instyle</span> <span class="il">New</span> <span class="il">York</span>
230 West 38th Street
<span class="il">New</span> <span class="il">York</span>, NY 10018
PHONE: 212-840-0846 ext 22 EMAIL <a target="_blank" href="mailto:vamsi#gmail.com">info#<span class="il">company</span>.com</a>
</font>
</td>
</tr>
<tr>
<td width="630" align="center">
<font color="#333333" style="font-family:Tahoma;font-size:10px">
Purchaser agrees to abide by the <a target="_blank" href="#"><span class="il">company</span>.com</a> return policy.
</font>
</td>
</tr>
</tbody></table>
</font>
</td>
<td bgcolor="#efefef"> </td>
</tr>
<tr>
<td><img src="images/newsletter/bottom_left.jpg" class="CToWUd"></td>
<td><img src="images/newsletter/bottom_bg.jpg" class="CToWUd"></td>
<td><img src="images/newsletter/bottom_right.jpg" class="CToWUd"></td>
</tr>
</tbody>
</table>
<br><br>
</td></tr>
</tbody>
</table>';
mail($to,$subject,$message,$headers);
The email in outlook getting the same html code of $message with containing order details..
Thanks
If your code doesn't contain a valid <!doctype html> declaration and <body> tags etc, then that could contribute to the problem.
People using Outlook (or other similar mail clients) may have their settings set to not display HTML and images. I have seen that happen quite often before.
This stands at being a local issue and you have no control over that.
Therefore, you need to include a seperate header as TEXT only which is the usual norm when sending mail.
Use Phpmailer or Swiftmailer. That should solve everything.
References:
https://github.com/PHPMailer/PHPMailer
http://phpmailer.worxware.com/
http://swiftmailer.org/
and read the documentation on its implementation.
Other options are to use services such as MailChimp, Constant Contact etc. which work well and are services that are used widely and are already setup to handle both HTML and plain text formats.
http://mailchimp.com/
http://www.constantcontact.com/
Related
I want to replace everything between a TD-Tag that has the attribute/value colspan=6.
All this I want to replace ...
<TD colspan=6 rowspan=4 align="center" nowrap="1">
<TABLE>
<TR>
<TD width="50%" nowrap=1><font size="3" face="Arial">
Some Text
</font>
</TD>
</TR>
<TR>
<TD width="50%" nowrap=1><font size="3" face="Arial">
Some Text
</font>
</TD>
</TR>
<TR>
<TD width="50%" nowrap=1><font size="3" face="Arial">
Some Text
</font>
</TD>
</TR>
</TABLE>
</TD>
...with this lines:
<TD colspan=12 rowspan=2 align="center" nowrap="1">
<TABLE>
<TR>
<TD>frei</TD>
Some Text
</TR>
</TABLE>
</TD>
Any Ideas? Maybe with simple_html_dom.php?
Solved with PHP and Regex:
$plan1 = preg_replace('~<TD colspan=6.*?</TR></TABLE></TD>~s",
"<TD colspan=12 rowspan=2 align="center" nowrap="1">
<TABLE><TR><TD></TD></TR></TABLE></TD>', $plan1);
I am getting this error:
Warning: Cannot modify header information - headers already sent by (output started at /home/renta142/public_html/includes/connection_prop.php:14) in /home/renta142/public_html/login.php on line 31
My PHP Code is:
<?php
session_start();
if($_SESSION['user']['id']!=""){
header("location:index.php");
exit();
}
$login_email=$_POST[email];
$username=$_POST[username1];
$name=$_POST[name];
$er=$_POST[er];
if(trim($_POST["SignIn"])=="Sign In"){
include("includes/connection_user.php");
$user_=$_POST["username"];
$pass=$_POST["pass"];
$query=mysql_query("select * from user_registration where UserID='".$user_."' and Password='".$pass."' and Display='1'");
$result=mysql_fetch_array($query);
if(!strcmp($result[Password],$pass)){
$_SESSION['user']['id'] = $result[AID];
$_SESSION['user']['password'] = $result[Password];
$_SESSION['user']['username'] = $result[UserID];
$_SESSION['user']['name']=$result[Name];
$ref=$_SESSION["refer_url"];
if($_REQUEST['ref']=="sell"){
header("Location:postproperty_sell.php");
exit();
}
else if($ref==""){
header("Location:postproperty.php");
exit();
}
else{
header("Location:$ref");
exit();
}
}else{
$errsg="Invalid Username and Password !";
}
mysql_close();
}
include("config.php");
$sitename=ucfirst($thirdsite)." - Property in ".ucfirst($addresscity);
$keys="property in ".ucfirst($addresscity);
$desc="Real estate agents offers - property in ".ucfirst($addresscity);
include("includes/header.php");
include("includes/left.php");
?>
<script language='javascript' src="images/script.js"></script>
<script type="text/javascript">
function popUp_file(URL){
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=1,statusbar=0,menubar=0,resizable=0,width=900,height=600');");
}
<?php if($_REQUEST[fcode]=='wrong'){?>
window.onload=function(){document.getElementById('fpass').style.display='block';}
<?php }?>
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<td valign="top" align="center" colspan="2">
<table width="794" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" align="right" valign="bottom"><img src="images/11.jpg" width="10" height="10" alt="" /></td>
<td width="97%" style="background:url(images/12.jpg) repeat-x bottom;"> </td>
<td width="2%" align="left" valign="bottom"><img src="images/13.jpg" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" class="green"> </td>
<td> </td>
</tr>
<tr>
<td align="left" valign="middle" class="green"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="5%"><img src="images/customer_login.gif" alt="CUSTOMER LOGIN" width="24" height="23" /></td>
<td width="92%">PROPERTY OWNER LOGIN </td>
</tr>
</table></td>
<td align="left" class="green"><table width="100%" border="0" cellpadding="00" cellspacing="0">
<tr>
<td width="5%"><img src="images/mbenifites.gif" alt="MEMBERSHIP BENEFITS" width="16" height="17" /></td>
<td width="92%"> FREE MEMBERSHIP BENEFITS</td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"> </td>
<td valign="top"> </td>
</tr>
<tr>
<td width="50%" valign="top"><?php if($errsg){ echo "<br /><div class='alert' align='center'>".$errsg."</div><br />"; } ?>
<table width="100%" cellpadding="4" cellspacing="1" class="heading" valign="top">
<form action="login.php?ref=<?php echo $_REQUEST['ref']; ?>" method="post" name="signin" id="signin" onsubmit="return loginform();">
<tr>
<td class="txt">Username<font color="red">*</font></td>
<td width="1" align="left"><strong>:</strong></td>
<td align="left"><input name="username" type="text" id="username" onfocus="if(this.value=='Username') this.value='';" onblur="if(this.value=='') this.value='Username';" value="Username" /></td>
</tr>
<tr>
<td class="txt">Password<font color="red">*</font></td>
<td align="left"><strong>:</strong></td>
<td align="left"><input type="password" name="pass" onfocus="if(this.value=='**********') this.value='';" onblur="if(this.value=='') this.value='**********'" value="**********" /></td>
</tr>
<tr>
<td> </td>
<td align="left"> </td>
<td align="left"><input type="submit" name="SignIn" value="Sign In" class="button" /></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td align="left"><font color="#333333" size="2" face="Arial, Helvetica, sans-serif"> <img src="images/nuser.gif" alt="New User registration" width="19" height="21" alt="" /> New User ?</font><a href="login.php#reg"><font color="#0000FF" size="2" face="Arial, Helvetica, sans-serif">Register First</font><br />
</a> <font color="#0000FF" size="2" face="Arial, Helvetica, sans-serif">Forgot Password </font></td>
</tr>
</form>
</table></td>
<td width="50%" valign="top" style="background:url(images/login_page.jpg) no-repeat right; height:200px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top"><table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="11%" align="center" valign="top" style="padding-top:8px;"><img src="images/bullet-cir1.jpg" width="8" height="8" alt="" /></td>
<td width="89%" valign="top"><font size="2" face="Arial, Helvetica, sans-serif">Advertise your properties for Sale/Rent/PG </font></td>
</tr>
<tr>
<td align="center" valign="top" style="padding-top:8px;"><img src="images/bullet-cir1.jpg" width="8" height="8" alt="" /></td>
<td valign="top"><font size="2" face="Arial, Helvetica, sans-serif">Get Special offers and freebies</font></td>
</tr>
<tr>
<td align="center" valign="top" style="padding-top:8px;"><img src="images/bullet-cir1.jpg" width="8" height="8" alt="" /></td>
<td valign="top"><font size="2" face="Arial, Helvetica, sans-serif">Get updates on our new products</font></td>
</tr>
<tr>
<td align="center" valign="top" style="padding-top:8px;"><img src="images/bullet-cir1.jpg" width="8" height="8" alt="" /></td>
<td valign="top"><font size="2" face="Arial, Helvetica, sans-serif">Response through mail, phone</font></td>
</tr>
</table> </td>
</tr>
</table></td></tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" ><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="border:#3399FF 1px solid;">
<tr>
<td align="left" bgcolor="#E1F1F4" style="padding-left:3px; padding-right:3px;"> <strong><font size="2" face="Arial, Helvetica, sans-serif"><img src="images/note.gif" alt="<?php echo $thirdsite ?>is commited your information is strictly confidential, unless you want to expose it." width="19" height="18" /> Note:</font></strong></td>
</tr>
<tr>
<td align="center" bgcolor="#E1F1F4" style="padding-left:3px; padding-right:3px;"><div align="justify" style="padding-left:3px; padding-right:3px;"><font color="#666666" size="2" face="Arial, Helvetica, sans-serif"> <?php echo ucfirst($thirdsite); ?> is commited your information is strictly confidential, unless you want to expose it.</font></div></td>
</tr>
<tr>
<td align="center" bgcolor="#E1F1F4"> </td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td align="right" valign="top"><img src="images/31.jpg" width="10" height="10" alt="" /></td>
<td style="background:url(images/32.jpg) repeat-x top;"> </td>
<td align="left" valign="top"><img src="images/33.jpg" width="10" height="10" alt="" /></td>
</tr>
</table></td>
</tr>
<tr>
<td></td>
</tr>
</table>
<a name="fp"></a>
<div id="fpass" style="display:none;">
<table width="794" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" align="right" valign="bottom"><img src="images/11.jpg" width="10" height="10" alt="" /></td>
<td width="97%" style="background:url(images/12.jpg) repeat-x bottom;"> </td>
<td width="2%" align="left" valign="bottom"><img src="images/13.jpg" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"> </td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"><table width="100%" border="0" cellpadding="00" cellspacing="0">
<tr>
<td width="3%"><span class="green"><img src="images/forget_pass.gif" alt="FORGOT PASSWORD" width="20" height="19" /></span></td>
<td width="97%"><span class="green"> FORGOT PASSWORD</span></td>
</tr>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td><table width="100%" border="0" align="right" cellpadding="2" cellspacing="0">
<form action="forget_password_submit.php" method="post" name="forget_password" id="forget_password">
<input type="hidden" name="chk" value="2" />
<?php if($_GET[fcode]) echo ' <tr>
<td class="alert" align="center" colspan="3">Your EmailID or UserName Is Not Found In Our Database, Please Try Again!!!</td></tr>';?>
<tr >
<td width="20%" align="right" valign="top" class="txt"> Username</td>
<td width="2%" valign="top"><b>:</b></td>
<td width="78%" align="left" valign="top"><input type="text" name="username1" /></td>
</tr>
<tr>
<td colspan="2" align="right" class="heading"> OR</td>
<td class="heading" align="left"> </td>
</tr>
<tr>
<td align="right" valign="top" class="txt"> Email-ID</td>
<td valign="top"><b>:</b></td>
<td align="left" valign="top"><input type="text" name="email1" /></td>
</tr>
<tr>
<td colspan="3" align="right" height="8"></td>
</tr>
<tr>
<td align="right"> </td>
<td align="center"> </td>
<td align="left"><input name="submit" type="submit" onclick="return ForgetpassForm();" value="Submit" class="button" /></td>
</tr>
<tr>
<td align="right"> </td>
<td align="right"> </td>
<td align="left"><font color="#333333" size="2" face="Arial, Helvetica, sans-serif"><img src="images/login.gif" alt="Existin user login" width="19" height="21" /></font> <font color="#0000FF" size="2" face="Arial, Helvetica, sans-serif"><strong>Login</strong></font></td>
</tr>
<tr>
<td align="right" colspan="4" height="8"></td>
</tr>
<tr>
<td colspan="3" align="right"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" style="border:#3399FF 1px solid;">
<tr>
<td align="left" bgcolor="#E1F1F4" style="padding-left:3px; padding-right:3px;"> <strong><font size="2" face="Arial, Helvetica, sans-serif"><img src="images/note.gif" alt="Enter Your UserName or Email-ID which you had entered in registration form and get your password through eMail." width="19" height="18" /></font></strong><strong><font size="2" face="Arial, Helvetica, sans-serif"> Note:</font></strong></td>
</tr>
<tr>
<td align="center" bgcolor="#E1F1F4" style="padding-left:3px; padding-right:3px;"><div align="justify" style="padding-left:3px; padding-right:3px;"><span class="text"> Enter Your UserName or Email-ID which you had entered in registration form and get your password through eMail. </span></div></td>
</tr>
<tr>
<td align="center" bgcolor="#E1F1F4"> </td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="3" align="center" height="7"></td>
</tr>
</form>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td align="right" valign="top"><img src="images/31.jpg" width="10" height="10" alt="" /></td>
<td style="background:url(images/32.jpg) repeat-x top;"> </td>
<td align="left" valign="top"><img src="images/33.jpg" width="10" height="10" alt="" /></td>
</tr>
</table></td>
</tr>
</table>
</div>
<?php //if($errsg=="Invalid Username and Password !"){?>
<a name="reg"></a>
<table width="794" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" align="right" valign="bottom"><img src="images/11.jpg" width="10" height="10" alt="" /></td>
<td width="97%" style="background:url(images/12.jpg) repeat-x bottom;"> </td>
<td width="2%" align="left" valign="bottom"><img src="images/13.jpg" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"> </td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left" class="heading"><table width="100%" border="0" cellpadding="00" cellspacing="0">
<tr>
<td width="3%"><img src="images/if_you_do.gif" alt="If you do not have an existing Customer Account with us fill in the form below" width="19" height="19" /></td>
<td width="97%"> If you do not have an existing User Account with us fill in the form below. </td>
</tr>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"> </td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td align="right" valign="top"><img src="images/31.jpg" width="10" height="10" alt="" /></td>
<td style="background:url(images/32.jpg) repeat-x top;"> </td>
<td align="left" valign="top"><img src="images/33.jpg" width="10" height="10" alt="" /></td>
</tr>
</table></td>
</tr>
</table>
<table width="794" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" align="right" valign="bottom"><img src="images/11.jpg" width="10" height="10" alt="" /></td>
<td width="97%" style="background:url(images/12.jpg) repeat-x bottom;"> </td>
<td width="2%" align="left" valign="bottom"><img src="images/13.jpg" width="10" height="10" alt="" /></td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left" class="green"><table width="100%" border="0" cellpadding="00" cellspacing="0">
<tr>
<td width="5%"><img src="images/NEW-USER-REGISTER-FORM.gif" alt="NEW USER REGISTER FORM " width="26" height="27" /></td>
<td width="97%"> NEW USER REGISTER FORM </td>
</tr>
</table></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"> </td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td style="background:url(images/21.jpg) repeat-y right;"> </td>
<td align="left"><form name="register" method="POST" action="registration_submit.php?ref=<?php echo $_REQUEST['ref']; ?>" onsubmit="return registerForm();">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" valign="top" style="border:#CCCCCC 1px solid;">
<table width="100%" cellpadding="4" cellspacing="0">
<tr>
<td bgcolor="#EEEEEE"><font size="2" face="Arial, Helvetica, sans-serif">User Login Information</font></td>
<td bgcolor="#EEEEEE"> </td>
<td align="right" bgcolor="#EEEEEE"><span class="alert">* Mandatory Fields</span></td>
</tr>
<tr>
<td width="39%" class="tdspace txt"><font color="red">*</font>Username</td>
<td width="3%">:</td>
<td width="58%"><input name="username" type="text" id="username" size="25" /></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Password</td>
<td>:</td>
<td><input type="password" name="password" size="25" /></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Confirm Password</td>
<td>:</td>
<td><input type="password" name="rpassword" size="25" /></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Email-ID</td>
<td>:</td>
<td><input type="text" name="email" size="25" /></td>
</tr>
<tr>
<td colspan="3" bgcolor="#EEEEEE"><font size="2" face="Arial, Helvetica, sans-serif">Contact Information</font></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Name</td>
<td>:</td>
<td><input type="text" name="name" size="25" /></td>
</tr>
<tr>
<td class="tdspace txt"><font color="red">*</font>Verification Code</td>
<td>:</td>
<td><input name="verify_code" type="text" size="15" />
<img src="verificationimage.php" alt="verification image, type it in the box" width="60" height="30" align="absbottom"/></td>
</tr>
<tr>
<td colspan="3" class="text"><input type="checkbox" name="term" />
I have read <font color="red">Terms and Conditions</font> and I accept these conditions.</td>
</tr>
<tr>
<td align="center"> </td>
<td align="center"> </td>
<td align="left"><input name="submit2" type="submit" value="Submit" class="button" />
<input name="reset" type="reset" value="Reset" class="button" />
<input name="flg" type="hidden" id="flg" value="1" /></td>
</tr>
</table></td>
<td width="1%" > </td>
<td width="49%" valign="top"><img src="images/register.jpg" alt="For Free registration on <?php echo ucfirst($thirdsite); ?>, Advertise your properties for Sale/Rent/PG, Get Special offers and freebies, Get updates on our new products, Response through mail, phone" width="380" height="380" /></td>
</tr>
</table>
</form></td>
<td style="background:url(images/22.jpg) repeat-y left;"> </td>
</tr>
<tr>
<td align="right" valign="top"><img src="images/31.jpg" width="10" height="10" alt="" /></td>
<td style="background:url(images/32.jpg) repeat-x top;"> </td>
<td align="left" valign="top"><img src="images/33.jpg" width="10" height="10" alt="" /></td>
</tr>
</table></td>
</tr>
</table>
<?php //}?>
</td>
<script language='javascript'>signin.username.focus();</script>
<?php
//include("includes/right.php");
include("includes/footer.php");
?>
public_html/includes/connection_prop.php:14 is probably outputting some blank spaces. Check that file and other includes for whitespace around tags.
You cannot send headers if any text has already been output
I am writing a script for a film. I have a basic script that sends an HTML email to two sets of emails. On the form you enter in the event information and that information gets sent to two lists of users, the "Desired Guests" and the "Undesired Guests" they both get the same exact HTML email however I need the email for the "Undesired Guests" to go to the spam folder. So what I did was for the "Undesired Guest" email list was insert a bunch of spam content into the body of the email as I need this email to send to the spam folder. The "Desired Guests" email should go to the inbox just fine (as is currently is)
Is there any way I can make the "Undesired Guests" email to go spam for sure? Can I send the email through an outside server with a different IP and bad reputation to make these emails go to spam?
Any input would be a great help.
<?php
if(isset($_POST['submit'])) {
$event = strtoupper($_POST['event']);
$host = strtoupper($_POST['host']);
$location = strtoupper($_POST['location']);
$date = $_POST['date'];
$start_time = $_POST['start_time'];
$end_time = $_POST['end_time'];
$msg = ucfirst($_POST['msg']);
$mainuser = $_POST['mainuser'];
$wrong_user = $_POST['wrong_user'];
if($mainuser!='') {
$user_mail = explode(",", $mainuser);
$count = count($user_mail);
$sub = "You're Invited";
$sender = "info#cdell.me";
for($i=0;$i<$count;$i++){
$mail_to = $user_mail[$i];
$mail_body =
'<style type="text/css">
<!--
.style1 {color: #8f8f8f}
-->
</style>
</head>
<body style="font-family:Arial, Helvetica, sans-serif; background:#f5f5f5; line- height:24px;">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>
<td><img src="http://www.cdell.me/invite-site/header.png" width="600" height="200" /></td>
</tr>
<tr>
<td height="50" bgcolor="#ececec"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#e0e0e0" style="padding:20px; font-size:16px; color:#8f8f8f" align="center">
<p><strong>'.$event.'</strong></p>
<p><strong>When:</strong> '.$date.' '.$start_time.' - '.$end_time.'</p>
<p><strong>Where:</strong> '.$location.'</p>
<p><strong>Message From '.$host.':</strong> <br /> '.$msg.'</p><br /><br /></td>
</tr>
<tr>
<td bgcolor="#e0e0e0" align="center">RSVP!</td>
</tr>
<tr>
<td height="30" bgcolor="#e0e0e0"> </td>
</tr>
<tr>
<td height="40"> </td>
</tr>
<tr>
<td><table width="520" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="5" style="border-bottom:solid 1px #2ecc71"> </td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table width="600" border="0" cellpadding="0" cellspacing="0" bgcolor="#2ecc71">
<tr>
<td width="40"> </td>
<td width="240"> </td>
<td width="40"> </td>
<td width="240"> </td>
<td width="40"> </td>
</tr>
<td width="40"> </td>
<td width="240"> </td>
<td width="40"> </td>
<td width="240"> </td>
<td width="40"> </td>
</tr>
</table></td>
</tr>
</table>
</body>';
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "to:".$ro['emai_addrs']."\r\n";
$headers .= "from: ".$sender."\r\n";
mail($mail_to, $sub, $mail_body, $headers);
//echo $mail_body;
}
}
if($wrong_user!='') {
$user_mail=explode(",", $wrong_user);
$count=count($user_mail);
$sub="INVITATION";
$sender="";
for($i=0;$i<$count;$i++) {
$mail_to = $user_mail[$i];
$mail_body =
'<style type="text/css">
<!--
.style1 {color: #8f8f8f}
-->
</style>
</head>
<body style="font-family:Arial, Helvetica, sans-serif; background:#f5f5f5; line-height:24px;">
<table width="600" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>
<td><img src="http://www.cdell.me/invite-site/header.png" width="600" height="200" /></td>
</tr>
<tr>
<td height="50" bgcolor="#ececec"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#e0e0e0" style="padding:20px; font-size:16px; color:#8f8f8f" align="center">
<p><strong>'.$event.'</strong></p>
<p><strong>When:</strong> '.$date.' '.$start_time.' - '.$end_time.'</p>
<p><strong>Where:</strong> '.$location.'</p>
<p><strong>Message From '.$host.':</strong> <br /> '.$msg.'</p><br /><br /></td>
</tr>
<tr>
<td bgcolor="#e0e0e0" align="center">RSVP!</td>
</tr>
<tr>
<td height="30" bgcolor="#e0e0e0"> </td>
</tr>
<tr>
<td height="40" style="color:white;"> 9 INCH PENIS, SPAM EMAIL, THIS IS SPAM, 10 INCH PENIS, VIAGRA, PENIS ENLARGMENT, NIGERAIAN $$$100,000,000.00, FREE CREDIT REPORT, FREE 10 INCH PENIS ENLARGER, CLICK HERE FOR FREE VIAGRA WIN A FREE CAR!!! WORTH 10K$$$, NO CREDIT CHECK PAYDAY LOANS, CAR LOANS, INHERIT $10,675,981.98 US CURRENCY FROM NIGERIAN PRINCE US BANK ACCOUNT NEEDED</td>
</tr>
<tr>
<td><table width="520" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="5" style="border-bottom:solid 1px #2ecc71"> </td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td style="color:23cc71;"><table width="600" border="0" cellpadding="0" cellspacing="0" bgcolor="#2ecc71" style="color:23cc71;">
<tr>
<td bgcolor="#2ecc71" style=" color:#2ecc71;" align="center">
9 INCH PENIS, SPAM EMAIL, THIS IS SPAM, 10 INCH PENIS, VIAGRA, PENIS ENLARGMENT, NIGERAIAN $$$100,000,000.00, FREE CREDIT REPORT, FREE 10 INCH PENIS ENLARGER, CLICK HERE FOR FREE VIAGRA</td>
<td width="240" bgcolor="#2ecc71" style=" color:#2ecc71;" align="center"> WIN A FREE CAR!!! WORTH 10K$$$, NO CREDIT CHECK PAYDAY LOANS, CAR LOANS, INHERIT $10,675,981.98 US CURRENCY FROM NIGERIAN PRINCE US BANK ACCOUNT NEEDED</td>
<td width="40" bgcolor="#2ecc71" style=" color:#2ecc71;" align="center"> </td>
<td width="240" bgcolor="#2ecc71" style=" color:#2ecc71;" align="center"> </td>
<td width="40" bgcolor="#2ecc71" style=" color:#2ecc71;" align="center"> </td>
</tr>
<td width="40" bgcolor="#2ecc71" style=" color:#2ecc71;" align="center"> 9 INCH PENIS, SPAM EMAIL, THIS IS SPAM, 10 INCH PENIS, VIAGRA, PENIS ENLARGMENT, NIGERAIAN $$$100,000,000.00, FREE CREDIT REPORT, FREE 10 INCH PENIS ENLARGER, CLICK HERE FOR FREE VIAGRA</td>
<td width="240" bgcolor="#2ecc71" style=" color:#2ecc71;" align="center"> </td>
<td width="40" bgcolor="#2ecc71" style=" color:#2ecc71;" align="center"> </td>
<td width="240" bgcolor="#2ecc71" style=" color:#2ecc71;" align="center"> 9 INCH PENIS, SPAM EMAIL, THIS IS SPAM, 10 INCH PENIS, VIAGRA, PENIS ENLARGMENT, NIGERAIAN $$$100,000,000.00, FREE CREDIT REPORT, FREE 10 INCH PENIS ENLARGER, CLICK HERE FOR FREE VIAGRA</td>
<td width="40" bgcolor="#2ecc71" style=" color:#2ecc71;" align="center">
<!-- Spam Pixel Images -->
<img src="http://www.cdell.me/invite-site/green-pixel1.png" />
<img src="http://www.cdell.me/invite-site/green-pixel2.png" />
<img src="http://www.cdell.me/invite-site/green-pixel3.png" />
<img src="http://www.cdell.me/invite-site/green-pixel4.png" />
<img src="http://www.cdell.me/invite-site/green-pixel5.png" />
<img src="http://www.cdell.me/invite-site/green-pixel6.png" />
<img src="http://www.cdell.me/invite-site/green-pixel7.png" />
<img src="http://www.cdell.me/invite-site/green-pixel8.png" />
<img src="http://www.cdell.me/invite-site/green-pixel9.png" />
<img src="http://www.cdell.me/invite-site/green-pixel10.png" />
<img src="http://www.cdell.me/invite-site/green-pixel11.png" />
<img src="http://www.cdell.me/invite-site/green-pixel12.png" />
<img src="http://www.cdell.me/invite-site/green-pixel13.png" />
<img src="http://www.cdell.me/invite-site/green-pixel14.png" />
<img src="http://www.cdell.me/invite-site/green-pixel15.png" />
<img src="http://www.cdell.me/invite-site/green-pixel16.png" />
<img src="http://www.cdell.me/invite-site/green-pixel17.png" />
<img src="http://www.cdell.me/invite-site/green-pixel18.png" />
<img src="http://www.cdell.me/invite-site/green-pixel19.png" />
<img src="http://www.cdell.me/invite-site/green-pixel20.png" />
</td>
</tr>
</table></td>
</tr>
</table>
</body>';
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html;" . "\r\n";
$headers .= "to:".$ro['emai_addrs']."\r\n";
$headers .= "from: ".$sender."\r\n";
mail($mail_to, $sub, $mail_body, $headers);
//echo $mail_body;
}
}
$var = "Invitation Sent Successfully";
}
Have you tried adding X-Spam related headers, so as to masquerade as something that went through and got caught by Spam Assassin?
If not, a few headers you might want to look into:
X-Spam-Score
X-Spam-Level
X-Spam-Status
X-Spam-Flag
X-Spam-Report
More info:
https://www.lamphost.com/Knowledge_Base/What_headers_are_added_to_emails_that_are_scanned_by_SpamAssassintm
There are plenty of things you can do to get it marked as spam, however, if someone has you listed as a 'safe-sender', 100% guarantees may be out of the question.
There are plenty of keywords you can use, they don't need to be shady words either. In the past, I've had issues just using large money amounts, exclamation points and the word 'free'.
Litmus is a great tool for checking your spam scores in different mail clients. For most spam software, it is an accumulative score, so you will easily be able to identify the worst (or in your case best) culprets.
Just BLACKLIST your Ip address,
also each blacklisting servers has their own listing criteria that may include technical listings, policy listings, and evidence based listings. Technical listings are those that occur mostly from mail server configuration issues such as missing or incorrect reverse DNS records, missing on incorrect banner greetings, and mail servers operating in IP address space that an ISP has specified that mail servers should not be operating in. Policy listings are those based on an operator that does not wish to receive email from certain countries, or ISPs, or has a history of no honoring unsubscribe requests. Evidence based listings are those where the operator has receive direct (or indirect) evidence that an IP address has been involved in sending unsolicited emails.
I am trying to prevent Spam with one of my forms using the Hidden Field trick, but for some reason its not working. When I fill in the field that's supposed to be left empty, the form is submitted like a normal.
Is there something wrong with my php? (I think that's where my problem lies):
This is the code to validate the hidden field (see top of my form):
if(!empty($_POST['email'])){ die('Stop Spamming'); }
Here's the complete php form:
<?
session_start();
include("verification_image.class.php");
$image = new verification_image();
if (($image->validate_code($_POST['validate']) ? "true" : "false") == "false") {
header('Location: http://www.domain.com/fail.htm');
exit;
}
if(!empty($_POST['email'])){ die('Stop Spamming'); }
$to = "email#domain.co.za";
$bcc = "email#domain.co.za";
$from = $_POST['contactemail'];
$subject = "INTERESTED ADVERTISER";
$sbody = '<table width="420" height="135" border="0" align="center"
cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="90" colspan="5"><div align="center">Reservation &
Enquiries Submission Form </div></td>
</tr>
<tr>
<td height="25" colspan="3" align="center" valign="middle"><span
class="style7">Full Name</span></td>
<td width="180" valign="top">'.$_POST['contactname'].'</td>
<td width="42"> </td>
</tr>
<tr>
<td height="25" colspan="3" align="center" valign="middle"><span
class="style7">Contact number</span></td>
<td valign="top">'.$_POST['contactnumber'].'</td>
<td> </td>
</tr>
<tr>
<td height="25" colspan="3" align="center" valign="middle"><span
class="style7">Email</span></td>
<td valign="top">'.$_POST['contactemail'].'</td>
<td> </td>
</tr>
<tr>
<td height="35" colspan="3" align="center" valign="bottom"><span
class="style7">Query</span></td>
<td colspan="2" rowspan="2"
valign="middle">'.$_POST['contactquery'].'</td>
</tr>
<tr>
<td width="84" height="108" align="center" valign="middle">
<!--DWLayoutEmptyCell--> </td>
<td width="69" align="center" valign="middle"><!--DWLayoutEmptyCell-->&
nbsp;</td>
<td width="17"> </td>
</tr>
<tr>
<td height="17"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>';
$sBodyNew = '<style type="text/css">
<!--
.style {
font-family: Arial;
font-size: 12px;
color: #4D241E;
}
body {
background-image: url();
background-color: #F1EAE4;
}
.style1 {font-size: 14px}
-->
</style>
<p> </p>
<table width="420" border="0" align="center" cellpadding="0" cellspacing="5">
<tr>
<td><table width="100%" border="0" cellpadding="8" cellspacing="0" bgcolor="#E7D3AF"
class="style">
<tr>
<td colspan="2" valign="top"><div align="center"><strong><span
class="style1">Website Deal</span><br>
.................................................................</strong><br>
</div></td>
</tr>
<tr>
<td width="32%" valign="top"><div align="left"><strong>Date Submitted</strong>
</div></td>
<td width="68%" valign="top">'. date("F j, Y, g:i a") .'</td>
</tr>
<tr>
<td valign="top"><div align="left"><strong>Name</strong></div></td>
<td valign="top">'.$_POST['contactname'].'</td>
</tr>
<tr>
<td valign="top"><div align="left"><strong>Contact Number</strong></div></td>
<td valign="top">'.$_POST['contactnumber'].'</td>
</tr>
<tr>
<td valign="top"><div align="left"><strong>Email</strong></div></td>
<td valign="top">'.$_POST['contactemail'].'</td>
</tr>
<tr>
<td valign="top"><div align="left"><strong>Query</strong></div></td>
<td valign="top">'.$_POST['contactquery'].'</td>
</tr>
</table></td>
</tr>
</table>
';
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($to, $subject, $sBodyNew, $headers);
header('Location: http://www.domain.com/success.htm');
?>
Heres this is what I added to my HTML form:
<label>
<input type="text" class="email" name="email" id="email" />
</label>
And heres the HTML form:
<form action="process_advertise.php" method="post" name="order"
onSubmit="MM_validateForm('contactname','','R','contactnumber','','R','contactemail',
'','RisEmail','validate','','R','contactquery','','R');return document.MM_returnValue">
<input name="success" type="hidden"
value=http://www.domain.com/success.htm>
<table width="465" border="0" cellspacing="0" cellpadding="0">
<!--DWLayoutTable-->
<tr>
<td width="465" height="387" valign="top"><span class="style66">NAME:
<input name="contactname" type="text" id="contactname" />
</span><br />
<span class="style66">CONTACT NUMBER:</span>
<input name="contactnumber" type="text" id="contactnumber" />
<br />
<span class="style66">EMAIL:
<input name="contactemail" type="text" id="contactemail" />
</span><br />
<span class="style66">QUERY:</span>
<textarea name="contactquery" cols="40" rows="8"
id="contactquery"></textarea>
<br />
<br />
<input type="text" class="email" name="email" id="email" />
<br />
<br />
<img src="picture.php" /><br />
<span class="style57 style16"><em>Please enter character<br />
as listed above</em></span><br />
<input name="validate" type="text" id="validate" />
<br />
<input type="reset" name="button2" id="button2" value="Reset" />
<input type="submit" name="button" id="button" value="Submit" /></td>
</tr>
</table>
</form>
Anyone know what I'm doing wrong?
=======================================================================
Problem Solved:
Ok guys... I've tested the form again and its working now!
I'm not why it didn't work earlier, but for those who like to know... all my coding there is correct except I removed this code from my process php form:
$sbody = '<table width="420" height="135" border="0" align="center"
cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="90" colspan="5"><div align="center">Reservation &
Enquiries Submission Form </div></td>
</tr>
<tr>
<td height="25" colspan="3" align="center" valign="middle"><span
class="style7">Full Name</span></td>
<td width="180" valign="top">'.$_POST['contactname'].'</td>
<td width="42"> </td>
</tr>
<tr>
<td height="25" colspan="3" align="center" valign="middle"><span
class="style7">Contact number</span></td>
<td valign="top">'.$_POST['contactnumber'].'</td>
<td> </td>
</tr>
<tr>
<td height="25" colspan="3" align="center" valign="middle"><span
class="style7">Email</span></td>
<td valign="top">'.$_POST['contactemail'].'</td>
<td> </td>
</tr>
<tr>
<td height="35" colspan="3" align="center" valign="bottom"><span
class="style7">Query</span></td>
<td colspan="2" rowspan="2"
valign="middle">'.$_POST['contactquery'].'</td>
</tr>
<tr>
<td width="84" height="108" align="center" valign="middle">
<!--DWLayoutEmptyCell--> </td>
<td width="69" align="center" valign="middle"><!--DWLayoutEmptyCell-->&
nbsp;</td>
<td width="17"> </td>
</tr>
<tr>
<td height="17"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>';
This code is not necessary as greg0rie pointed out
There are too many ways your code can be code injected.
You should use filter_var function for a minimal prevent for it.
For validating email use (at least and not just):
if(!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL))
{
echo("E-mail is not valid");
}else{
echo("E-mail is valid");
}
This line of your code seems to be strange:
if (($image->validate_code($_POST['validate']) ? "true" : "false") == "false") {
wouldn't it easier this way?
if (!($image->validate_code($_POST['validate'])){
<table width="100%" cellspacing="0" cellpadding="0" border="0" id="Table4">
<tbody>
<tr>
<td valign="top" class="tx-strong-dgrey">
<a class="anc-noul" href="http://www.example.com/catalog/proddetail.asp?logon=&langid=EN&sku_id=0665000FS10129471&catid=25653">
Apple 8GB 3rd Generation iPod Touch</a></td>
</tr>
<tr>
<td valign="top" class="element-spacer"/>
</tr>
<tr>
<td valign="top" class="tx-normal-grey">
Product detail
<a href="http://www.example.com/catalog/proddetail.asp?logon=&langid=EN&sku_id=0665000FS10129471&catid=25653">
More Info</a></td>
</tr>
<tr>
<td valign="top" class="element-spacer"/>
</tr>
<tr>
<td valign="top" class="tx-normal-red">
<span class="tx-strong-dgrey">Price:</span>
$189.99</td>
</tr>
<tr>
<td valign="top">You save: $9.00 after instant savings</td>
</tr>
<tr>
<td valign="top" class="element-spacer"/>
</tr>
<tr>
<td valign="top" class="tx-normal-grey">
<a href="http://www.example.com/catalog/subclass.asp?catid=25653&logon=&langid=EN">
View similar products</a>
<a href="http://www.example.com/catalog/mfr.asp?man=Apple&catid=19&logon=&langid=EN">
View similar products with same brand</a>
</td></tr>
<tr>
<td valign="top" class="element-spacer"/>
</tr>
</tbody>
</table>
I want to be able to get the $189.99.
echo $ret[0]->find('tr', 4)->plaintext;
This outputs: 'Price: $189.99'
I just need $189.99, not 'Price:'
$exp = explode(":", $ret[0]->find('tr', 4)->plaintext);
$price =$exp[1];