Forum Moderators: coopster
Im abit stuck with hyperlinks. Ive used search functions and have found relevent thread but the coding does not match.
I have a php page the displays records from a form.
id name, address, phone, website etc
I would like to make the website data to turn into a hyperlink once submitted.
Here is my following php code that displays the table
=============
$results = mysql_query("SELECT * FROM charitylist");
if ($results){
while ($a = mysql_fetch_array($results)) {
print("<TR>");
print("<TD>$a[id]</TD>");
print("<TD>$a[charitynum]</TD>");
print("<TD>$a[name]</TD>");
print("<TD>$a[address]</TD>");
print("<TD>$a[postcode]</TD>");
print("<TD>$a[website]</TD>"); i would like this to turn whatever is in there to a hyplink
print("<TD>$a[phone]</TD>");
print("<TD>$a[fax]</TD>");
print("</TR>");
};
====================
It would be great if someone got back to me :)
Thank you for your time
Michael
print('<TD><a href="'.$a['website'].'">.$a['website'].'</a></TD>');
You cannot put the array in the string like it was, however it may still work, it isn't correct. It can be done like I have shown above, or you can surround the array variable in braces {} within the string.