I am using php to access a mysql database and have Safari render the php code. I have everything setup on my Mac running Mountain Lion. phpinfo() renders perfectly. If I use textmate and run the php code within phpmate, i can access the database and get the info I need. But when I access it within Safari, it displays the php code instead of connecting to the sql server and displaying the database.
THoughts/ideas ? I have apache working and i have mysql working. Queries to mysql using command line also work. Its just Safari that does not render the php code. Thanks.
<HTML>
<HEAD>
<TITLE> Our List of Link </TITLE>
<HEAD>
<BODY>
<?php
$dbcnx = $link = mysql_connect("localhost",'root','root');
if (!$dbcnx) {
die(mysql_error());
echo( "<P>Unable to connect to the " .
"database server at this time.</P>" );
}
if (! @mysql_select_db("UrlList") ) {
echo( "<P>Unable to locate the " .
"database at this time.</P>" );
exit();
}
?>
</BLOCKQUOTE>
</BODY>
</HTML