PHP mail HTML mode with complex a href ... strange result
Posted: Wed Jan 07, 2009 1:02 am
Hi i don't know if someone had this problem
got some strange thing happen here
i'm using mail function like this one ( the one with { red color code } actualy a php code or php variable i just sensor it )
{some sql code here for dynamic id, dynamic id for anchors, dynamic name and place }
$to = {dynamic code}
$subject = {dynamic subject }
$message =
' '.{dynamic name}.' want to share review of .{dynamic place}.'
<br/>
Click on the link below to read review
<br/>
<a href="http://myweb/info.php?id='.{dynamic id}.'#'.{dyanamic id for anchors}.'">Link</a>';
$subject ={dynamic name}.' want to share a review';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: '.{dynamic email}.'('.{dynamic name}.')' . "\r\n";
$mail_sent = mail( $to, $subject, $message, $headers );
OK nothing wrong with the sql getting the data all work well
except the result i get in my mail (gmail) is this
--------------------------------------------------------------------------------------------------------------------------------
{dynamic name -> we got the name } want to share review of { dynamic name -> wasn't there }
Click on the link below to read review
Link
--------------------------------------------------------------------------------------------------------------------------------
when i hover the link and check the link address it comes out like this
http://myweb/info.php?id=#{dynamic id}#{dyanamic id for anchors}
it added # itself in front of {dynamic id} the id is correct though
now a click on the link and this is what show in my url address bar
http://myweb/info.php?id=#{dynamic id}%32{dyanamic id for anchors}
can someone shed me some light
the {dynamic id } and {dynamic id for anchors} is number only no comma
got some strange thing happen here
i'm using mail function like this one ( the one with { red color code } actualy a php code or php variable i just sensor it )
{some sql code here for dynamic id, dynamic id for anchors, dynamic name and place }
$to = {dynamic code}
$subject = {dynamic subject }
$message =
' '.{dynamic name}.' want to share review of .{dynamic place}.'
<br/>
Click on the link below to read review
<br/>
<a href="http://myweb/info.php?id='.{dynamic id}.'#'.{dyanamic id for anchors}.'">Link</a>';
$subject ={dynamic name}.' want to share a review';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: '.{dynamic email}.'('.{dynamic name}.')' . "\r\n";
$mail_sent = mail( $to, $subject, $message, $headers );
OK nothing wrong with the sql getting the data all work well
except the result i get in my mail (gmail) is this
--------------------------------------------------------------------------------------------------------------------------------
{dynamic name -> we got the name } want to share review of { dynamic name -> wasn't there }
Click on the link below to read review
Link
--------------------------------------------------------------------------------------------------------------------------------
when i hover the link and check the link address it comes out like this
http://myweb/info.php?id=#{dynamic id}#{dyanamic id for anchors}
it added # itself in front of {dynamic id} the id is correct though
now a click on the link and this is what show in my url address bar
http://myweb/info.php?id=#{dynamic id}%32{dyanamic id for anchors}
can someone shed me some light
the {dynamic id } and {dynamic id for anchors} is number only no comma