Can somwhone make, or copy here php image upload code, I was searching on internet but found nothing...

What I need is that, to upload picture to database, but not blob, and show it in actual link like
www.website.com/pictures.php?id= <--and there a number, that shows a picture. And switching from newest pictures to oldest, like

echo '<a href="thisPage.php?id=' + ($id + 1) + '">Next</a>';

Yeah and if that id is deleted, than switch to next.. Pls somwhone help )

Member Avatar

This has been covered to death on this forum. Have a search here first. Also, there is a decent tutorial on Tizag's site: http://www.tizag.com/phpT/fileupload.php

The php manual: http://php.net/manual/en/function.move-uploaded-file.php

I've just constributed to a couple of threads yesterday with regard to storing fielnames in a DB, here's one: http://www.daniweb.com/web-development/php/threads/440315/gallery-image-delete-or-hide

Seriously, there's hell of a lot of info out there.

echo '<a href="thisPage.php?id=' + ($id + 1) + '">Next</a>';

That's a little bit dicey as you may delete an image from the DB, so the ids may not be sequential. Alternatively you could still use it like this:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.