Moron Posted July 23, 2007 Share Posted July 23, 2007 I have a "mailto:" link displaying through php: echo "<a href=\"mailto\: [email protected]\">"; echo $RESULTEQAB['EmailAddress']; echo "</a>"; .... but instead of it being a simple "Mailto:" link, it's linking to a fullblown URL: http://www.organization.org/folder/subfolder/mailto/:%[email protected] How do I make it act like a traditional HTML "mailto:" link? Would this be "htmlspecialcharacters()" or something else? Link to comment https://forums.phpfreaks.com/topic/61371-solved-using-a-simple-mailto-link-inside-php/ Share on other sites More sharing options...
obsidian Posted July 23, 2007 Share Posted July 23, 2007 I have a "mailto:" link displaying through php: echo "<a href=\"mailto\: [email protected]\">"; echo $RESULTEQAB['EmailAddress']; echo "</a>"; .... but instead of it being a simple "Mailto:" link, it's linking to a fullblown URL: http://www.organization.org/folder/subfolder/mailto/:%[email protected] How do I make it act like a traditional HTML "mailto:" link? Would this be "htmlspecialcharacters()" or something else? You don't need to escape the colon. That's what's causing your problem: <?php echo "<a href=\"mailto: [email protected]\">"; ?> Link to comment https://forums.phpfreaks.com/topic/61371-solved-using-a-simple-mailto-link-inside-php/#findComment-305441 Share on other sites More sharing options...
Moron Posted July 23, 2007 Author Share Posted July 23, 2007 You don't need to escape the colon. That's what's causing your problem: <?php echo "<a href=\"mailto: [email protected]\">"; ?> That did the trick. Thanks! Link to comment https://forums.phpfreaks.com/topic/61371-solved-using-a-simple-mailto-link-inside-php/#findComment-305446 Share on other sites More sharing options...
Moron Posted July 23, 2007 Author Share Posted July 23, 2007 Oops.... I forgot this part. I need to make echo $RESULTEQAB['EmailAddress']; .... a variable in the "mailto:" link. Link to comment https://forums.phpfreaks.com/topic/61371-solved-using-a-simple-mailto-link-inside-php/#findComment-305453 Share on other sites More sharing options...
obsidian Posted July 23, 2007 Share Posted July 23, 2007 Oops.... I forgot this part. I need to make echo $RESULTEQAB['EmailAddress']; .... a variable in the "mailto:" link. <?php echo "<a href=\"mailto: {$RESULTEQAB['EmailAddress']}\">"; ?> Link to comment https://forums.phpfreaks.com/topic/61371-solved-using-a-simple-mailto-link-inside-php/#findComment-305459 Share on other sites More sharing options...
Moron Posted July 23, 2007 Author Share Posted July 23, 2007 I figured it out. Thanks again. Link to comment https://forums.phpfreaks.com/topic/61371-solved-using-a-simple-mailto-link-inside-php/#findComment-305466 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.