PHP Help!
- Started
- Last post
- 17 Responses
- Rinse
Right here is the prob:
Got a tasty little php/MySQL content management system - all works lovely and that...
Right but want to add a picture upload facility to this system.
When the user fills out the form to upload content they can upload a picture and then MySQL stores it and the php echo's it out on the relevant page.
Been trying for ages and just can't get it work//;
Added an upload script and read up on the upload function at the php manual but still no joy...Don't know what the monkey harris is up with it...!
Has anybody got any experience in creating a similar system ?
Anyone got any code snippets that might sort it ?Any help mucho appreciatated...
- unfittoprint0
Ít will store the jpeg in some folder and save the path in a database field, that's the usual procedure. Do you have save/delete previleges for that folder?
- Rinse0
Hello!
Well i think we got save/delete privelages for any folder thats placed inside the htdocs.
Thanks for replying...
Any more help that's sound.
- unfittoprint0
Does it print/echo any error message? If not, you should enable roor display in PHP configuration, it should be easier to track where the 'bug' is...
- Rinse0
nah maybe i should have explained it better unfit....
we have the whole content management system minus the picture bit...........
whenever i tried to add a picture upload script - I f^cked it right up..... big style
so the question is really anyone know a decent function of how to upload an image with php - store it in mySQL and then echo it out on a page cleanly ?
like i said the rest of it is no problem - just canna sort the jpeg upload bit...
any scripts/tips/tutorials welcome... thanks in advance.
- Rinse0
bump
- Rinse0
f^ckin bump >>//
any help well appreciatated = this is urgent style...
been trying to figure it out but no joy...
just need a script to upload an image using php and store it in mysql and then echo it out on another page..............
- georgietexan0
you should but jpgs into mysql but rather a folder on your server then have mysql store the link to the image.
- georgietexan0
meant to say shouldn't put images into mysql
- Rinse0
thx then - had a look at the code u sent.....
so basically need an image upload script that works... and the code to put the location into mysql.... ?
- enobrev0
i agree... there's actually no real benefit to storing images in mysql, and it can even hurt a bit as it makes your db larger, which, in turn may slow you down.
The best way tis to upload to a directory, and save the filename / directory location to the db. That will keep your queries quick, and keep your images on their own as files.
- Rinse0
ok thanks yeah seen totally and understand all that....
anybody got any code they could share just the stuff to upload and then store the location in mysql would be nice ?
this is doing me over.... sorry to be lazy monkey style but if anyone has some examples/code that would be sound.
thx again.
- enobrev0
don't mean to hit you with an RTFM, but here's a realyl good resource for file uploads:
http://www.php.net/features.file…
if i were to bang out a solution for you, i'd probably have that open while throwing it together
- Rinse0
RTFM ?
well thx anyway - yeah i have looked at that chapter mate - it was the first place to look when i had the problems....
maybe i am just a a divvy style and i got it locked or something ? ( : -
seriosuly i have been working on this for too long and it's like doing over me over big style...
i cant sort it out by coding myself so the php manual is no good - i have tried everything - i just need a quick and simple solution so i can finish this project off...
if somebody has a real simple and can help out with a solution, let me know pls.... thx once again.
- Rinse0
sorry typo central in that last msg - (well tired from looking at code)
basically ignore all that last msg if anyone can 'really' help out that would be excellent
- schjetne0
http://php.resourceindex.com/Com…
Though I recommend php.net, and writing it yourself, as that way you have full control over your code, and understand how it is built.
- lostnation0
make sure this param is in your tag:
enctype="multipart/form-data"
ima send you a file in a sec
- Rinse0
thx for all that help people....
thanks enobrev for the php manual link man... just real tired, to tired to try and code it myself...