Re: Photos and logos in MySQL + PHP
| From: | Rick Widmer | Date: | Fri, 27 Dec 2002 02:21:54 +0000 |
| Subject: | Re: Photos and logos in MySQL + PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-129401@lists.php.net to get a copy of this message | ||
At 09:40 AM 12/27/02 +0800, Denis L. Menezes wrote:
Hello friends, I am making a website for our school. My requirement is that when any student searched for a particular club, the logo of the club abd the chairperson's phot should automatically be shown dynamically on the top of the page. For this to be done, I have three questions, if any of you could please help me : 1. Can I place these photos and logos in the MySQL database, If so, what field type?You can, but you don't want to. Just put the images in a directory and maybe the names in the database. In this case, I'd probably name the images based on the auto_increment field in the table they are related to.
2. How can I make the admin page upload the photos and logos to the database?http://www.php.net/manual/en/features.file-upload.php
3. How do I display these photos dynamically on the output webpage?First build the names in variables... $LogoName = "/images/logos/$ClubID.png"; $PhotoName = "/images/photos/$ClubID.png"; then later when you are painting the page. <IMG src="<?=$LogoName?>"> <IMG src="<?=$PhotoName?>"> Don't forget to include Width, Height and Alt tags in the <IMG> tags. Rick