Jump to content

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
Link to comment
https://forums.phpfreaks.com/topic/8946-problems-with-sending-in-php-code/
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...
[!--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]
[!--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]
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.