Forgot to update my .htaccess file:
I had ?id instead of ?photo_id
Code:
RewriteRule ^/?bigimage/([_a-zA-Z0-9-]+)$ bigimage.php?photo_id=$1 [L]
Even that didn't solve the problem though, i needed to $sql = SELECT photo_id, .. as well for the image to display.. below:
..and yes i did have a photo_id=17030702
Also, wont I need the . mysql_real_escape_string with $_GET['photo_id']).. (sercurity reaosns, or is that only needed for strings if so how do you protect the int from injections?)?
PHP Code:
<?php
require_once('includes/mysql_connect.inc.php');
$sql = "SELECT photo_id, title, DATE_FORMAT(gallery.date, '%M %D %Y') AS dr, caption
FROM photos
LEFT JOIN gallery
ON gallery.date = photos.date
WHERE photo_id = ".((int)$_GET['photo_id']);
$result = @mysql_query($sql) or die('Error: ' . mysql_error());
while ($row = mysql_fetch_array ($result)) {
echo '<h1>' . $row['title'] . '</h1><p>Date: ' . $row['dr'] . '</p><a href="javascript:history.go(-1)"><img src="images/170307/' . $row['photo_id'] . '.jpg" title="' . $row['caption'] . '"></a><h5>' . $row['caption'] . '</h5>';
}
?>
Regarding the "Gallery metadata" how can I get that to display in my title(address bar)?
I tried inserting a basic
PHP Code:
<?php echo '<h1>' . $row['title'] . '</h1>' ?>
into my <title>..</title> tag, but just didn't show anything, is that because the snippet was below and had no values yet?
and what is the main reason of using:
PHP Code:
..
var_dump($row);
var_dump($sql);
Big Thanks
Bookmarks