lisseteb Posted June 19, 2008 Share Posted June 19, 2008 Hey all I'm pretty new to PHP, so this question will probably be really easy and dumb for that matter, but I'm stuck on it, so if I can get some help on it that would be really great. Anyway, I'm trying to echo out the value of an email address, but in a mailto link that would post that value of the email address. Such as if I put on an add form the email address [email protected] and in the display page I want it to be a link that would read [email protected]. The code I have right now is <a href="mailto:<?php echo $row->email;?>" target="_blank"><?php $email = $_POST['email'];?></a> Link to comment https://forums.phpfreaks.com/topic/110993-echo-email-address/ Share on other sites More sharing options...
DarkWater Posted June 19, 2008 Share Posted June 19, 2008 Uhhhhhh.... printf('<a href="mailto:%1$s">%1$s</a>', $_POST['email']); Link to comment https://forums.phpfreaks.com/topic/110993-echo-email-address/#findComment-569491 Share on other sites More sharing options...
lisseteb Posted June 19, 2008 Author Share Posted June 19, 2008 Uhhhhhh.... printf('<a href="mailto:%1$s">%1$s</a>', $_POST['email']); do I just copy it the way it is? its not working. What does the $1$s mean? Link to comment https://forums.phpfreaks.com/topic/110993-echo-email-address/#findComment-569517 Share on other sites More sharing options...
DarkWater Posted June 19, 2008 Share Posted June 19, 2008 Sorry, the dumb forum parsed some of my stuff. Let me put it in code tags for you. Link to comment https://forums.phpfreaks.com/topic/110993-echo-email-address/#findComment-569527 Share on other sites More sharing options...
DarkWater Posted June 19, 2008 Share Posted June 19, 2008 printf('<a href="mailto:%1$s">%1$s</a>', $_POST['email']); Link to comment https://forums.phpfreaks.com/topic/110993-echo-email-address/#findComment-569528 Share on other sites More sharing options...
lisseteb Posted June 19, 2008 Author Share Posted June 19, 2008 Oh I figured out my problem. I was just missing something simple. Thanks for your help Link to comment https://forums.phpfreaks.com/topic/110993-echo-email-address/#findComment-569543 Share on other sites More sharing options...
DarkWater Posted June 19, 2008 Share Posted June 19, 2008 My solution works, if you want to use it. =P Link to comment https://forums.phpfreaks.com/topic/110993-echo-email-address/#findComment-569547 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.