skip to Main Content
$result = mysql_query("SELECT * FROM pm where idno ='$idno'", $db);
$datas = mysql_fetch_array($result);

    <table><tr><td>
    <? if ($userLevel > 9){
    echo "<p><strong>$datas[email]</strong></p>";
    echo "<p>&nbsp;</p>";
    echo "<p><strong>Dear $datas[name]</strong></p>";
    echo "<p>Here is the information you requested.</p>";
    echo "<p><strong>Username: </strong> $datas</p>";
    echo "<p><strong>Password: </strong> $datas[password]</p>";
    echo "<p>&nbsp;</p>";
    echo "<p>These are case sensitive.</p>";
    echo "<p>&nbsp;</p>";
    echo "<p>Thank you</p>";
    echo "Email: <a href="mailto:[email protected]">[email protected]</a></p>";
            }else{echo "&nbsp;";}?>
            </td></tr>
<tr>ADMIN, COPY AND PASTE THE ABOVE AS A NEW EMAIL TO THIS MEMBER. CLICKING ON THE MEMBER EMAIL LINK ABOVE WILL OPEN YOUR EMAIL PROGRAM.</tr></table>

If you paste the above into a blank website page, you’ll see that the first echo line is not clickable. How do I edit it to be clickable?

p.s. This is strictly to be text in a table cell with a clickable email link at the beginning, so I’m not looking for an emailing form. One more thing, I will not know what you’re talking about unless you actually give me the code to copy and paste. I’ve had this old account since 2013 when someone left who did this, but I don’t know a thing about php coding nor the lingo, just enough to get by and keep it alive.

Thanks so much
Tina

p.s. This has been edited due to some answers seem to be working with the [email protected] echos in the last paragraph of the cell, which works fine, instead of the very first sentence in the table cell. So I must not have been real clear and delivered too much information prior to this edit. I also added the "array"(???), I guess it’s called, from part of what is above the doctype in case it helps. I don’t want that edited at all because the page is 1,330 lines long that feed off of that. DATAS are the PM (private members that has a leadership section within it, AND because we are having smtp problems with being on an old php4 version on an old insecure plesk server, I want to add this copy and paste paragraph for an email since our host is only sending all of our automated forms to our domain related email addresses and no members are getting their emails until our host fixes the problem.)


I figured it out to be the following. Thank you very much to getting my mind focused on the closing email address and trying to do something with that for the beginning email address. This is what worked for me:

echo "<a href="mailto:$datas[email]">$datas[email]</a></p>";

2

Answers


  1. You didn’t mention any specific errors you’re seeing, but the main problem you seem to have is the lack of quote marks around the email index value. It should be a string, I assume:

    <a href="mailto:<?php echo $datas["email"]; ?>"><?php echo $datas["email"]; ?></a>
    

    And also putting quote marks around $datas makes no sense, because that isn’t a string, it’s a variable.

    Demo: http://sandbox.onlinephpfunctions.com/code/4b3ecac7f441a1fa74451da6c795d918bad5f58e

    Login or Signup to reply.
  2. Try this it’ll work

    echo "Email: <a href='mailto:[email protected]'>[email protected]</a></p>"; OR echo "Email: <a href='".$data['email']."'>[email protected]</a></p>";

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search