[PHP] imagecopyresized problems
I'm trying to use imagecopyresized to generate a thumbnail image and then store the image in the proper place, but I'm running into some problems. I'm using the standard code: $src_img = imagecreatefromjpeg(../php/images/.$HTTP_POST_FILES['imagefile']['name']); if (imagesx($src_img)$max_width){ imagejpeg($src_img); exit(); } $dst_img = imagecreate(80,60); imagecopyresized($dst_img,$src_img,0,0,80,60,80,60,imagesx($src_img),imagesy ($src_img)); imagejpeg($dst_img); this will give me this output: 3ÿØÿàJFIFÿþCREATOR: gd-jpeg v2.0 (using IJG JPEG v62), default quality ÿÛC $.' ,#(7),01444'9=82.342ÿÛC 2!!22ÿÀ What I need is for imagecopyresized to make a new file that I can then give a new name and copy into the files that I want it to go to, such as.. copy ($dst_img, ../php/thumbs/.$thumb_name); If I try to this, I get the following error... Warning: Unable to open 'Resource id #4' for reading: No such file or directory in /u/php/uppic.php on line 55 (uppic.php is the name of the .php script this is in) Am I missing something obvious? Thanks, Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newbie question
How do I get PHP to automatically open another PHP page in a browser if a condition is met? I have a pull down HTML table that submits a form to a PHP script. That script then uses a little logic to figure out which web page to go to. I have 5 different pages, and each has different content. Right now, I can make it bring up links, but I can't figure a way out to make it automatically go to the proper web page. I know this has to be easy, but I can't find any info one it. Thanks for your help, Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] performing searches with random entries
I'm trying to take a variable in that would be usually 3 to 4 words (could be more or could be less). Right now, I'm exploding the variable and testing each individually, but this obviously is a pain with the more variables you get, and the result I get from the mysql search doesn't give me enough info to compare the outputs and then just give matching outputs. Am I looking at the result of the query wrong? Is there a function that does this? Any suggestions? Thanks, Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] passing checkbox info
I'm trying to use checkboxes to be able to delete information from my database. It's just not working right. I can't get the checkbox form to pass a variable that makes any sense to me, and I looked into the check box function, and it made less sense. The value passed back from the check boxes are always yes, but there is nothing to tell which box passed it back. Maybe I don't know enough about the check boxes in general. Any help is appreciated. I'm displaying the checkboxes as I display the data from the database. Can I tie in the checkboxes to one of the fields that i could then use to delete that entry? Thanks, Brian while ($row = mysql_fetch_row($result)) { echo tr align=left\n; { ? td input type = checkbox name = cbox[] value = yes ?php echo td; echo a href='$row[0]'img src='$row[0]' width='80' height='50' border='0'; echo td; echo $row[1]; echo td; echo $row[2]; echo td; echo $row[3]; echo td; echo $row[4]; echo td; echo $row[5]; echo td; echo $row[6]; echo td; echo $row[7]; echo td; echo $row[8]; echo /td\n; } echo /tr\n; } echo /table; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newbie php image importing problems
Hello, I got some great help from this newsgroup a few days ago, and I'm 90% complete with my project, but I have one snag. I'm building a web page that allows a business to import pictures of their products and then display them on their page along ith other information. My problem is getting in an image but displaying a thumbnail, and if clicked, the original image. The client only wants to load one image. I'm stuck at how to take the one image, copy it to the host server, and then display a thumbnail of the image. I can make the thumbnail linkable to the larger image, and I can display the original image on my home PC, but that's all local. Please help. Thanks, Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newbie PHP/HTML pull down menu problem
Hi, I want to pull information out of my mySQL database and use it as a pull down menu ona web page. There are two sets of information that I need, one is a color, and the other is the color_id, so I want to use it in the way below but without having to physically enter all the data. I'd like to use color_id as the value and the actual color name as the text in the pull down button. Can someone please help me on how to pass the info into a useable way to get the info out of PHP and into HTML? I've haad no problems going from HTML to PHP, but can't seem to grasp going the other way, especially with a list of things. I've been banging my head against this for two days, but something tells me it's extremely easy. Thanks, Brian form name=tester action=script.php method=get select name=color option value=1red option value=2blue option value=3black option value=4ice option value=5purple /select /form -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php