I am building a website and need a little help with php links.
Here is my current code.
Code: Select all
<?php
error_reporting(E_ALL ^ E_NOTICE);
$sql = "SELECT id, stateName
FROM states
ORDER BY stateName ASC";
$rs = mysql_query($sql) or die(mysql_error());
print "<ul id=\"state_nav\">";
while($row = mysql_fetch_array($rs,MYSQL_ASSOC)) {
print "<li>";
print "<a href=\"resorts.php?state=".$row[id]."\">$row[stateName]</a>";
print "</li>";
}
print "<ul>";
?>
Code: Select all
http://www.mysite.com/resorts.php?state=CTCode: Select all
http://www.mysite.com/CT.phpCode: Select all
http://skiing.alpinezone.com/resorts/?state=CT-Dave