Re: [PHP] Upload View Image : Database Thingy!!!!
Malte, Thanks a lot. I was going through the File Upload Functions in the manual and i think that's what they were talking about too. Now there's just one thing. I can run the upload scripts and get the image for display too. But like i mentioned, this is for a PenPal system, a database based PenPal sysem. Basically there has to be some connection between the record entry by the user and the image. Which also be required when this record is displayed, for the corresponding image to be displayed. How migh that work? Thanks again, T. Edison jr. --- Malte Fucks [EMAIL PROTECTED] wrote: I think the PHP image functions aren't what this guy needs... First thing : File Uploads You have to make a form, including an input type=file name=yourfile tag, which refers to a php script like... ? if($file) { if(@copy($yourfile,./$yourfile_name)) { echo $yourfile_name was uploaded succesfully; } else echo ERROR - UPLOAD ABORTED; } ? $yourfile_size includes the size of the file in bytes, use an if-statement to check if the picture-size fits your needs... $yourfile_type includes... guess what... the file type.. this should solve the upload problem... To control the size of an image is a matter of your HTML... do something like img src=yourimage width=40px height=40px. Its even possible to insert height and width-values in percent... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = Rahul S. Johari (Director) ** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : [EMAIL PROTECTED] Tel : 91-4546512/4522124 *** __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Upload View Image : Database Thingy!!!!
On Monday 21 January 2002 01:26, Thomas Edison Jr. wrote: Malte, Thanks a lot. I was going through the File Upload Functions in the manual and i think that's what they were talking about too. Now there's just one thing. I can run the upload scripts and get the image for display too. But like i mentioned, this is for a PenPal system, a database based PenPal sysem. Basically there has to be some connection between the record entry by the user and the image. Which also be required when this record is displayed, for the corresponding image to be displayed. How migh that work? The best thing to do would be to store the filename ( path if necessary) of the image in the corresponding record of the database. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Mandrell: You know what I think? Doctor: Ah, ah that's a catch question. With a brain your size you don't think, right? -- Dr. Who */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Upload View Image : Database Thingy!!!!
ooh... i dont know if i understood you correctly..but if i did, you simply have to insert the location of the file in the users tupel like.. UserIDNameBlaBlapicture 001 John ... ... ./images/john.jpg preferably i would only store the location when the user did upload an image with an update query, so when fetching the information from your database, you can check for empty location values... if you're working with mysql it would be like... while($my_array = mysql_fetch_array($result)) { echo Stuff about the User; if($my_array[location]) { echo img src=\$my_array[location]\ width=\100\ height=\100\; } else echo img src=\standard.jpg\ } but as i said, i dont know if i really understood your question.. (im german, you know *g*) - Original Message - From: Thomas Edison Jr. [EMAIL PROTECTED] To: Malte Fucks [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Sunday, January 20, 2002 6:26 PM Subject: Re: [PHP] Upload View Image : Database Thingy Malte, Thanks a lot. I was going through the File Upload Functions in the manual and i think that's what they were talking about too. Now there's just one thing. I can run the upload scripts and get the image for display too. But like i mentioned, this is for a PenPal system, a database based PenPal sysem. Basically there has to be some connection between the record entry by the user and the image. Which also be required when this record is displayed, for the corresponding image to be displayed. How migh that work? Thanks again, T. Edison jr. --- Malte Fucks [EMAIL PROTECTED] wrote: I think the PHP image functions aren't what this guy needs... First thing : File Uploads You have to make a form, including an input type=file name=yourfile tag, which refers to a php script like... ? if($file) { if(@copy($yourfile,./$yourfile_name)) { echo $yourfile_name was uploaded succesfully; } else echo ERROR - UPLOAD ABORTED; } ? $yourfile_size includes the size of the file in bytes, use an if-statement to check if the picture-size fits your needs... $yourfile_type includes... guess what... the file type.. this should solve the upload problem... To control the size of an image is a matter of your HTML... do something like img src=yourimage width=40px height=40px. Its even possible to insert height and width-values in percent... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = Rahul S. Johari (Director) ** Abraxas Technologies Inc. Homepage : http://www.abraxastech.com Email : [EMAIL PROTECTED] Tel : 91-4546512/4522124 *** __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]