Jump to content

Trouble Bookmarking PHP Page


stragglerat

Recommended Posts

I apologize for how confusing this might get. I'm using PHP to pull items from a SQL database. This is the relevant portion of the code from my main results page:

 

// see if any rows were returned
if (mysql_num_rows($result) > 0) {
// yes
// print them one after another


echo "<table width=100% border=0 cellspacing=0 cellpadding=0 class=box_width_cont product><tr>";
$i = 0;
while($row = mysql_fetch_row($result)) {

if ($i == 3)
{
echo "</tr><tr>";
$i = 0;
}

echo "<td width=33%>";

echo "<a class='thumbnail' href='javascript:void(0)'><img src='images/3stone/rings/".$row[0]."fronts.jpg'>";

echo "<span><img src='images/3stone/rings/".$row[0]."front.jpg'></span></a><br>";

echo "<font color=#855b63><b>".$row[1]."<br>".$row[2]."<br>".$row[6]." Cut<br>Size: ".$row[3]."</b><br><br></font><font color=#855b63 size=3><b>".$row[9]."</b></font><br><br>";

echo "<form action='details.php' method='post'><input type='image' src='images/button_details.gif' name='0' value='".$row[0]."'></form><br><img height='2' src='images/spacer.gif'><br><img src='images/button_add_to_cart1.gif'><br><br><br>";

echo "</td>";

$i++;

}



echo "</table>";

}

 

As you can see, I have a details button under each row. I'm using a form POST method to send $row[0], which is the item number, to details.php when the button is clicked.  Here is the query from details.php with the variable plugged in.

 

$query = "SELECT * FROM wwjitems WHERE item = '".$_POST["0"]."'";

 

Details.php is a page that returns just one result with more details on that particular item. Everything works great, with one little problem.  When someone bookmarks details.php and comes back later, they get a blank page. Is there any way around this, or will I have to use a different method for creating the single item page?

Link to comment
https://forums.phpfreaks.com/topic/106872-trouble-bookmarking-php-page/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.