QUOTE
<?php include 'hdr.php'; ?>
<?php
mysql_connect ('localhost', 'username', 'pw') ;
mysql_select_db ('database');
$sql = "SELECT * FROM php_journal ORDER BY timestamp DESC LIMIT 5";
$result = mysql_query($sql) or print ("Can't select entries from table php_journal.<br />" . $sql . "<br />" . mysql_error());
while($row = mysql_fetch_array($result)) {
$date = date("l F d Y", $row['timestamp']);
$title = stripslashes($row['title']);
$entry = stripslashes($row['entry']);
$mood = stripslashes($row['mood']);
$music = stripslashes($row['music']);
?>
<p><strong><?php echo $title; ?></strong><br /><br />
<?php echo $entry; ?><br /><br />
Rocked on <?php echo $date; ?><Br>
Currently feeling <?php echo $mood; ?><br>
Dancing to <?php echo $music; ?><br/><br/>
<?php
$result2 = mysql_query ("SELECT id FROM php_journal_comments WHERE entry='$id'");
$num_rows = mysql_num_rows($result2);
if ($num_rows > 0) {
echo "<a href=\"journal.php?id=" . $id . "\">" . $num_rows . " Mundane Thoughts</a>";
}
else {
echo "<a href=\"journal.php?id=" . $id . "\">Walk and Talk</a>";
} ?>
<hr /></p>
<?php
}
$id = $row['id'];
$commenttimestamp = strtotime("now");
$sql = "SELECT * FROM php_journal_comments WHERE entry='$id' ORDER BY timestamp";
$result = mysql_query ($sql) or print ("Can't select comments from table php_journal_comments.<br />" . $sql . "<br />" . mysql_error());
while($row = mysql_fetch_array($result)) {
$timestamp = date("l F d Y", $row['timestamp']);
printf("<hr />");
print("<p>" . stripslashes($row['comment']) . "</p>");
printf("<p>Comment by <a href=\"%s\">%s</a> @ %s</p>", stripslashes($row['url']), stripslashes($row['name']), $timestamp);
printf("<hr />");
}
<form method="post" action="/dstrbnglywrd/process.php">
<p><input type="hidden" name="entry" id="entry" value="<?php echo $id; ?>" />
<input type="hidden" name="timestamp" id="timestamp" value="<?php echo $commenttimestamp; ?>">
<strong><label for="name">Name:</label></strong> <input type="text" name="name" id="name" size="25" /><br />
<strong><label for="email">E-mail:</label></strong> <input type="text" name="email" id="email" size="25" /><br />
<strong><label for="url">URL:</label></strong> <input type="text" name="url" id="url" size="25" value="http://" /><br />
<strong><label for="comment">Comment:</label></strong><br />
<textarea cols="25" rows="5" name="comment" id="comment"></textarea></p>
<p><input type="submit" name="submit_comment" id="submit_comment" value="Add Comment" /></p>
</form>
}
?>
</div>
<?php include 'ftr.php'; ?>
It keeps showing this message:
Parse error: syntax error, unexpected '<' in /home/iheartyo/public_html/shotgundeathwish/index.php on line 57