how to make an email addy active in database

Discussion in 'PHP' started by dougvcd, Jul 28, 2007.

  1. #1
    hello again
    you can use this to make an active link to a web page in a database
    <a href="http://www.domain.com" >Anchor Text</a>
    what about an active email addy
    can this be done
    cheers
    Doug
     
    dougvcd, Jul 28, 2007 IP
    killerj likes this.
  2. killerj

    killerj Active Member

    Messages:
    765
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    95
    #2
    You mean something like this ?

    <a mailto:youemailaddy@domainname.com>MR XYZ</a> ?
    yes its possible . Store the email and the name of the client in the db in two separate rows and where ever you require them to show up .
    connect to your db .
    and make the link code look something like this :
    <a mailto:<? echo $row['email'] ?> > <? echo $row['name'] ?> </a>

    I hope you got the basic idea . ;)
     
    killerj, Jul 28, 2007 IP
  3. dougvcd

    dougvcd Peon

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks for the info but i could not get it to work
    this is how i have the code at the moment to display

    //Retrieves data from MySQL 
    $data = mysql_query("SELECT * FROM members WHERE region='exchange' or region='both'") or die(mysql_error()); 
    //Puts it into an array 
    while($info = mysql_fetch_array( $data )) 
    { 
    
    //Outputs the image and other data
    Echo "<img src=http://www.caravan-holiday-exchange.com/images/".$info['pname'] ."> <br>"; 
    Echo "<b>Name:</b> ".$info['name'] . " <br>";
    Echo "<b>Email:</b> ".$info['email'] . " <br>";
    Echo "<b>Contact:</b> ".$info['contact'] . " <br>";
    Echo "<b>Park Name:</b> ".$info['parkname'] . " <br>";
    Echo "<b>Park Location:</b> ".$info['parklocation'] . " <br>";
    Echo "<b>Details:</b> ".$info['caravandetails'] . " <hr>";
     
    }
    PHP:
    i cant work out how to change it with your bit of code
    cheers
    Doug
    in the database i have col called email and put the addy in there as
    <a mailto: blah blah blah> </a>
     
    dougvcd, Jul 28, 2007 IP
  4. ironhorn

    ironhorn Banned

    Messages:
    89
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hm.. I just knew it :D
     
    ironhorn, Jul 28, 2007 IP
  5. dougvcd

    dougvcd Peon

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Dont need replies like that
    how is any one suppose to learn
    Doug
     
    dougvcd, Jul 28, 2007 IP
  6. killerj

    killerj Active Member

    Messages:
    765
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    95
    #6
    Ok . try this code. I hope this is what you require.
     
    killerj, Jul 28, 2007 IP
  7. dougvcd

    dougvcd Peon

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    whats happening at the moment is
    showing this on web page >Doug[click to send an email] but not active
    cheers
    Doug
     
    dougvcd, Jul 29, 2007 IP
  8. killerj

    killerj Active Member

    Messages:
    765
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    95
    #8
    Does the other information get fetched normally ?
    Edit : Ok . Fixed this issue :) . Nice person to deal with . Adding greenies now :D .
     
    killerj, Jul 29, 2007 IP
  9. dougvcd

    dougvcd Peon

    Messages:
    267
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #9
    big thanks all fixed now:)
     
    dougvcd, Jul 29, 2007 IP