Chris-2k
07-19-2012, 12:13 AM
hi,
so i've uploaded an image to a dir and stored SOME info on db eg, album, user, file name and extension.
Now my last job, to count views.....
i have image.php (came up with):
<?php
/********************************
IMG-ize Script 2012
@version: 3.0
@auth0or: Chris Reynolds
Copyright 2012 Chris Reynolds
********************************/
include_once $_SERVER['DOCUMENT_ROOT'] .'/includes/init.php' /*die('Can\'t find file.')*/;
$id = $_REQUEST['id'];
$img = mysql_query("SELECT * FROM images WHERE id = '$id'");
$img = mysql_fetch_assoc($img);
$img = $img['image'];
header("Content-type: image/jpeg");
echo $img;
?>
I'm thinking that's good for the job ^^^^^^^^^^
hmm now one needs help updating view count and for that echo ^^^^^^ should i add the dir?
so i've uploaded an image to a dir and stored SOME info on db eg, album, user, file name and extension.
Now my last job, to count views.....
i have image.php (came up with):
<?php
/********************************
IMG-ize Script 2012
@version: 3.0
@auth0or: Chris Reynolds
Copyright 2012 Chris Reynolds
********************************/
include_once $_SERVER['DOCUMENT_ROOT'] .'/includes/init.php' /*die('Can\'t find file.')*/;
$id = $_REQUEST['id'];
$img = mysql_query("SELECT * FROM images WHERE id = '$id'");
$img = mysql_fetch_assoc($img);
$img = $img['image'];
header("Content-type: image/jpeg");
echo $img;
?>
I'm thinking that's good for the job ^^^^^^^^^^
hmm now one needs help updating view count and for that echo ^^^^^^ should i add the dir?