i found a comment script that would work, but it want my pages in id insteed. bellow is how i currenlt have it to show my images.
"show.php" shows the picture clicked in a new window with the ID name of the picture in the database, the comment script however as shown bellow
i need to manually change the number for each page to make a diffrent comment form / comments appear, so i wonder, is it possible to maybe make the code for the comment check the ID of the picture and if the id of the picture in show.php is for example 36 it makes the page ID 36 and shows the correct comment form? or in some way make it automated?
Code:
<?
$MYSQL_HOST = 'test';
$MYSQL_USER = 'test';
$MYSQL_PASSWORD = 'test';
$MYSQL_DATABASE = 'test';
mysql_connect($MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD);
mysql_select_db($MYSQL_DATABASE);
$res = mysql_query('SELECT *,unix_timestamp(tstamp) as utstamp FROM img
ORDER BY tstamp DESC LIMIT 6');
echo "<table cellspacing=\"3\" cellpadding=\"1\" border=\"2\"><tr>";
while ($row = mysql_fetch_assoc($res)) {
echo "<td>";
$row['message'] = substr($row['message'],strpos($row['message'],' '));
if ( file_exists('img/' . $row['id'] . '.jpeg') ) {
$row['picture'] = 'img/' . $row['id'] . '.jpeg';
} else $row['picture'] = '';
if ( $row['picture'] != '' ) {
echo '<a href="show.php?id=' . $row['id'] . '">';
echo '<img width="125" src="' . $row['picture'] . '"></a>';
}
echo "</td>";
}
echo "</tr></table>";
?>
"show.php" shows the picture clicked in a new window with the ID name of the picture in the database, the comment script however as shown bellow
Code:
<?php
$page_id = "6"; // for example
include("comments/comments_show.php");
include("comments/comments_form.php");
?>
i need to manually change the number for each page to make a diffrent comment form / comments appear, so i wonder, is it possible to maybe make the code for the comment check the ID of the picture and if the id of the picture in show.php is for example 36 it makes the page ID 36 and shows the correct comment form? or in some way make it automated?