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? Quote 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. Quote 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... } Quote 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. Quote 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();"; Quote 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 = "admin@randomgamedesign.uk.tt"; $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? Quote 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 = "admin@randomgamedesign.uk.tt"; with $email = "something_from_mydatabase_using_a_query"; Quote 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 = "admin@randomgamedesign.uk.tt"; with $email = "something_from_mydatabase_using_a_query"; Yeah, as long as the something from your database is a valid email. Quote 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 = "admin@randomgamedesign.uk.tt"; $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. Quote 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 = "admin@randomgamedesign.uk.tt"; $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. Quote 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 Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.