Irish SEO,  Marketing & Webmaster Discussion

 

Php image upload help required

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 ...


Go Back   Irish SEO, Marketing & Webmaster Discussion > Webmaster Help > Coding Help

Register Forum Rules FAQDonate Members List Calendar Search Today's Posts Mark Forums Read


Notices

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 17-04-2008, 01:30 PM
reverbstudios's Avatar
Frontpage User
Recent Blog: Road Office
 
Join Date: Apr 2008
Location: Leitrim, Ireland
Posts: 22
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
reverbstudios will become famous soon enough
Send a message via Yahoo to reverbstudios Send a message via Skype™ to reverbstudios
Default Php image upload help required

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:
  • Membership
  • Login
  • Profile Update
  • Add, Delete, Update Product
  • Show items from database
  • etc..
I've managed most of this already but 1 small thing has got the better of me - image upload.

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?
__________________
Leon - Web Design Leitrim :: My Blog :: FREE PC Support
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 17-04-2008, 01:39 PM
louie's Avatar
Senior Member
 
Join Date: Jan 2006
Location: Dublin, Ireland
Posts: 2,048
Nominated 5 Times in 3 Posts
Nominated TOTW/F/M Award(s): 1
louie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enough
Send a message via Yahoo to louie Send a message via Skype™ to louie
Default

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>
if you Google you get lots of samples:

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 17-04-2008, 01:50 PM
reverbstudios's Avatar
Frontpage User
Recent Blog: Road Office
 
Join Date: Apr 2008
Location: Leitrim, Ireland
Posts: 22
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
reverbstudios will become famous soon enough
Send a message via Yahoo to reverbstudios Send a message via Skype™ to reverbstudios
Default

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.
Attached Files
File Type: zip register.zip (2.8 KB, 3 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 17-04-2008, 05:43 PM
louie's Avatar
Senior Member
 
Join Date: Jan 2006
Location: Dublin, Ireland
Posts: 2,048
Nominated 5 Times in 3 Posts
Nominated TOTW/F/M Award(s): 1
louie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enough
Send a message via Yahoo to louie Send a message via Skype™ to louie
Default

PHP: move_uploaded_file - Manual

have a look at this php function
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 17-04-2008, 06:48 PM
reverbstudios's Avatar
Frontpage User
Recent Blog: Road Office
 
Join Date: Apr 2008
Location: Leitrim, Ireland
Posts: 22
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
reverbstudios will become famous soon enough
Send a message via Yahoo to reverbstudios Send a message via Skype™ to reverbstudios
Default

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..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 17-04-2008, 07:41 PM
louie's Avatar
Senior Member
 
Join Date: Jan 2006
Location: Dublin, Ireland
Posts: 2,048
Nominated 5 Times in 3 Posts
Nominated TOTW/F/M Award(s): 1
louie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enoughlouie will become famous soon enough
Send a message via Yahoo to louie Send a message via Skype™ to louie
Default

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 17-04-2008, 07:51 PM
reverbstudios's Avatar
Frontpage User
Recent Blog: Road Office
 
Join Date: Apr 2008
Location: Leitrim, Ireland
Posts: 22
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
reverbstudios will become famous soon enough
Send a message via Yahoo to reverbstudios Send a message via Skype™ to reverbstudios
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 17-04-2008, 08:05 PM
paul's Avatar
ninja SEO
Recent Blog: That SEO contest
 
Join Date: Dec 2006
Location: .de
Posts: 1,120
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
paul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud ofpaul has much to be proud of
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 17-04-2008, 08:53 PM
reverbstudios's Avatar
Frontpage User
Recent Blog: Road Office
 
Join Date: Apr 2008
Location: Leitrim, Ireland
Posts: 22
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
reverbstudios will become famous soon enough
Send a message via Yahoo to reverbstudios Send a message via Skype™ to reverbstudios
Default

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..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 21-04-2008, 01:47 PM
Frontpage User
 
Join Date: Oct 2006
Posts: 24
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
littleBird will become famous soon enough
Send a message via Skype™ to littleBird
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
image, php, required, upload

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

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


Sponsored links

Paid On Results


All times are GMT +1. The time now is 01:35 PM.


Powered by: vBulletin Version 3.7.3, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
Hosted in Ireland by Blacknight - Test your ISP |Irish Hosting Directory| Armchair.ie|Logo by Eden Web Design|Avatars by Afterglow |Latest Blog Entries | VPS HostingAd Management by RedTyger

Search Engine Friendly URLs by vBSEO 3.2.0