Jump to content

Archived

This topic is now archived and is closed to further replies.

RonenMymon

Problems with sending in PHP code

Recommended Posts

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

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
[!--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]

Share this post


Link to post
Share on other sites
[!--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 tags
i 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]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.