473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

email link not working

15
Hi - hopefully this is a simple question, just HTML / PHP.
I have a php script that retrieves (among others) bare email addresses from a DB table (i.e., just in the form ' whatever.thing@example.com') which are then displayed on a webpage. I would like these to be clickable links, so have the relevant line as:
Expand|Select|Wrap|Line Numbers
  1. echo "<b>Email: </b><a href='mailto:>" .$themail. "</a><br>";
Everything echoes properly, with the email address clickable. As a test, I retrieved my own email address.
However...when I mouseover this link, all that appears in the status bar is "mailto:" without an address. And clicking on the link sends the mail from me rather than to me!
Feb 18 '10 #1
4 1570
zorgi
431 Expert 256MB
Expand|Select|Wrap|Line Numbers
  1. echo "<b>Email: </b><a href='mailto: ".$themail."'>" .$themail. "</a><br>";
  2.  
Feb 18 '10 #2
Atli
5,058 Expert 4TB
Or better yet:
Expand|Select|Wrap|Line Numbers
  1. echo "<b>Email: </b><a href='mailto: $themail'>$themail</a><br>";
No point breaking out of a double-quoted string to add variables.
Feb 18 '10 #3
zorgi
431 Expert 256MB
Thanks for pointing that out Atli. Just a bad habit of mine since the times when I only used dreamweaver. Dreamweaver doesn't highlight variables within the string so variables look like string and are very hard to spot. Eclipse does much better job :)
Feb 18 '10 #4
starman
15
thanks you two! Worked first time, and I was also able to adapt the code so that web addresses were linked properly too.
Many thanks.
Feb 18 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Nel | last post by:
I have recently updated an on-line petition at www.fuelprotest.com The confirmation email contained a verification link like...
8
by: Dave Smithz | last post by:
Hi, Thanks to this group I discovered the excellent PHP Mailer (http://phpmailer.sourceforge.net/) which I use to send emails. Part of my application emails out hundreds of club members unique...
16
by: Brian Wilson | last post by:
Anyone know how I can add a "?Subject" line to this? <head> <script> var sdomain='brianjenny.net'; var email='webmaster'; var myaddress=(''+email+'@'+sdomain+''); </script>...
88
by: Mike | last post by:
Is there a way to determine what a user's default email client is? I read a post from 3 years ago that said no. I guess I'm hoping something has come along since then.
4
by: web_design | last post by:
I put this together from some other scripts I am using on a site. I'm trying to make a better email hiding script. It isn't working. Also, it causes Internet Explorer 6 SP2 to block the script...
9
by: Bob Jones | last post by:
We have developed a commercial ASP.net application (personal nutrition management and tracking); we want to send smtp email from within it. For our development box, we use WinXP Pro, IIS 5.5,...
11
by: tshad | last post by:
I have a W2003 server running my website and I am trying to set up my pages to send email using System.Web.Mail. I have pages running on this machine using CDONTS that work fine. I am using...
6
by: yonido | last post by:
hey my final goal: to add a link to an email message, that will contact my server & mark the email as "important", with no popup windows/annoying messages. id like to do this in ajax, but the...
9
by: roger.rigsby | last post by:
I have a working email functionality on my site but there's a problem with links. I really want to use the "send this article by email" sort of functionality on my site. But instead of emailing...
4
by: m.a | last post by:
Hello, I have a page with several control on it. Each control could have several states. I want to send an email that has a link in it and when user click on that link, it redirected to my site...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.