RonenMymon Posted May 3, 2006 Share Posted May 3, 2006 Hey guys,I'm very new with PHP.I'm trying to define a value that I've read from MySql DB, as an email link.(the 'name' will be a link to the 'email', both are values from DB).Something like this:<TD><a href="mailto:",$row['email'],">",$row['name'],"</a></TD>Well.... It's wrong. But why....? I have no idea how to write it currectly.Will apriciate any help !Thank you,Ronen Link to comment https://forums.phpfreaks.com/topic/8946-problems-with-sending-in-php-code/ Share on other sites More sharing options...
sanfly Posted May 3, 2006 Share Posted May 3, 2006 Assuming that you have extracted the data from the database correctly, something like this should work[code]<? $email = $row['email'];$name = $row['name'];?><TD><a href="mailto:<?=$email?>"><?=$name?></a></TD>[/code]If its not what your looking for, post more of your code for us to see... Link to comment https://forums.phpfreaks.com/topic/8946-problems-with-sending-in-php-code/#findComment-32879 Share on other sites More sharing options...
wildteen88 Posted May 3, 2006 Share Posted May 3, 2006 [!--quoteo(post=370822:date=May 3 2006, 10:18 AM:name=sanfly)--][div class=\'quotetop\']QUOTE(sanfly @ May 3 2006, 10:18 AM) [snapback]370822[/snapback][/div][div class=\'quotemain\'][!--quotec--]Assuming that you have extracted the data from the database correctly, something like this should work[code]<? $email = $row['email'];$name = $row['name'];?><TD><a href="mailto:<?=$email?>"><?=$name?></a></TD>[/code]If its not what your looking for, post more of your code for us to see...[/quote]I would advise you not use <?= ?> tas as these are not enabled by defualt and so if use them some scripts may not function correct in different PHP setups. So I'd advise to do the following stead.[code]<? $email = $row['email'];$name = $row['name'];?><TD><a href="mailto:<?php echo $email; ?>"><?php echo $name; ?></a></TD>[/code] Link to comment https://forums.phpfreaks.com/topic/8946-problems-with-sending-in-php-code/#findComment-32887 Share on other sites More sharing options...
ansarka Posted May 3, 2006 Share Posted May 3, 2006 [!--quoteo(post=370812:date=May 3 2006, 03:04 AM:name=Ronen)--][div class=\'quotetop\']QUOTE(Ronen @ May 3 2006, 03:04 AM) [snapback]370812[/snapback][/div][div class=\'quotemain\'][!--quotec--]Hey guys,I'm very new with PHP.I'm trying to define a value that I've read from MySql DB, as an email link.(the 'name' will be a link to the 'email', both are values from DB).Something like this:<TD><a href="mailto:",$row['email'],">",$row['name'],"</a></TD>Well.... It's wrong. But why....? I have no idea how to write it currectly.Will apriciate any help !Thank you,Ronen[/quote]hi friend plz change your code to <TD><a href="mailto:",<?=$row['email']?>,">",<?=$row['name']?>,"</a></TD>if you are using php vairable you should add php tagsi think this will help you[b]EDITED BY WILDTEEN88: PLEASE DO NOT POST MESSAGES WITH THE BIGGEST FONT GOING IN YOUR POSTS, THANK YOU[/b] Link to comment https://forums.phpfreaks.com/topic/8946-problems-with-sending-in-php-code/#findComment-32890 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.