DeanWhitehouse Posted May 4, 2008 Share Posted May 4, 2008 this is a code i found in a template system <span style="float: right; text-align: right;"><a target="_blank" rel="external" href='javascript:window.location="mai"+"lto:"+"admin"+"@"+"randomgamedesign.uk.tt";self.close();' onmouseover='window.status="mai"+"lto:"+"admin"+"@"+"randomgamedesign.uk.tt"; return true;' onmouseout='window.status="";return true;'>Email </a></span> how can i use this code or something similar so you can only email them, and not see there email when you mouseover? Link to comment https://forums.phpfreaks.com/topic/104104-solved-email-code-where-email-is-hidden/ Share on other sites More sharing options...
MattDunbar Posted May 4, 2008 Share Posted May 4, 2008 That is javascript you have there. If you don't want them to see your email use a PHP mailing script. Here is a tutorial of what I am thinking you are trying to achieve: http://forums.xtreme-pixel.com/PHP-Mail-Form-t418.html Please reply if I misunderstood what you wanted to achieve. Link to comment https://forums.phpfreaks.com/topic/104104-solved-email-code-where-email-is-hidden/#findComment-532980 Share on other sites More sharing options...
rarebit Posted May 4, 2008 Share Posted May 4, 2008 here's an idea, it might actually be less safe, but: <a href='?mail=joe'>Mail</a> then if(isset($_GET['mail'])) { //Do checks!!! ... er i've come unstuck here! this should invoke the email... } Link to comment https://forums.phpfreaks.com/topic/104104-solved-email-code-where-email-is-hidden/#findComment-532982 Share on other sites More sharing options...
DeanWhitehouse Posted May 4, 2008 Author Share Posted May 4, 2008 near the same thing but this is for a user profile, it is so they don't recieve spam mail, but i can't see how to change href='javascript:window.location="mai"+"lto:"+"admin"+"@"+"randomgamedesign.uk.tt";self.close(); so it is an email from my database. Link to comment https://forums.phpfreaks.com/topic/104104-solved-email-code-where-email-is-hidden/#findComment-532984 Share on other sites More sharing options...
rarebit Posted May 4, 2008 Share Posted May 4, 2008 When you generate this line, just use fields from db... list($start, $end) = split('[@]', $ret['email']); echo "href='javascript:window.location=\"mai\"+\"lto:\"+\"$start\"+\"@\"+\"$end\";self.close();"; Link to comment https://forums.phpfreaks.com/topic/104104-solved-email-code-where-email-is-hidden/#findComment-532988 Share on other sites More sharing options...
MattDunbar Posted May 4, 2008 Share Posted May 4, 2008 I think I understand now. Use explode function on there email address. <?php $email = "[email protected]"; $email = explode($email, '@'); ?> <span style="float: right; text-align: right;"><a target="_blank" rel="external" href='javascript:window.location="mai"+"lto:"+"<?php echo $email[0]; ?>"+"@"+"<?php echo $email[1]; ?>";self.close();' ;return true;'>Email </a></span> Does that make sense? Link to comment https://forums.phpfreaks.com/topic/104104-solved-email-code-where-email-is-hidden/#findComment-532994 Share on other sites More sharing options...
DeanWhitehouse Posted May 4, 2008 Author Share Posted May 4, 2008 yer, i think i understand, i can replace this $email = "[email protected]"; with $email = "something_from_mydatabase_using_a_query"; Link to comment https://forums.phpfreaks.com/topic/104104-solved-email-code-where-email-is-hidden/#findComment-533002 Share on other sites More sharing options...
MattDunbar Posted May 4, 2008 Share Posted May 4, 2008 yer, i think i understand, i can replace this $email = "[email protected]"; with $email = "something_from_mydatabase_using_a_query"; Yeah, as long as the something from your database is a valid email. Link to comment https://forums.phpfreaks.com/topic/104104-solved-email-code-where-email-is-hidden/#findComment-533005 Share on other sites More sharing options...
DeanWhitehouse Posted May 4, 2008 Author Share Posted May 4, 2008 i tried this way , and it didn't work <?php $email = "[email protected]"; $email = explode($email, '@'); ?> <span style="float: right; text-align: right;"><a target="_blank" rel="external" href='javascript:window.location="mai"+"lto:"+"<?php echo $email[0]; ?>"+"@"+"<?php echo $email[1]; ?>";self.close();' ;return true;'>Email </a></span> so i think i will have to try this way, and have two input boxes one for "email" and another for "hotmail.com". Unless anyone knows a better way to reduce spam. Link to comment https://forums.phpfreaks.com/topic/104104-solved-email-code-where-email-is-hidden/#findComment-533037 Share on other sites More sharing options...
MattDunbar Posted May 4, 2008 Share Posted May 4, 2008 i tried this way , and it didn't work <?php $email = "[email protected]"; $email = explode($email, '@'); ?> <span style="float: right; text-align: right;"><a target="_blank" rel="external" href='javascript:window.location="mai"+"lto:"+"<?php echo $email[0]; ?>"+"@"+"<?php echo $email[1]; ?>";self.close();' ;return true;'>Email </a></span> so i think i will have to try this way, and have two input boxes one for "email" and another for "hotmail.com". Unless anyone knows a better way to reduce spam. Try explode('@',$email); Sorry, I made a mistake in the function syntax. Link to comment https://forums.phpfreaks.com/topic/104104-solved-email-code-where-email-is-hidden/#findComment-533063 Share on other sites More sharing options...
DeanWhitehouse Posted May 4, 2008 Author Share Posted May 4, 2008 thanks worked now Link to comment https://forums.phpfreaks.com/topic/104104-solved-email-code-where-email-is-hidden/#findComment-533072 Share on other sites More sharing options...
MattDunbar Posted May 4, 2008 Share Posted May 4, 2008 No problem, If you need any further assistance feel free to contact me through PM, IM or Email. Link to comment https://forums.phpfreaks.com/topic/104104-solved-email-code-where-email-is-hidden/#findComment-533073 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.