[ubuntu 9.04] php files trying to acess mySQL : This webpa

Problems with the Linux version of XAMPP, questions, comments, and anything related.

[ubuntu 9.04] php files trying to acess mySQL : This webpa

Postby xZachtmx » 16. October 2009 02:30

Ok i have xampp setup for linux a while ago... i got it working and i even made a php form that sent user files to a server... even when it send the info to the database... i got the error This webpage is not available.

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!
xZachtmx
 
Posts: 1
Joined: 16. October 2009 02:23

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 28 guests