Jump to content


Photo

Problems with sending in PHP code


  • Please log in to reply
3 replies to this topic

#1 RonenMymon

RonenMymon
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 03 May 2006 - 08:04 AM

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

#2 sanfly

sanfly
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationNew Zealand

Posted 03 May 2006 - 09:18 AM

Assuming that you have extracted the data from the database correctly, something like this should work

<? 
$email = $row['email'];
$name = $row['name'];
?>

<TD><a href="mailto:<?=$email?>"><?=$name?></a></TD>

If its not what your looking for, post more of your code for us to see...
If you're not part of the solution, you're part of the precipitate

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 03 May 2006 - 11:07 AM

[!--quoteo(post=370822:date=May 3 2006, 10:18 AM:name=sanfly)--][div class=\'quotetop\']QUOTE(sanfly @ May 3 2006, 10:18 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Assuming that you have extracted the data from the database correctly, something like this should work

<? 
$email = $row['email'];
$name = $row['name'];
?>

<TD><a href="mailto:<?=$email?>"><?=$name?></a></TD>

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.
<? 
$email = $row['email'];
$name = $row['name'];
?>

<TD><a href="mailto:<?php echo $email; ?>"><?php echo $name; ?></a></TD>


#4 ansarka

ansarka
  • Members
  • PipPipPip
  • Advanced Member
  • 128 posts
  • LocationCochin, Kerala, India

Posted 03 May 2006 - 11:27 AM

[!--quoteo(post=370812:date=May 3 2006, 03:04 AM:name=Ronen)--][div class=\'quotetop\']QUOTE(Ronen @ May 3 2006, 03:04 AM) View Post[/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 tags
i think this will help you

EDITED BY WILDTEEN88: PLEASE DO NOT POST MESSAGES WITH THE BIGGEST FONT GOING IN YOUR POSTS, THANK YOU
EVEN THE WORD IMPOSSIBLE IS SAYING I' M' POSSIBLE




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users