Forum Moderators: coopster
Here's the catch. He knows basically NOTHING about computers. Sending email and browsing the web is about all he knows, and expecting him to be able to FTP images and edit html/php etc. is asking way too much.
I was thinking I'd use MySQL and PHP, and build an "Admin" section of the site for him where he would simply click a "Add Vehicle" button, enter the info, browse to the pic(s) and click submit. The page would write the corresponding entry into the database.
I have 2 questions:
1. Is this the correct way to go about this?
2. If yes, can someone point me to a good tutorial for uploading and storing images in MySQL?
Thanks,
Chris
As you said, you just need a password protected section on the site to make your changes and do your uploads.
You will store all of the car's info in the database and include an image upload script (do a search for PHP image upload script).
You won't actually be putting the image into the database (although this is possible) but rather uploading it to a directory on the server and just adding the location of the image to the database. eg: [yoursite.com...] etc.etc.
That way you can just use the images location the same way as any other piece of data from the database.
eg:
<h1><?php echo $carname;?></h1>
<img src="<?php echo $imageURL;?>" alt="car picture" />
Any help to you?
I'll do a search and see what I come up with on the script. Is it just as easy to write a script to delete the image from the directory?
Thanks for your help!
Chris
grab the full path to the image from the database
use unlink [php.net] to delete the image