Forum Moderators: coopster

Message Too Old, No Replies

Not sure where to close the table at...

         

chaddsisco

1:23 am on Aug 19, 2005 (gmt 0)

10+ Year Member



Im trying to get the line "Are you sure you want to delete this picture?" to display below the picture the mysql query brings back, but for some reason that line of code keeps appearing above the picture all smashed together (like it is located in a cell of a table) my guess is that I do not have a table closed right but who knows....any ideas? Thanks in advance

<?php
//connect to the database
$link = mysql_connect("localhost", "admin", "pass")
or die("Could not connect: " . mysql_error());
mysql_select_db("gallery", $link)
or die (mysql_error());

$folder_location = $_POST['folder_location'];
$picture_id = $_POST['picture_id'];
$ImageDir = $_POST['ImageDir'];
$ImageThumb = $_POST['ImageThumb'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Delete Image Confirm</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<?php
echo "folder location: <b>$folder_location</b> and picture id: <b>$picture_id</b>";
echo "Image Dir: <b>$ImageDir</b> and ImageThumb: <b>$ImageThumb</b>";
?>

<p align="center">Listing of picture to be deleted</p>
<table align="center">

<?php
//tell database which folder to display
switch ($folder_location) {
case "centerpieces":
$getpic = mysql_query("SELECT * FROM gallery_centerpieces WHERE image_id=$picture_id")
or die(mysql_error());
while ($rows = mysql_fetch_array($getpic)) {
extract($rows);
echo "<tr>\n";
echo "<td><a href=\"".$ImageDir . $image_id . ".jpg\">";
echo "<img src=\"" . $ImageThumb . $image_id . ".jpg\" border=\"0\">";
echo "</a></td>\n";
echo "<td>" . $image_id . "</td>\n";
echo "</tr>\n";
}
break;
case "classicdecor":
$getpic = mysql_query("SELECT * FROM gallery_classicdecor")
or die(mysql_error());
while ($rows = mysql_fetch_array($getpic)) {
extract($rows);
echo "<tr>\n";
echo "<td><a href=\"".$ImageDir . $image_id . ".jpg\">";
echo "<img src=\"" . $ImageThumb . $image_id . ".jpg\" border=\"0\">";
echo "</a></td>\n";
echo "<td>" . $image_date . "</td>\n";
echo "<td>" . $image_id . "</td>\n";
echo "</tr>\n";
}
break;
case "dancefloors":
$getpic = mysql_query("SELECT * FROM gallery_dancefloors")
or die(mysql_error());
while ($rows = mysql_fetch_array($getpic)) {
extract($rows);
echo "<tr>\n";
echo "<td><a href=\"".$ImageDir . $image_id . ".jpg\">";
echo "<img src=\"" . $ImageThumb . $image_id . ".jpg\" border=\"0\">";
echo "</a></td>\n";
echo "<td>" . $image_date . "</td>\n";
echo "<td>" . $image_id . "</td>\n";
echo "</tr>\n";
}
break;
case "deliverybouquets":
$getpic = mysql_query("SELECT * FROM gallery_deliverybouquets")
or die(mysql_error());
while ($rows = mysql_fetch_array($getpic)) {
extract($rows);
echo "<tr>\n";
echo "<td><a href=\"".$ImageDir . $image_id . ".jpg\">";
echo "<img src=\"" . $ImageThumb . $image_id . ".jpg\" border=\"0\">";
echo "</a></td>\n";
echo "<td>" . $image_date . "</td>\n";
echo "<td>" . $image_id . "</td>\n";
echo "</tr>\n";
}
break;
case "propsandeffects":
$getpic = mysql_query("SELECT * FROM gallery_propsandeffects")
or die(mysql_error());
while ($rows = mysql_fetch_array($getpic)) {
extract($rows);
echo "<tr>\n";
echo "<td><a href=\"".$ImageDir . $image_id . ".jpg\">";
echo "<img src=\"" . $ImageThumb . $image_id . ".jpg\" border=\"0\">";
echo "</a></td>\n";
echo "<td>" . $image_date . "</td>\n";
echo "<td>" . $image_id . "</td>\n";
echo "</tr>\n";
}
break;
case "stagedecor":
$getpic = mysql_query("SELECT * FROM gallery_stagedecor")
or die(mysql_error());
while ($rows = mysql_fetch_array($getpic)) {
extract($rows);
echo "<tr>\n";
echo "<td><a href=\"".$ImageDir . $image_id . ".jpg\">";
echo "<img src=\"". $ImageThumb . $image_id . ".jpg\" border=\"0\">";
echo "</a></td>\n";
echo "<td>" . $image_date . "</td>\n";
echo "<td>" . $image_id . "</td>\n";
echo "</tr>\n";
}
break;
case "themedecor":
$getpic = mysql_query("SELECT * FROM gallery_themedecor")
or die(mysql_error());
while ($rows = mysql_fetch_array($getpic)) {
extract($rows);
echo "<tr>\n";
echo "<td><a href=\"".$ImageDir . $image_id . ".jpg\">";
echo "<img src=\"" . $ImageThumb . $image_id . ".jpg\" border=\"0\">";
echo "</a></td>\n";
echo "<td>" . $image_date . "</td>\n";
echo "<td>" . $image_id . "</td>\n";
echo "</tr>\n";
}
break;
case "tradeshows":
$getpic = mysql_query("SELECT * FROM gallery_tradeshows")
or die(mysql_error());
while ($rows = mysql_fetch_array($getpic)) {
extract($rows);
echo "<tr>\n";
echo "<td><a href=\"".$ImageDir . $image_id . ".jpg\">";
echo "<img src=\"" . $ImageThumb . $image_id . ".jpg\" border=\"0\">";
echo "</a></td>\n";
echo "<td>" . $image_date . "</td>\n";
echo "<td>" . $image_id . "</td>\n";
echo "</tr>\n";
}
break;
case "weddings":
$getpic = mysql_query("SELECT * FROM gallery_weddings")
or die(mysql_error());
while ($rows = mysql_fetch_array($getpic)) {
extract($rows);
echo "<tr>\n";
echo "<td><a href=\"".$ImageDir . $image_id . ".jpg\">";
echo "<img src=\"" . $ImageThumb . $image_id . ".jpg\" border=\"0\">";
echo "</a></td>\n";
echo "<td>" . $image_date . "</td>\n";
echo "<td>" . $image_id . "</td>\n";
echo "</tr>\n";
}
break;
default:
echo "Sorry, but the location you selected was not correct.<br>";
echo "Please hit your browser's 'back' button and try again.";
}


<p>Are you sure you want to delete this picture from your gallery?</p>
?>
</body>
</html>

bibby

3:43 am on Aug 19, 2005 (gmt 0)

10+ Year Member



Your <p> comes directly after a closed table row, if I'm reading that right.

add this to your <p>Are you sure..

<tr><td colspan=99 align=center>
<p>Are you sure you want to delete this picture from your gallery?</p>
</td></tr></table>

Be sure to close the table at some point, but I'd do it here. Your message should appear as it's own row underneath all others.