Page 1 of 1
image gallery tut not working
Posted: Sat Dec 02, 2006 7:38 pm
by dru_nasty
Howdy all,
I can't seem to get this tut to work for me.
http://www.php-mysql-tutorial.com/image-gallery/
Even when I download the source files at the end of the tutorial here
http://www.php-mysql-tutorial.com/image ... e-list.php (at the bottom). I've got gd library installed, and my config file is properly set up. The script doesn't seem to have an issue with db connection, but everything else is buggy. Could someone possible give these source files a shot to see if they work for them? And or if you can see if some of the code may be deprecated or something. I can't see any reason why this wouldn't work.
Thanks for you time
Posted: Sat Dec 02, 2006 8:09 pm
by nickvd
Define "buggy"...
Also, the code that was posted in the tutorial is FULL of SQL INJECTION vulnerabilities.
for example:
Code: Select all
if (isset($_GET['image'])) {
$image = $_GET['image'];
$sql = "SELECT im_title
FROM tbl_image
WHERE im_id = $image";
Input from the user SHOULD NEVER BE TRUSTED... (highly recommend searching google for explanations of the various attacks available to malicious hackers.)
I'd recommend taking a look at the Gallery software here:
http://gallery.menalto.com
Posted: Sat Dec 02, 2006 8:15 pm
by dru_nasty
while in the admin section, I go to upload a jpg but it doesn't send it to a directory. And in the browser it just shows a broken link. then it seems like the server times out once in a while while poking around in the admin pages.
Once in a while I'll see this error:
HTTP/1.1 200 OK Date: Sun, 03 Dec 2006 02:13:42 GMT Server: Apache/1.3.33 (Darwin) PHP/5.1.6 X-Powered-By: PHP/5.1.6 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Keep-Alive: timeout=15, max=96 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html c17
I'm running this locally trying to debug. (kinda hard cuz im a newb). But i did upload it on a few different servers but to no avail.
Posted: Sat Dec 02, 2006 8:23 pm
by nickvd
Are the directory(ies) that the images get uploaded to writable?
Code: Select all
HTTP/1.1 200 OK Date: Sun, 03 Dec 2006 02:13:42 GMT Server: Apache/1.3.33 (Darwin) PHP/5.1.6 X-Powered-By: PHP/5.1.6 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Keep-Alive: timeout=15, max=96 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/html
Is not an error, it's actually the server telling you that the REQUEST was handled properly (notice i said request, that doesn't mean the php file did what was intended)
Posted: Sat Dec 02, 2006 8:35 pm
by dru_nasty
yes they are writable, i was thinking that maybe my path to the directories was wrong, but i checked over and over and tried different path possibilities. What i assume it should be is /Users/user/Sites/image-gallery/images/album/ (on mac)
Posted: Sat Dec 02, 2006 10:00 pm
by nickvd
Is that where the document root of your webserver is?
At the top of the main index file add: error_reporting(E_ALL);
Then try the upload again...
Posted: Sat Dec 02, 2006 10:36 pm
by dru_nasty
that didn't show me anything. and yes that is the root of my localhost. I'm at a loss myself as to what to look for.