This is a discussion on Php image upload help required within the Coding Help forums, part of the Webmaster Help category; I'm new enough to php coding and I'm trying to build a basic php driven template site from which I ...
| |||||||
| Register | Forum Rules | FAQ | Donate | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||||
| I'm new enough to php coding and I'm trying to build a basic php driven template site from which I can take code snippets for other projects/sites. This template site will have all of the most basic dynamic functions including:
I wish to include an image upload field in both my existing signup and profile update forms which grabs an image off the pc and stores it in the database then shows it in the profile. Anybody any ideas or code snippets - I specifically need a form with image upload included and not just an image upload script as I wouldn't know how to add that to my form? |
| |||||
| It's very simple. A very important thing you need to do is setting the form as "enctype="multipart/form-data" Code: <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST" enctype="multipart/form-data"> other fields here ... then the upload form field Upload Image: <input type="file" name="imgfile"> </form> php image upload - Google Search
__________________ :. Web Design & Development Web Design Ireland :. Search Engines Optimization Search Engines Optimization :. Directory Submission Directory Submission :. News & Press Release Ireland GiveItSocks.com :. Used Cars Ireland, Car Parts & Car Audio Cars For Sale, Car Parts & Accessories :. I Have 2 Find It Directory SEF Directory |
| |||||
| I've seen that example before many times and done lots of googles but what I really need to know is the bit where you tell the image where to go (folder) and how to add it to the database etc..my form file is attached so you know what I mean. |
| |||||
| |
| |||||
| Thanks, thats kinda double dutch to me though..I can't write php code from scratch yet, most of the code in that file attached was borrowed from other applications! If you have a working form code doing the same thing as I'm trying that would be perfect. Then I could substitute the variables to my own etc.. |
| |||||
| My code is broken apart in several function-pages and I am afraid if I'll give it to you, you wouldn't know what to do with it. Why don't you try to do something yourself, than look for help here to get the code right. |
| |||||
| Well I'm good at figuring out existing code. Wouldn't have a clue where to start with writing it though. Anyway, the code I attached is my effort so far so if anyone knows how to get an image upload into that I'd be grateful. Its too long to post the code naked here |
| |||||
| have you looked at examples like this : PHP: Upload and Resize an Image - web.blazonry
__________________ my sites : irish poker / irish jobs / seo faq / advertise jobs free / green card / skiing |
| |||||
| I think I have followed something like that but got errors and hadn't a clue where to go! I'll give that one a bash thanx.. |
| ||||
| I hope reverbstudios has sorted out their upload problems but I am having some of my own at the moment. I am very familiar with PHP coding and have created many different upload functions before. one I am currently working on is embedded within a Wordpress website. For some reason, code that I have successfully used on other none-wordpress sites refuses to work now. It keeps giving me the error on move_upload_file of "failed to open stream: HTTP wrapper does not support writeable connections." Has anybody experienced this before and can you shed some light on how I can resolve this?
__________________ CSSDiscussion - forum for newbies & experts alike |
| Tags |
| image, php, required, upload |
| Thread Tools | |
| Display Modes | |
|
|
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| PHP Image Upload Issue | ziycon | Coding Help | 1 | 20-03-2008 02:31 AM |
| Asp VB Image Gallery/File Upload | matt-dublin | Coding Help | 5 | 17-09-2007 09:00 PM |
| php image display problem | david4ie | Coding Help | 2 | 08-05-2007 11:06 PM |
| Php Jedi(s) Required | blacknight | Marketplace Requests | 9 | 25-01-2007 08:51 AM |
| ||||||||
| | ![]() | |||||||