All pastes #83777 Raw Edit

Avenger

public php v1 · immutable
·published 2006-07-10 01:59 UTC
rendered paste body
<?PHP session_start(); require("access.php"); ?><?php include("top2.php"); ?><?phpif(isset($_POST['Delete']) && isset($_POST['confirm']) && $_POST['confirm'] == 'yes') {      if (empty($_GET['id']) || !ctype_digit($_GET['id'])) die('Invalid id.');     else $query = mysql_query("DELETE FROM gallery WHERE id=".$_POST['id']." LIMIT 1");if ($query) {echo "The post has been successfully deleted from the guestbook.<p><center><a href=\"index2.php\">Admin Panel Index</a></center>";}} else {?><?phpif (empty($_GET['id']) || !ctype_digit($_GET['id'])) $_GET['id'] = 0;$query = mysql_query("SELECT * FROM gallery WHERE id = '".$_GET['id']."' LIMIT 1") or die(mysql_error());$data = mysql_fetch_array($query);?><table width="433" border="0">    <tr>    <td height="75"><div align="center"><strong>Image: </strong></div></td>    <td colspan="2"><div align="center"><img src="<?=$data['image_loc']?> " width="300" height="200"></div></td>  </tr>    <tr>    <td height="29"><strong>Title:</strong></td>    <td colspan="2"><?=$data['title']?></td>  </tr>  <tr>    <td height="38"><div align="center"><strong>Description:</strong></div></td>    <td colspan="2"><?=$data['description']?>    </td>  </tr>  <tr>    <td>&nbsp;</td>    <td><form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?id=<?php echo $data['id']; ?>">      <div align="center">        <input type="hidden" name="confirm" value="yes">        <input name="Delete" type="submit" value="Delete">      </div>    </form></td>  </tr></table><?php}?><?php include("bottom2.php"); ?>