All pastes #261295 Raw Edit

Someone

public text v1 · immutable
#261295 ·published 2006-11-29 02:30 UTC
rendered paste body
---mainfile>
<?
require ("required.php");
?>
<HTML>
<HEAD>
<LINK rel="stylesheet" type="text/css" href="tagboard.css">

</HEAD>
<BODY topmargin="2" leftmargin="2" bottommargin="2" rightmargin="2">

<?
    /* Load the tagboard, the X number of most recent posts */
    $SQL = "SELECT * FROM $tablname ORDER BY id LIMIT $howmany";

    $results = mysql_db_query($database, "$SQL", $connection);
    if (!$results)
      return ("ERROR: " . mysql_error() . "\n$SQL\n");
	
    while ($row = mysql_fetch_array($results))
      { 
	    $tag_id   = $row["id"];
        $nick     = $row["nick"]; 
        $url      = $row["url"];
        $message  = $row["message"];
        $datetime = $row["datetime"];

        /* Some people don't have web sites, so we check to see if they put a URL in the database */
        if ($url=="" or $url=="http://") /* If they didn't then we just display the nick and the message */
          $url = "&nbsp;";
        else /* If they did, then we link it!! */
          $url = "<B><a href=\"$url\" target=\"_blank\">($url)</a></B>";
        
        if ($timestamping == 1)
          echo "$tag_id) $nick $url <BR>($datetime)<BR>$nick wrote: $message<BR><a href=\"delete.php\" target = \"hits\">(Delete MSG)</a><HR>";
        else
          echo "$tag_id) $nick $url <BR>$nick wrote: $message<BR><HR>";
      }
				
      /* Like always, we close the connection to the database */
      mysql_close($connection);
?>

<BR>
</BODY>
</HTML>

--------------delete file----------
<?php
require ("required.php");


$sql = "DELETE FROM $tablname WHERE id = '$tag_id'";
$result = MYSQL_QUERY($sql);

?>
Record  has been deleted from database.<br>