I receive the correct results when I use Microsoft Internet Explorer. However, when I use Ubuntu and try to get the output, I receive a blank screen except for the title "Book Finder Search Results" which appears at the top.

Are there any adjustments I can make, so I can make it work with Ubuntu? Thanks.


  <title>Book Finder Search Results</title>
<h1>Book Finder Search Results</h1>
  // create short variable names

  if (!$searchtype || !$searchterm) {
     echo 'You have not entered search details.  Please go back and try again.';

  if (!get_magic_quotes_gpc()){
    $searchtype = addslashes($searchtype);
    $searchterm = addslashes($searchterm);

  @ $db = new mysqli('localhost', 'root', 'password', 'books');

  if (mysqli_connect_errno()) {
     echo 'Error: Could not connect to database.  Please try again later.';

  $query = "select * from books where ".$searchtype." like '%".$searchterm."%'";
  $result = $db->query($query);

  $num_results = $result->num_rows;

  echo "<p>Number of books found: ".$num_results."</p>";

  for ($i=0; $i <$num_results; $i++) {
     $row = $result->fetch_assoc();
     echo "<p><strong>".($i+1).". Title: ";
     echo htmlspecialchars(stripslashes($row['title']));
     echo "</strong><br />Author: ";
     echo stripslashes($row['author']);
     echo "<br />ISBN: ";
     echo stripslashes($row['isbn']);
     echo "<br />Price: ";
     echo stripslashes($row['price']);
     echo "</p>";


6 Years
Discussion Span
Last Post by zizuno

I am using Microsoft Windows. On the Windows side, the files are in my wamp/www/ folder. I ran everything fine with mysql/php using WAMP under the Windows side. The results print out fine.

My issues are with Ubuntu. I am trying to get it working Ubuntu using VMware Player. On the Ubuntu side, the files are located in /var/www/.

I am using the same computer. My main OS is Windows, I have Ubuntu on VMware Player.

For URL, I am typing..

http://localhost/Reunion/search.html ===> brings up the search webpage that allows you to search authors in the database

At the search page, I have a form that allows you to search for author names etc. I type in the name and click search and the result is the .php file is blank.

It doesn't do that with Microsoft Windows using Internet Explorer. I tried it Opera and Firefox under UBuntu.


You have to install mysql or whatever version you are using. Enable php errors at the top of the page and it will tell you your exact problem.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.