Re: Adding a URL

From: Date: Mon, 31 Mar 2003 15:05:47 +0000
Subject: Re: Adding a URL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-141696@lists.php.net to get a copy of this message
Thank you, your suggestions worked perfectly! ~Scott Don Read wrote:
On 30-Mar-2003 Scott Thompson wrote:
Hi, I am using the following code to query a database and build an HTML table.
<snip>
    /* Printing results in HTML */
    print "<table>\n";
    while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$line['email'] = '<A HREF="mailto:' .$line['email'] .'">' .$line['email'].'</A>';
        print "\t<tr>\n";
        foreach ($line as $col_value) {
         print "\t\t<td>$col_value</td>\n";
        }
        print "\t</tr>\n";
// how about this ? echo "\n<tr><td>", implode('</td><td>', $line), '</td></tr>';
    }
    print "</table>\n";
<snip>
What I want (and can't figure out) is how to have each email address have a URL (i.e. mailto:somebody@someaddress.com). I'm fairly new to PHP, I hope this question made some sense. Suggestions?
Regards,


« previous php.general (#141696) next »