Now, i need to display things from my database... but my php file is showing me This webpage is not available. The webserver is up, syntax is perfect. Here it is if it helps:
- Code: Select all
<?php
/* Program: petCatalog.php
* Desc: Displays a list of pet categories from the
* PetType table. Includes descriptions.
* User checks radio button.
*/
?>
<html>
<head><title> Pet Types </title></head>
<body>
<?php
include("misc.inc");
// defining the connection
$connection = mysql_connect($host, $user, $password)
or die ("couldn't connect to server!");
// selecting the database (PetCatalog)
$db = mysql_select_db($database, $connection)
or die ("couldn't select database!");
// Select all categories from the PetType table
$query = "SELECT * FROM PetType ORDER BY petType";
$result = mysql_query($query)
or die ("couldn't execute query!");
// display a little bit of introductory text:
echo "<div style='margin-left: .1in'>
<h1 align='center'> Pet Catalog</h1>
<h2 align='center'> The following animal friends are
waiting for you.</h2>
<p align='center'>Find just what you want and hurry
in to the store to pick up your
new friend.
<p><h3 align='center'>Which pet are you interested in?</h3>\n";
// create a form containing the selection list:
echo "<form action='ShowPets.php' method='post'>\n";
echo "<table cellpadding='5' border='1'>";
$counter = 1;
while ($row = mysql_fetch_array($result))
{
extract($row);
echo "<tr><td valign='top' width='15%'>\n";
echo "<input type='radio' name='interest'
value='$petType'\n";
if ( $counter == 1)
{
echo "checked";
}
echo"><font size='+1')<b>$petType</b></font>";
echo "</td>
<td>$typeDescription</td>";
echo "</tr>";
$counter++;
}
echo "</table>";
echo "<input type='submit' value='Select Pet Type'>
</form>\n";
?>
</div>
</body></html>
Thanks for any help!