|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi all,
I have a couple of things I need to be able to do. I am building a site that sells scanners. It will be a database-driven site, and so I want to be able to add new products etc. through the web interface. I have created an admin section where I will be able to do just this - but I do not know how to upload an image to a directory, and insert the location into a mysql field, called image for example. There is more to it than this - It would be great if on uploading the image, the image is inserted into the folder (i.e. /img/scanners/) - and into the database (i.e. scanners.image) - and then the image is resized to 100px in width, and then that image is inserted into the folder (i.e. /img/thumbs/) and then into the database (scanners.thumbnails). I really dont think I can explain in much more detail - but all help / suggestions are greatly appreciated. Thanks for reading my huge request. D. |
|
|||
|
What are you using for your site? PHPWebsite? If so Photo Album will do much of that. Do you have access to PHPMyAdmin through your host?
|
|
|||
|
What shopping cart are you using? Most would actually do this already it would seem?
|
|
|||
|
PHP:
$file = $_FILES['filePic']; move_uploaded_file($file['tmp_name'], $fileName); HTML: <form id="upload" action="test.php" method="post" name="upload" enctype="multipart/form-data"> <input type="file" name="filePic" size="40" /> </form> In the PHP you need to set $fileName to the name of the file you want the image stored as, you can also store $fileName in the database. If you want to resize/check the image format being uploaded then look up the following in the PHP manual: getimagesize ImageCreateFromJPEG ImageJPEG ImageCopyResampled There are other commands but those should get you started :) |
|
|||
|
I use Cube Cart here and I think it would do what you want.
|
|
|||
|
Sorry Darren, I missed that part. :) - take a look at this code from Dave (sonicgroup) - it might help you out as well.
|
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |