PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Piera
Jason's GF
Posts: 10 Joined: Fri Apr 19, 2002 9:30 am
Location: Montreal
Contact:
Post
by Piera » Tue Jun 11, 2002 1:33 pm
I am trying to make a valid email link but i am not having much luck!
This is what I wrote
Code: Select all
<a href="mailto:'.$rowї'email_address'] .'">'.$rowї'email_address'] .'</a>
When I put my mouse over the link it gives me a complete web URL with
this as part of it "mailto:'.$row['email_address'] .'\"
Is there anywhere I am going wrong?
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Tue Jun 11, 2002 1:35 pm
<a href=\"mailto:'.$row['email_address'] .'\">'.$row['email_address'] .'</a>
can you provide a little more context, please?
MattF
Forum Contributor
Posts: 225 Joined: Sun May 19, 2002 9:58 am
Location: Sussex, UK
Post
by MattF » Tue Jun 11, 2002 1:37 pm
if you are using echo 'stuff'; then PHP just dumps it on the page without parsing it.
Wandrer
Forum Newbie
Posts: 21 Joined: Thu Jun 06, 2002 8:43 am
Post
by Wandrer » Tue Jun 11, 2002 1:39 pm
<a href=\"mailto:'.$row['email_address'] .'\">'.$row['email_address'] .'</a>
How about this:
"<a href=\"mailto:" . $row['email_address'] ."\">" . $row['email_address'] ."</a>";
Piera
Jason's GF
Posts: 10 Joined: Fri Apr 19, 2002 9:30 am
Location: Montreal
Contact:
Post
by Piera » Tue Jun 11, 2002 1:39 pm
It works now the problem was with the quoting!
gotDNS
Forum Contributor
Posts: 217 Joined: Tue May 07, 2002 5:53 pm
Location: West Chester, PA
Post
by gotDNS » Tue Jun 11, 2002 6:56 pm
I use web mail without a program, I dont think your system is effective.
Try making a nice PHP script with the mail function and have them fill out the from right on the website. Give people the option to do that, at least.
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Wed Jun 12, 2002 1:41 am
If you want to avoid having to escape the double quotes in the HTML you could have,
Code: Select all
echo '<a href="mailto:'.$rowї'email_address'].'">'.$rowї'email_address'].'</a>';
Mac
mikeq
Forum Regular
Posts: 512 Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland
Post
by mikeq » Thu Jun 13, 2002 5:38 am
On the other hand, if you don't want to concatenate then...
echo "<a href=\"mailto:$row['email_address']\">$row['email_address']</a>";
twigletmac
Her Royal Site Adminness
Posts: 5371 Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK
Post
by twigletmac » Thu Jun 13, 2002 7:15 am
mikeq wrote: On the other hand, if you don't want to concatenate then...
echo "<a href="mailto:$row['email_address']">$row['email_address']</a>";
Down to personal preference at the end of the day. I like being able to cut and paste HTML from and to non-php pages. I code using a syntax highlighter so concanation means I can see where variables are, making debugging a bit easier. I have large loops and stuff where having PHP ignoring things in single quotes makes it a bit more streamlined.
Each to their own really.
Mac