ok, this is the prupose, I am making a photo album, and I am having a feature, that alows you to delete a photo, but before it actualy is deleted, it asks if you are sure. Ill give you the page scripts in a sec
<?
$db=mysql_connect("localhost","root","*********") or die("Server could
not be connected");
$mydb=mysql_select_db("photos") or die("Database could not be
connected");
$query="select * from `$group_id` where album_id=$album_id;";
$res=mysql_query($query) or die($query);
while($row=mysql_fetch_array($res)){
$test_album_name=$row[album_name];
}
$query="select * from `$group_id` where album_id=$album_id;";
$res=mysql_query($query) or die($query);
while($row=mysql_fetch_array($res)){
$album_name=$row[album_name];
}
$query="select * from group_index where album_id=$group_id;";
$res=mysql_query($query) or die($query);
while($row=mysql_fetch_array($res)){
$group_name=$row[album_name];
}
$query="select max(id) as num from `$album_id`;";
$res=mysql_query($query) or die("error");
$row = mysql_fetch_assoc($res);
$max_id=$row['num'];
$max_rows=(int)($max_id/6);
$temp=$max_id%6;
if($temp>0){
$max_rows=$max_rows+1;
$empty_cells=6-$temp;
}
$cel=1;
$row_count=1;
$query="select * from `$album_id`";
$res=mysql_query($query) or die("Error");
echo"<table border=4 cellpadding=2 cellspacing=2 align=center
width=100%>";
echo" <tr>";
while($row=mysql_fetch_array($res)){
if($cel<=7){
if($row_count<$max_rows){
echo" <td>";
echo"<form method=post action=Delete_Menu_7.php>";
$id=$row[id];
$filename=$row[filename];
$height=$row[height];
$width=$row[width];
echo $filename;
echo"<br>";
$file= array($group_name,$album_name,$filename);
$slash_separated = implode("\\", $file);//must use two slashes because
the backslash is an escape character
echo $slash_separated;
$file=$slash_separated;
echo"<br>";
if($height>$width){
if($height>250){
$temp=$height/250;
$height=$height/$temp;
$width=$width/$temp;
}
}
if($width>$height){
if($width>250){
$temp=$width/250;
$height=$height/$temp;
$width=$width/$temp;
}
}
echo" <img src='$file' width='$width' height='$height'>";
echo"<br>";
echo $cel;
echo"<br>";
echo" <input type=submit name=options value='Submit'>";
echo" <input type=hidden name=album_id value='$album_id'>";
echo" <input type=hidden name=album_name value='$album_name'>";
echo" <input type=hidden name=group_id value='$group_id'>";
echo" <input type=hidden name=group_name value='$group_name'>";
echo" <input type=hidden name=id value='$id'>";
echo"</form>";
echo" </td>";
$cel=$cel+1;
$id_count=$id_count+1;
}
if($row_count==$max_rows){
if($cel<(7-$empty_cells)){
echo" <td>";
echo"<form method=post action=Delete_Menu_7.php>";
$id=$row[id];
$filename=$row[filename];
$height=$row[height];
$width=$row[width];
echo $filename;
echo"<br>";
$file= array($group_name,$album_name,$filename);
$slash_separated = implode("\\", $file);//must use two slashes because
the backslash is an escape character
echo $slash_separated;
$file=$slash_separated;
if($height>$width){
if($height>250){
$temp=$height/250;
$height=$height/$temp;
$width=$width/$temp;
}
}
if($width>$height){
if($width>250){
$temp=$width/250;
$height=$height/$temp;
$width=$width/$temp;
}
}
echo"<br>";
echo" <img src='$file' width='$width' height='$height'>";
echo"<br>";
echo $cel;
echo"<br>";
echo" <input type=submit name=options value='Submit'>";
echo" <input type=hidden name=album_id value='$album_id'>";
echo" <input type=hidden name=album_name value='$album_name'>";
echo" <input type=hidden name=group_id value='$group_id'>";
echo" <input type=hidden name=group_name value='$group_name'>";
echo" <input type=hidden name=id value='$id'>";
echo"</form>";
echo" </td>";
$cel=$cel+1;
$id_count=$id_count+1;
}
}
}
if($cel==7){
echo" </tr>";
echo" <tr>";
$cel=1;
$row_count=$row_count+1;
}
}
while(($cel>=(7-$empty_cells))&&($cel<7)){
echo" <td>";
echo" <img src='placeholder.jpg' width='250' height='250'>";
echo" </td>";
$cel=$cel+1;
if($cel==7){
echo" </tr>";
}
}
echo" </table>";
?>