Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Will not show Table>?

Featured Replies

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Search Page</title>
</head>
<?php
 if(isset($_POST['search']))
 {
include "db.php";
$prod = $_POST["prodname"];
$query = "SELECT prodname,features,details,moredet,picture,price FROM `nokia` WHERE prodname=$prod"; 	 
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){;
?>
<body>
<center>
<form method="post" action="<?php echo $PHP_SELF; ?>">
Mobile Phone Type:<br />
<input type="text" name="prodname" value=""/>
<input type="submit" name="search" value="Search!"/>
</form>
<table width="924" height="111" border="1">
 <tr>
   <td width="140" height="36"><u>Product:</u></td>
   <td width="185"><u>Features:</u></td>
   <td width="198"><u>Details:</u></td>
   <td width="228"><u>More Details: </u></td>
<td width="95"><u>Picture: </u></td>
<td width="38"><u>Price: </u></td>
 </tr>
 <tr>
   <td height="62"><?php echo $row['prodname']; ?></td>
   <td><?php echo $row['features']; ?></td>
   <td><?php echo $row['details']; ?></td>
   <td><?php echo $row['moredet']; ?></td>
<td><?php echo "<img src=\"".$row['picture']."\">"; ?></td>
<td><?php echo "£".$row['price']; ?></td>
<?php
};
};
?>
 </tr>
</table>
</center>
</body>
</html>

 

The problem with this is it shows a blank page but not the table....can anyone help?

 

Thankyou.

oh and it looks like it depends on the $_POST['search'] to even display the form including the submit button

Move your if(isset) condition after the submit button /form has been displayed

  • Author

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Search Page</title>
</head>
<?php
 if(isset(['search']))
 {
include "db.php";
$prod = $_POST["prodname"];
$query = "SELECT * FROM `nokia` WHERE prodname=$prod"; 	 
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){;
?>
<body>
<center>
<form method="post" action="">
Mobile Phone Type:<br />
<input type="text" name="prodname" value=""/>
<input type="submit" name="search" value="Search!"/>
</form>
<table width="924" height="111" border="1">
 <tr>
   <td width="140" height="36"><u>Product:</u></td>
   <td width="185"><u>Features:</u></td>
   <td width="198"><u>Details:</u></td>
   <td width="228"><u>More Details: </u></td>
<td width="95"><u>Picture: </u></td>
<td width="38"><u>Price: </u></td>
 </tr>
 <tr>
   <td height="62"><?php echo $row['prodname']; ?></td>
   <td><?php echo $row['features']; ?></td>
   <td><?php echo $row['details']; ?></td>
   <td><?php echo $row['moredet']; ?></td>
<td><?php echo "<img src=\"".$row['picture']."\">"; ?></td>
<td><?php echo "£".$row['price']; ?></td>
<?php
};
};
?>
 </tr>
</table>
</center>
</body>
</html>

I did this but got this when loaded >

Parse error: syntax error, unexpected '[', expecting T_STRING or T_VARIABLE or '$' in C:\xampp\htdocs\mobiles\search.php on line 7

I think this:

<?php
};
};
?>

 

is in the wrong place.

 

Should be after </tr>

 

 

  • Author

Hey all, I got this working....Thanks for all the help...here is the amended code...

 

<center>
<form method="post" action="">
 <p><u>Mobile Phone Type:</u><br />
     <select name="prodname">
       <option value="Nokia N97">Nokia N97</option>
       <option value="Nokia 5800">Nokia 5800</option>
       <option value="LG 600">LG 600</option>
       <option value="Samsung 8210">Samsung 8210</option>
       <option value="Samsung 9000">Samsung 9000</option>
       <option value="Samsung 2010">Samsung 2010</option>
       <option value="Samsung 9685">Samsung 9685</option>
     </select>
   From Database:
 <select name="database">
   <option value="nokia">Nokia Telecom</option>
   <option value="lg">Lifes Good (LG)</option>
   <option value="samsung">Samsung Mobile</option>
 </select>
 <br />
 <input type="submit" name="search" value="Search!"/>
</p>
 <p><u><strong>Invalid Selection of database will result in a NIL result</strong></u></p>
</form>
<?php
 if(isset($_POST['search']))
 {
include "db.php";
$prod = $_POST["prodname"];
$database = $_POST["database"];
$query = "SELECT * FROM `$database` WHERE prodname='$prod'"; 	 
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){
?>
<table width="924" height="111" border="1">
 <tr>
   <td width="140" height="36"><u>Product:</u></td>
   <td width="185"><u>Features:</u></td>
   <td width="198"><u>Details:</u></td>
   <td width="228"><u>More Details: </u></td>
<td width="95"><u>Picture: </u></td>
<td width="38"><u>Price: </u></td>
 </tr>
 <tr>
   <td height="62"><?php echo $row['prodname']; ?></td>
   <td><?php echo $row['features']; ?></td>
   <td><?php echo $row['details']; ?></td>
   <td><?php echo $row['moredet']; ?></td>
<td><?php echo "<img src=\"".$row['picture']."\">"; ?></td>
<td><?php echo "£".$row['price']; ?></td>
<?php
};
};
?>
 </tr>
</table>
</center>

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.