Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › How to upload users pics, and then display?
New Posts  All Forums:Forum Nav:

How to upload users pics, and then display?

post #1 of 2
Thread Starter 
Right now I have a craigslist-esque style website (95% coded by someone else)

My partner has decided that he doesn't want to help anymore and I am more the business end, and know very little about web stuff.

I want to be able to add the ability to have the user upload a pic along with their information and have it display.

Right now everything goes into a MySQL database by PHP, and I would like to specify max photo size (both appearance and data size) so that if it is too big it isnt uploaded. And to force it to be a jpg.

I have no idea how to go about this. I googled a little bit and someone suggested just uploading the source of the pic to the database and then just do a <img src= whereever that is...> and have the user upload via a third party like photobucket or something.

I could do that but I think for my users they would be better off if they could just upload it along with the info as it might be too hard for them to upload a pic and input the URL of a uploaded pic.

Is there a tutorial or something out there on figuring out how to do this?


EDIT: While I'm trying to figure out how to load an actual pic, I've been trying to do the URL instead. I have the table field correct, and the insert part works. But displaying it is giving me a hard time.

I have tried variations of the following thinking it was a typo

Code:
Asking Price: $'.$Book['price'].'<br />
Description: '.$Book['sale_description'];
echo "<img src=\\"".$Book['sale_pic'] ."\\" alt=\\"\\" />";
but it gives me an error
Edited by ZTR1760 - 1/22/11 at 9:30pm
OC Beast
(13 items)
 
  
CPUMotherboardGraphicsRAM
E8500 @4GHZ Gigabyte P45 4850x2 2GB IT LIVES! 4GB 
Hard DriveOptical DriveOSMonitor
500AAKS+250external CD-DVD combo windows 7 ultimate x64 26" 
KeyboardPowerCaseMouse
MC$ wireless 650w corsair antec 900 Logitech battlefield 2142 G5 
  hide details  
Reply
OC Beast
(13 items)
 
  
CPUMotherboardGraphicsRAM
E8500 @4GHZ Gigabyte P45 4850x2 2GB IT LIVES! 4GB 
Hard DriveOptical DriveOSMonitor
500AAKS+250external CD-DVD combo windows 7 ultimate x64 26" 
KeyboardPowerCaseMouse
MC$ wireless 650w corsair antec 900 Logitech battlefield 2142 G5 
  hide details  
Reply
post #2 of 2
Could you paste the code from the opening php tag to the closing php tag? (from <?php all the way to ?>)

Also, pasting the error message can make things easier.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Web Coding
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Web Coding › How to upload users pics, and then display?