page with error message // http://www.walkinginchrist.org/vintage/entry.php?id=5
entry.php
CODE
<?php include("/mnt/w0603/d08/s07/b025e6a3/www/vintage/cookiecheck.php");
include($headervar.$skin.$extension);
mysql_connect ('****', '****', '****');
mysql_select_db ('****');
if (file_exists("verify.jpg")) {
if (!is_writable("verify.jpg")) {
die("verify.jpg is not writable (CHMODed to 666). Please change this in order for the script to work.");
}
}
else {
die("Oops, looks like you forgot to upload verify.jpg, or it is not in the same folder as your form. Please rectify this or the script will not work.");
}
session_start();
$encoded_string;
session_register("encoded_string");
$captcha = ImageCreate(50, 20);
$background = ImageColorAllocate($captcha, 255, 255, 255);
$text = ImageColorAllocate($captcha, 0, 0, 0);
srand((double)microtime()*1000000);
$string = md5(rand(0,9999));
$_SESSION['encoded_string'] = substr($string, 17, 5);
ImageFill($captcha, 0, 0, $background);
ImageString($captcha, 4, 6, 1, $_SESSION['encoded_string'], $text);
$verification_img = ImageJPEG($captcha, "verify.jpg");
ImageDestroy($captcha);
?>
<?php
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
die("Invalid ID specified.");
}
$id = (int)$_GET['id'];
$sql = "SELECT * FROM blog WHERE id='$id' LIMIT 1";
$result = mysql_query($sql) or print ("Can't select entry from table blog.<br />" . $sql . "<br />" . mysql_error());
while($row = mysql_fetch_array($result)) {
$date = date("l F d Y g:ia", $row['timestamp']);
$title = stripslashes($row['title']);
$entry = stripslashes($row['entry']);
$listening = stripslashes($row['listening']);
$reading = stripslashes($row['reading']);
$quote = stripslashes($row['quote']);
?>
<div class="div" id="content">
<table width="337" border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="entryheader"><?php echo $title; ?></td>
</tr>
<tr>
<td class="entrysub"><?php echo $date; ?></td>
</tr>
<tr>
<td class="entrysub"><strong>Currently Reading:</strong> <?php echo $reading; ?></td>
</tr>
<tr>
<td class="entrysub"><strong>Currently Listening To:</strong> <?php echo $listening; ?></td>
</tr>
<tr>
<td class="entrysub"><strong>Quote:</strong> <?php echo $quote; ?></td>
</tr>
<tr>
<td class="entry"><br><?php echo $entry; ?></td>
</tr>
</table>
<br><br><br>
<?php
}
$commenttimestamp = strtotime("now");
$sql = "SELECT * FROM blog_comments WHERE comentry='$id' ORDER BY timestamp";
$result = mysql_query ($sql) or print ("Can't select comments from table blog_comments.<br />" . $sql . "<br />" . mysql_error());
?>
<?php
while($row = mysql_fetch_array($result)) {
$timestamp = date(" F d Y", $row['timestamp']);?>
<!-- VIEW COMMENTS HERE VIEW COMMENTS HERE -->
<!-- VIEW COMMENTS HERE VIEW COMMENTS HERE -->
<?php printf("<p align=\"left\"> <a href=\"%s\">%s</a> said this on %s</p>", stripslashes($row['url']), stripslashes($row['name']), $timestamp);
?>
<?php print("<p class=\"h5\">" . stripslashes($row['comment']) . "</p>");
}
?><br><br><br>
<!-- LEAVE A COMMENT LEAVE A COMMENT -->
<!-- LEAVE A COMMENT LEAVE A COMMENT -->
<p class="h1">Leave A Comment</p>
<form method="post" action="process.php">
<input type="hidden" name="comentry" id="comentry" value="<?php echo $id; ?>" />
<input type="hidden" name="timestamp" id="timestamp" value="<?php echo $commenttimestamp; ?>">
<table width="337" border="0" cellpadding="0" cellspacing="0" class="commentslook">
<tr class="commentslook">
<td width="66"><label for="Name"><strong>Name:</strong></label></td>
<td width="269"><input type="text" name="name" id="name" size="30" /></td>
</tr>
<tr class="commentslook">
<td><label for="Email"><strong>E-mail:</strong></label></td>
<td><input type="text" name="email" id="email" size="30" /></td>
</tr>
<tr class="commentslook">
<td><label for="URL"><strong>URL:</strong></label></td>
<td><input type="text" name="url" id="url" size="30" value="http://" /></td>
</tr>
<tr class="commentslook">
<td valign="top"><strong>Comment</strong>:</td>
<td><textarea cols="25" rows="5" name="comment" id="comment"></textarea></td>
</tr>
<tr class="commentslook">
<td colspan="2" valign="top">
<p><label for="verifyimage">Enter the characters on this image into the box below:</label><br />
<img src="verify.jpg" alt="CAPTCHA image" title="CAPTCHA image" />
<input type="text" name="verifyimage" id="verifyimage" maxlength="5" /></p>
</td>
<tr class="commentslook">
<td colspan="2" valign="top"><div align="center">
<input type="submit" name="submit_comment" id="submit_comment" value="Add Comment" />
</div></td>
<tr class="commentsformtop">
<td colspan="2" valign="top"> </td>
</tr>
</table>
</form></div>
include($headervar.$skin.$extension);
mysql_connect ('****', '****', '****');
mysql_select_db ('****');
if (file_exists("verify.jpg")) {
if (!is_writable("verify.jpg")) {
die("verify.jpg is not writable (CHMODed to 666). Please change this in order for the script to work.");
}
}
else {
die("Oops, looks like you forgot to upload verify.jpg, or it is not in the same folder as your form. Please rectify this or the script will not work.");
}
session_start();
$encoded_string;
session_register("encoded_string");
$captcha = ImageCreate(50, 20);
$background = ImageColorAllocate($captcha, 255, 255, 255);
$text = ImageColorAllocate($captcha, 0, 0, 0);
srand((double)microtime()*1000000);
$string = md5(rand(0,9999));
$_SESSION['encoded_string'] = substr($string, 17, 5);
ImageFill($captcha, 0, 0, $background);
ImageString($captcha, 4, 6, 1, $_SESSION['encoded_string'], $text);
$verification_img = ImageJPEG($captcha, "verify.jpg");
ImageDestroy($captcha);
?>
<?php
if (!isset($_GET['id']) || !is_numeric($_GET['id'])) {
die("Invalid ID specified.");
}
$id = (int)$_GET['id'];
$sql = "SELECT * FROM blog WHERE id='$id' LIMIT 1";
$result = mysql_query($sql) or print ("Can't select entry from table blog.<br />" . $sql . "<br />" . mysql_error());
while($row = mysql_fetch_array($result)) {
$date = date("l F d Y g:ia", $row['timestamp']);
$title = stripslashes($row['title']);
$entry = stripslashes($row['entry']);
$listening = stripslashes($row['listening']);
$reading = stripslashes($row['reading']);
$quote = stripslashes($row['quote']);
?>
<div class="div" id="content">
<table width="337" border="0" cellspacing="0" cellpadding="2">
<tr>
<td class="entryheader"><?php echo $title; ?></td>
</tr>
<tr>
<td class="entrysub"><?php echo $date; ?></td>
</tr>
<tr>
<td class="entrysub"><strong>Currently Reading:</strong> <?php echo $reading; ?></td>
</tr>
<tr>
<td class="entrysub"><strong>Currently Listening To:</strong> <?php echo $listening; ?></td>
</tr>
<tr>
<td class="entrysub"><strong>Quote:</strong> <?php echo $quote; ?></td>
</tr>
<tr>
<td class="entry"><br><?php echo $entry; ?></td>
</tr>
</table>
<br><br><br>
<?php
}
$commenttimestamp = strtotime("now");
$sql = "SELECT * FROM blog_comments WHERE comentry='$id' ORDER BY timestamp";
$result = mysql_query ($sql) or print ("Can't select comments from table blog_comments.<br />" . $sql . "<br />" . mysql_error());
?>
<?php
while($row = mysql_fetch_array($result)) {
$timestamp = date(" F d Y", $row['timestamp']);?>
<!-- VIEW COMMENTS HERE VIEW COMMENTS HERE -->
<!-- VIEW COMMENTS HERE VIEW COMMENTS HERE -->
<?php printf("<p align=\"left\"> <a href=\"%s\">%s</a> said this on %s</p>", stripslashes($row['url']), stripslashes($row['name']), $timestamp);
?>
<?php print("<p class=\"h5\">" . stripslashes($row['comment']) . "</p>");
}
?><br><br><br>
<!-- LEAVE A COMMENT LEAVE A COMMENT -->
<!-- LEAVE A COMMENT LEAVE A COMMENT -->
<p class="h1">Leave A Comment</p>
<form method="post" action="process.php">
<input type="hidden" name="comentry" id="comentry" value="<?php echo $id; ?>" />
<input type="hidden" name="timestamp" id="timestamp" value="<?php echo $commenttimestamp; ?>">
<table width="337" border="0" cellpadding="0" cellspacing="0" class="commentslook">
<tr class="commentslook">
<td width="66"><label for="Name"><strong>Name:</strong></label></td>
<td width="269"><input type="text" name="name" id="name" size="30" /></td>
</tr>
<tr class="commentslook">
<td><label for="Email"><strong>E-mail:</strong></label></td>
<td><input type="text" name="email" id="email" size="30" /></td>
</tr>
<tr class="commentslook">
<td><label for="URL"><strong>URL:</strong></label></td>
<td><input type="text" name="url" id="url" size="30" value="http://" /></td>
</tr>
<tr class="commentslook">
<td valign="top"><strong>Comment</strong>:</td>
<td><textarea cols="25" rows="5" name="comment" id="comment"></textarea></td>
</tr>
<tr class="commentslook">
<td colspan="2" valign="top">
<p><label for="verifyimage">Enter the characters on this image into the box below:</label><br />
<img src="verify.jpg" alt="CAPTCHA image" title="CAPTCHA image" />
<input type="text" name="verifyimage" id="verifyimage" maxlength="5" /></p>
</td>
<tr class="commentslook">
<td colspan="2" valign="top"><div align="center">
<input type="submit" name="submit_comment" id="submit_comment" value="Add Comment" />
</div></td>
<tr class="commentsformtop">
<td colspan="2" valign="top"> </td>
</tr>
</table>
</form></div>