Re: [PHP] Variables from the Form wouldn't transfer to my process page
Hi Jason Man you are great, well indeed I stumbled on my stupidity by putting the hidden name instead of making it unique I've rectified it. The reason for passing this variable to the next page is the cats table is only needed in the first form and the name of the cat is just printed on the following page untill the final result page. I could have looked it up again on the table on my next form part but thinking of saving the resource I thought of going for the option of passing the variable. Well I managed to do by passing the variable enclosing it in the Php tag like this soloution found on the Forum: at least t is getting transferred but I have the problem like you mentioned, it is only showing the last element on the table no matter what is selected on the drop down menu. I didn't know that I could pass two values together inside the option tag like you've shown . If I choose this would I need to do a while loop to get the catname or will it find it along the catid. Let me try without the while loop. Thanks again Jason. gd "Jason Wong" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Sunday 16 February 2003 09:21, Geckodeep wrote: > > > My html looks ok. > > Are you sure? > > > The TEXT variable is $catname and the $rubriqueid is a mistake it is > > actually $catid but it is not that giving the problem. It is an error from > > my part when I posted it. > > How are you passing $catname onto the next page? I presume via the hidden > input element? AFAICS from your code (and you can spot this straight away > from the HTML source) you only have a hidden input element for the last value > of $catname retrieved from the DB. Thus you need to move them inside the > while-loop. However your hidden input elements are all named 'hidden' which > isn't very helpful -- give them unique names. > > The real question is why /are/ you passing $catname to the next page? $catid > is the unique identifier so why do you need $catname on the next page? You > can always lookup $catname from the DB on the next page if you need it. If > you don't want to look it up again then I suggest putting both $catid and > $catname into the option value ... > > $catname > > ... then extract the two parts on the following page. > > Depending on what characters gets stored in $catname you may need to run it > through htmlspecialchars(). > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > -- > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > -- > /* > Q: How did you get into artificial intelligence? > A: Seemed logical -- I didn't have any real intelligence. > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Fwd: Delivery Status Notification (Failure)]
Me too but it sounds and looks like a virus! Anyway I deleted without opening it. "Lucas Lain" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > me too... > > John Nichel wrote: > > >Could one of the admins of this list take this email address off? > >Everytime I send an email to the list, I get one of these. Thanks. > > > > Original Message > >Subject: Delivery Status Notification (Failure) > >Date: Fri, 14 Feb 2003 08:01:31 +0100 > >From: [EMAIL PROTECTED] > >To: [EMAIL PROTECTED] > > > >This is an automatically generated Delivery Status Notification. > > > >Delivery to the following recipients failed. > > > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > >Reporting-MTA: dns;mbla01.belair.nl > >Received-From-MTA: dns;mbla01.belair.nl > >Arrival-Date: Fri, 14 Feb 2003 08:01:30 ? > > > >Final-Recipient: rfc822;[EMAIL PROTECTED] > >Action: failed > >Status: 5.1.1 > > > > > > > > > > Subject: > > > > Re: [PHP] Simple PHP script > > From: > > > > John Nichel <[EMAIL PROTECTED]> > > Date: > > > > Thu, 13 Feb 2003 15:13:25 -0600 > > To: > > > > "Poon, Kelvin (Infomart)" <[EMAIL PROTECTED]> > > > > > > Sigh > > > > if ( $_POST['submit1'] ) { > > echo ( "Hello $_POST['vname']" ); > > } > > > > http://www.php.net/manual/en/language.variables.scope.php > > http://www.php.net/manual/en/language.variables.external.php > > > > Poon, Kelvin (Infomart) wrote: > > > >> Hi, > >> > >> I am new to PHP and had just written a simple php script to get things > >> started. I have the following code: > >> > >> > >> > >> > >> >> if($submit1) { > >> echo "hello $vname"; > >> } else { > >> ?> > >> > >> > >> Input yourname > >> > >> > >> > >> >> } > >> ?> > >> > >> > >> > >> So this page is suppose to display a input box and a submit button > >> and once > >> you enter ur name and press the button, it should show Hello [ur > >> name] and > >> the input box at the bottom of it and the button below and the process > >> continue. > >> > >> I tried running it and inputted some text and pressed the button, and > >> the > >> Hello [ur name] didn't show up, it just display an input box and the > >> submit > >> button. > >> > >> Can someone please help me? > >> > >> Thanks a lot > >> > >> Kelvin > >> > >> > > > > > > > > -- > Lucas Lain > [EMAIL PROTECTED] > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variables from the Form wouldn't transfer to my process page
hi Jason The TEXT variable is $catname and the $rubriqueid is a mistake it is actually $catid but it is not that giving the problem. It is an error from my part when I posted it. My html looks ok. I should tell you though that this page is on the admin section which is under a login session script I use, which was recommended by some one on the forum. The script is in the include folder and the file is called access.php and I include this file in every Php files found in the admin folder. So if I have to think of using the session for my problem in passing the variables, can I use session_register("$catid") in the forum page to register and start new session or should I include it in the login script where there is already password, userid and the user name registered. Is it possible to start a new session for these two form pages and register the variables, will it co-habit with the existing session? I am pretty confused with session; I've checked the Php manual and couldn't really get the gist of it. Thanks for any help in advance. gd "Jason Wong" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Sunday 16 February 2003 03:37, Geckodeep wrote: > > I have these forms with one having pull down menu having data coming from a > > table which is working and I have set two variables one for ID and the > > other for the TEXT. > > The problem that I am facing is that when the form is submitted the ID > > variable is well taken into consideration and can see the value on the > > process page which is then inserted into the table. The TEXT variable which > > I set apparently for some reason it wouldn't show up. > > Which is the TEXT variable that you're referring to? And where does > $rubriqueid come from? > > [snip] > > > Her is the part of the code from the first Form submit page > > > action="../form_pro.php"> > > > > Please choose your category > > > while ($row = mysql_fetch_array($result_cat)){ > > $catid = $row["cat_id"]; > > $catname = $row["cat_text"]; > > echo("$catname\n"); > > } > > ?> > > > > html code > > > > > > > > > > > > > > code on the Form process page > > > > Catagory > > Have you looked at the HTML source to see whether it looks OK? > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > -- > Search the list archives before you post > http://marc.theaimsgroup.com/?l=php-general > -- > /* > I don't have any solution but I certainly admire the problem. > -- Ashleigh Brilliant > */ > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variables from the Form wouldn't transfer to my process page
I have these forms with one having pull down menu having data coming from a table which is working and I have set two variables one for ID and the other for the TEXT. The problem that I am facing is that when the form is submitted the ID variable is well taken into consideration and can see the value on the process page which is then inserted into the table. The TEXT variable which I set apparently for some reason it wouldn't show up. I've tried using the hidden field option, still it wouldn't show. The funny thing is the variable ID is getting through but not the variable TEXT. Another thing is My forms are split into 3 part the first part Form is submitted to a form process page that contains two other forms which works in turn(when the second form submits the third form shows up), the forms are all working fine but I wish to collect the results of successive form validation to show the results to the user. The technique I've adapted is to set each result to different variables and pass these variables as hidden field even that is not working. Forms are all validating well as I can see the results through the upoaded files on the server. Can any one look into my code an see what's wrong with it? Her is the part of the code from the first Form submit page Please choose your category $catname\n"); } ?> html code code on the Form process page Catagory Thanks in advance. GD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help needed for submitting multiple files!
I am building a page that submits an article with 9 jpgs images of 45 to 60ko in size. I got it working with no problems for two to three files, until when I tested with all nine images I saw the real problem, that wouldn't uploaded it. When I consulted with my service provider they said they have put a limit to upload of 200ko per submit. Here I am stuck with no real solution to this problem, except that I have this idea of submitting the article by breaking it down in 3 steps and by presenting three different forms which should be ok, but what will I do if the person wanted to edit the article after having submitted e.g. to modify the article later on. How will I go fetching the article and presenting it in 3 steps, but this time for update and taking it into consideration of the images stored in the file and referenced in the db. I am opened to all advice and suggestion. Thanks again. GD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trouble with resizing image!!
thanks Marek, it never crossed my mind about time, i was using it to have a unque name to the uploaded file. I'll try the script without the time and see. Thanks "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > At first glance I noticed you use time() all over your script and expect > it to > be always the same. But the function returns current time, so it > changes! Use > > $n_image1 = time().$_FILES['image1']['name']; > > and remove all time() functions > > > > > Geckodeep wrote: > > >I am having trouble in resizing the image. What I am trying to do is letting > >people upload images of any dimension, and with the aid of my script after > >having uploaded, it renames the file, from this new file I'll get the size > >and resize it to predefined format 360x240 or 240x360 and this is the normal > >presentation image (image1_big). From this image I am getting a thumb nail > >format of 104x70 or 70x104 ( image1_thumb ). > > > >When I run the script the whole page is filled with characters, I know the > >first part of the script upload is working as I can see the file on the > >server. The script resizing apparently is not functioning. > > > >I ve checked the Php config at my service provider with the aid of Phpinfo() > >and I can see the GD version 2.0 or higher enabled, so that question is > >cleared. > > > >I am pretty sure the error is from my sloppy code. > > > > > > > >I'd appreciate if some one could look into my code and see where the bug is. > > > > > > > > > > >$uploaddir='../images/repor_images/'; // Uploaded images directory on the > >server > > > >$n_image1 = $_FILES['image1']['name'];// New file before renaming it. > > > > > > > >if // Image1 > > > >(move_uploaded_file($_FILES['image1']['tmp_name'], > >$uploaddir.$n_image1)) { > > > >rename($uploaddir .$n_image1, $uploaddir.time().$n_image1); // > >Renames the file in the server. > > > > $size = GetImageSize($uploaddir.time().$n_image1); > > > > $width = $size[0]; > > > > $height = $size[1]; > > > > if ($heigth<$width){ > > > > $newwidth = '360'; > > > > $newheight = '240'; > > > > header ("Content-type: image/jpeg"); > > > > $src = imagecreatefromjpeg($uploaddir.time().$n_image1); > > > > $image1_big = imagecreate($newwidth,$newheight); > > > > > >imagecopyresized($image1_big,$src,0,0,0,0,$newwidth,$newheight,$width,$heig h > >t); > > > > imagejpeg($image1_big); // New normal sized image > > > > imagedestroy($src);// deletes the initial image > > > > $size_big = GetImageSize($uploaddir.$image1_big); > > > > $width_big = $size[0]; > > > > $height_big = $size[1]; > > > > $newwidth_thumb = '104'; > > > > $newheight_thumb = '70'; > > > > $src_thumb = imagecreatefromjpeg($uploaddir.$image1_big); > > > > $image1_thumb = imagecreate($newwidth_thumb,$newheight_thumb); > > > > > >imagecopyresized($image1_thumb,$src_thumb,0,0,0,0,$newwidth_thumb,$newheigh t > >_thumb,$width_big,$heigh > >t_big); > > > > imagejpeg("tn_".$image1_thumb); // New thumbnail > > > > } > > > > elseif ($heigth>$width){ > > > > $newwidth = '360'; > > > > $newheight = '240'; > > > > header ("Content-type: image/jpeg"); > > > > $src = imagecreatefromjpeg($uploaddir.time().$n_image1); > > > > $image1_big = imagecreate($newwidth,$newheight); > > > > > >imagecopyresized($image1_big,$src,0,0,0,0,$newwidth,$newheight,$width,$heig h > >t); > > > > imagejpeg($image1_big); // New normal sized image > > > > imagedestroy($src);// deletes the initial image > > > > $size_big = GetImageSize($uploaddir.$image1_big); > > > > $width_big = $size[0]; > > > > $height_big = $size[1]; > > > > $newwidth_thumb = '70'; > > > >
[PHP] Trouble with resizing image!!
I am having trouble in resizing the image. What I am trying to do is letting people upload images of any dimension, and with the aid of my script after having uploaded, it renames the file, from this new file I'll get the size and resize it to predefined format 360x240 or 240x360 and this is the normal presentation image (image1_big). From this image I am getting a thumb nail format of 104x70 or 70x104 ( image1_thumb ). When I run the script the whole page is filled with characters, I know the first part of the script upload is working as I can see the file on the server. The script resizing apparently is not functioning. I ve checked the Php config at my service provider with the aid of Phpinfo() and I can see the GD version 2.0 or higher enabled, so that question is cleared. I am pretty sure the error is from my sloppy code. I'd appreciate if some one could look into my code and see where the bug is. $width){ $newwidth = '360'; $newheight = '240'; header ("Content-type: image/jpeg"); $src = imagecreatefromjpeg($uploaddir.time().$n_image1); $image1_big = imagecreate($newwidth,$newheight); imagecopyresized($image1_big,$src,0,0,0,0,$newwidth,$newheight,$width,$heigh t); imagejpeg($image1_big); // New normal sized image imagedestroy($src);// deletes the initial image $size_big = GetImageSize($uploaddir.$image1_big); $width_big = $size[0]; $height_big = $size[1]; $newwidth_thumb = '70'; $newheight_thumb = '104'; $src_thumb = imagecreatefromjpeg($uploaddir.$image1_big); $image1_thumb = imagecreate($newwidth_thumb,$newheight_thumb); imagecopyresized($image1_thumb,$src_thumb,0,0,0,0,$newwidth_thumb,$newheight _thumb,$width_big,$heigh t_big); imagejpeg("tn_".$image1_thumb); // New thumbnail } print "$image1_big. File transfered. \n"; print "$image1_thumb. File transfered. \n"; $image1_big_url = time().$image1_big;// Sets the name of the file to be Copied into the database. $image1_thumb_url = time()."tn_".$image1_thumb;// Sets the name of the file to be Copied into the database. } else { print "File failed to transfer!\n"; $image1_url = ""; exit(); } ?> Thanks in advance for the time and humble helping hand. GD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problems in uploading files due to upload_max_filesize
I have a problem with transfer of Image files to the server. I've checked with the aid of phpinfo on my service provider's server and this is what I found upload_max_filesize 200K. My page needs to upload 9 images simultaneously each one of them having the size between 45 kb to 50kb, Can any one help me with this? Thanks again. GD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Solutions need for resizing images (Thumbnail) on the fly..
Thanks goetz for your time, that's very kind of you to write the code. if i have any more questions i shall post it under new thread. "Goetz Lohmann" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Geckodeep schrieb: > > Thanks Goetz > > > > But how can I apply this having: > > > > Path to the folder is $folder='images/repor_images'; // path to the > > image. > > > > My 9image variables are $image1, $image2, $image3,. and the code to call the > > image > > > > > src=\"$folder/$image1\">" ?> > > > > Thanks again. > > I should do coding the whole page I gues ;-) > > First of all some things to mention about: > 1. Better store only filenames in the database and leave >the images in the directory, cause you have to copy then >to a location anyway to get it by an browser > 2. Use an array of $image[] instead of numbering them >like $image1, $image2, ... (you have to use eval to >work with the numbers or have to write the code more >than once !) > > Ok here it goes: > >// guess you have JPEG images > // -- > $nr = 1;// start numbering your images > $maxsize = 150; // maximum size in one direction > // --- > while($nr <= 9) { > $img = @imagecreatefromjpeg ("$folder/$image[$nr]"); // try to open > if (!$im) { > echo "ERROR loading image $folder/$image[$nr] "; > exit 1; > } else { > $imagehw = GetImageSize($img); > $w = $imagehw; // width > $h = $imagehw; // height > // prevent division by zero > if (($h ==0) || ($w==0)) exit; > // get new size according to max size > if ($h>$w) { > $new_h = $maxsize; // new height > $new_w = (int) (($maxsize * $w) / $h); // casting to int ! > } else { > $new_w = $maxsize; // new width > $new_h = (int) (($maxsize * $h) / $w); // casting to int ! > } > // build dummy image > $thumb = imagecreate ($new_w, $new_h); > // resize old image > ImageCopyResized($thumb,$img,0,0,0,0,$new_w,$new_h,$w,$h); > // maybe use tempname() to generate a temporary file name or > // create name of thumbnail file like: *.jpg ==> *.png > $tumbnail=substr($image[$nr],0,strrpos($image[$nr],".")).".png"; > // save png image to same directory as jpg > @imagepng ($thumb,"$folder/$tumbnail"); // hope we could write > // leave the temporary data ... > ImageDestroy($img); > ImageDestroy($thumb); > // finished work > // --- > // show image > echo ""heigth=\"$new_h\" src=\"$folder/$tumbnail\" >"; > } > $nr++; // next image > } > ?> > > maybe there might better ways but thats just a fast hack to work ... > > > > -- > @ Goetz Lohmann, Germany | Web-Developer & Sys-Admin > \/ -- > () He's the fellow that people wonder what he does and > || why the company needs him, until he goes on vacation. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Solutions need for resizing images (Thumbnail) on the fly..
Thanks Goetz But how can I apply this having: Path to the folder is $folder='images/repor_images'; // path to the image. My 9image variables are $image1, $image2, $image3,. and the code to call the image " ?> Thanks again. "Goetz Lohmann" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Geckodeep schrieb: > > Hi there I have this problem wondering how to define the size of my images. > > I have this page that has 9 images coming from the database. These images > > are uploaded into a folder and the names are referenced in the DB. > > I pull the image through these tags > > > src=\"$folder/$image1\">" ?> > > and it's ok if the images are rectangular with size 104 x 70,but how will I > > reduce the size of the image having the opposite size 70 x 104 rectangular > > but shorter in length. > > > > Hard coding the size is not the solution for me as these images are coming > > straight from the DB with their actual size. > > > > Having decided the sizes to be either 104 x 70 or 70 x 104, now the trouble > > is how to assignee these values dynamically judging the format of the image. > > > > I've seen different script in resizing the images on the fly but couldn't > > adapt to my needs, as I've 9 image variables ($image1, $image2,..)already > > assigned and I am looking for scripts or solutions in resizing the images on > > the fly by assigning my 9image variables to the resize function. > > > > Thanks once again. > > its just mathematic ;-) > > // get size > $imagehw = GetImageSize($img0); > $w = $imagehw[0]; // width > $h = $imagehw[1]; // height > $maxsize = 150; // maximum size in one direction > // prevent division by zero > if ($height==0 || $width==0) exit; > // get new size according to max size > if ($height>$width) { > $new_h = $maxsize; // new height > $new_w = (int) (($maxsize * $width) / $height); // casting to int ! > } else { > $new_w = $maxsize; // new width > $new_h = (int) (($maxsize * $height) / $width); // casting to int ! > } > // resize image > ImageCopyResized($thumb,$img,0,0,0,0,$new_w,$new_h,$w,$h); > // new thumbnail is in $thumb > ?> > > > -- > @ Goetz Lohmann, Germany | Web-Developer & Sys-Admin > \/ -- > () He's the fellow that people wonder what he does and > || why the company needs him, until he goes on vacation. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Solutions need for resizing images (Thumbnail) on the fly..
Hi there I have this problem wondering how to define the size of my images. I have this page that has 9 images coming from the database. These images are uploaded into a folder and the names are referenced in the DB. I pull the image through these tags " ?> and it's ok if the images are rectangular with size 104 x 70,but how will I reduce the size of the image having the opposite size 70 x 104 rectangular but shorter in length. Hard coding the size is not the solution for me as these images are coming straight from the DB with their actual size. Having decided the sizes to be either 104 x 70 or 70 x 104, now the trouble is how to assignee these values dynamically judging the format of the image. I've seen different script in resizing the images on the fly but couldn't adapt to my needs, as I've 9 image variables ($image1, $image2,..)already assigned and I am looking for scripts or solutions in resizing the images on the fly by assigning my 9image variables to the resize function. Thanks once again. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Designing My First Content Management System
I my self is in the same situation I've started of with a great book http://www.essential-series.com/essential_php.htm which should give you some idea how to begin and the other one i bought which i am still waiting is "Building a Database-Driven Web Site Using PHP and MySql" by Kevin Yank. with these two books you should get head started in CMS. Good luck. geckodeep "Chris Shiflett" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > --- Guru Geek <[EMAIL PROTECTED]> wrote: > > Does anyone out there have any working examples > > of a PHP based CMS? > > http://freshmeat.net/search/?q=PHP+CMS§ion=projects > > Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php