[PHP] File Uploads Security Fix
Hello, after copy do_download.php to php4.0.6/main what I have to do? T.Y. -- Best Regards -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE:mad .... again jpeg files...
Valentim said: Try to specify absolute path to the jpeg - possible php do not look up for jpeg in current folder... (or use './image.jpg')- but the image.jpg created had file size=0 Johan Holst Nielsen said: Try to remove all html, and instead make a ImageJPEG($img); You should then only get the JPEG file? You set a header, and the browser doesn't understand the HTML... - yes I tried . Jack Dempsey said: also, are you sure both versions of php were compiled the same way with the same options and support? --- well , in my machine configure command ( where jpeg support dont work) I have : './configure' '--with-mysql' '--with-apache=/usr/src/packages/SOURCES/apache_1.3.9/' '--with-zlib-dir=/usr/src/packages/SOURCES/zlib/' '--with-png-dir=/usr/src/packages/SOURCES/libpng/' '--with-jpeg-dir=/usr/src/packages/SOURCES/jpeg-6b/' '--with-gd=/usr/src/packages/SOURCES/gd' '--enable-track-vars' in other machine ( where jpeg works fine ) I have : './configure' '--with-mysql=/usr/local/mysql/' '--with-gd=/share/tmp/gd-1.8.4/' '--with-zlib-dir=/usr/local/lib/' '--with-jpeg-dir=/share/tmp/jpeg-6b/' '--with-png-dir=/share/tmp/libpng-1.0.11/' '--enable-track-vars' '--with-apache=/usr/src/apache_1.3.19/' its amazing.. thanks the effort , time, calm, help, that you had with me . if someone have more ideas, please, I start being crazy ( ... yes, yes, I'm crazy since I was born ) T.Y. Hello all, I still having problem when use jpeg functions... I got: testout.jpg is not a valid JPEG file in .. , with follow code: Header(Content-type: image/jpeg); $img=ImageCreateFromJPEG(testout.jpg); ImageJPEG($img,a.jpg); ImageDestroy($img); testout.jpg was one image created by jpeg-6b after make test, I see image directly in browser (machine_name/directory/where/have/code/testout.jpg) the image, my phpinfo gives me information that gd had support for jpeg enabled I try with other *.jpeg files I try this code: Header(Content-type: image/jpeg); $im=ImageCreate(400,200); $bcg = ImageColorAllocate($im,240,240,240); $prt = ImageColorAllocate($im,0,0,0); $rd = ImageColorAllocate($im,255,0,0); ImageFill($im,400,200,$bcg); ImageLine($im,110,85,280,85,$rd); ImageString($im,5,130,90,--- OK ---,$prt); ImageLine($im,110,110,280,110,$rd); ImageJPEG($im,a.jpg); ImageDestroy($im); and the result was an empty a.jpg file . a. If anyone has any idea ... I already dont know what to do T.Y. -- Best Regards Miguel Joaquim Rodrigues Loureiro -- 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] problem with ImageCreateJPEG ...
Hello , sorry for taking your time, but I still dont understand why I got errors with pjeg... I use the following code on other machine with jpeg support to , and it works, while in my machine I got an empty jpeg file ? Header(Content-type: image/jpeg); $im=ImageCreate(400,200); $bcg = ImageColorAllocate($im,240,240,240); $prt = ImageColorAllocate($im,0,0,0); $rd = ImageColorAllocate($im,255,0,0); ImageFill($im,400,200,$bcg); ImageLine($im,110,85,280,85,$rd); ImageString($im,5,130,90,--- OK ---,$prt); ImageLine($im,110,110,280,110,$rd); ImageJPEG($im,a.jpg); ? html body img src=a.jpg /body /html Is it possible that, even when see result of phpinfo(); and see that I have jpeg support , jpeg library isnt well compiled or gd?? if I use PNG instead I got no problems Jim wrote: It is difficult to know where your problem is without more information. It would appear that your jpeg file is not valid. Try another .jpg file. Post the problem code, too. Hello all, anyone can help me in line command to configure php : './configure' '--with-mysql' '--with-apache=/usr/src/packages/SOURCES/apache_1.3.9/' '--with-zlib-dir=/usr/src/packages/SOURCES/zlib/' '--with-png-dir=/usr/src/packages/SOURCES/libpng/' '--with-jpeg-dir=/usr/src/packages/SOURCES/jpeg-6b/' '--with-gd=/usr/src/packages/SOURCES/gd' '--enable-track-vars' in result of phpinfo() : gd GD Support enabled GD Version 1.6.2 or higher JPG Support enabled PNG Support enabled WBMP Support enabled zlib ZLib Support enabled 'zlib:' fopen wrapper enabled Compiled Version 1.1.3 Linked Version 1.1.3 ,but when use ImageCreateFromJPEG: br bWarning/b: imagecreatefromjpeg: .../testout.jpg' is not a valid JPEG file in b../a.php/b on line b4/bbr br bWarning/b: Supplied argument is not a valid Image resource in b../a.php/b on line b14 = ImageJPEG() what is my problem -- Best Regards Miguel Joaquim Rodrigues Loureiro -- 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] -- Jim Musil - Multimedia Programmer Nettmedia - 212-629-0004 [EMAIL PROTECTED] -- Best Regards Miguel Joaquim Rodrigues Loureiro -- 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] mad .... again jpeg files...
Hello all, I still having problem when use jpeg functions... I got: testout.jpg is not a valid JPEG file in .. , with follow code: Header(Content-type: image/jpeg); $img=ImageCreateFromJPEG(testout.jpg); ImageJPEG($img,a.jpg); ImageDestroy($img); testout.jpg was one image created by jpeg-6b after make test, I see image directly in browser (machine_name/directory/where/have/code/testout.jpg) the image, my phpinfo gives me information that gd had support for jpeg enabled I try with other *.jpeg files I try this code: Header(Content-type: image/jpeg); $im=ImageCreate(400,200); $bcg = ImageColorAllocate($im,240,240,240); $prt = ImageColorAllocate($im,0,0,0); $rd = ImageColorAllocate($im,255,0,0); ImageFill($im,400,200,$bcg); ImageLine($im,110,85,280,85,$rd); ImageString($im,5,130,90,--- OK ---,$prt); ImageLine($im,110,110,280,110,$rd); ImageJPEG($im,a.jpg); ImageDestroy($im); and the result was an empty a.jpg file . a. If anyone has any idea ... I already dont know what to do T.Y. -- Best Regards Miguel Joaquim Rodrigues Loureiro -- 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] problem with ImageCreateJPEG ...
Hello all, anyone can help me in line command to configure php : './configure' '--with-mysql' '--with-apache=/usr/src/packages/SOURCES/apache_1.3.9/' '--with-zlib-dir=/usr/src/packages/SOURCES/zlib/' '--with-png-dir=/usr/src/packages/SOURCES/libpng/' '--with-jpeg-dir=/usr/src/packages/SOURCES/jpeg-6b/' '--with-gd=/usr/src/packages/SOURCES/gd' '--enable-track-vars' in result of phpinfo() : gd GD Support enabled GD Version 1.6.2 or higher JPG Support enabled PNG Support enabled WBMP Support enabled zlib ZLib Support enabled 'zlib:' fopen wrapper enabled Compiled Version 1.1.3 Linked Version 1.1.3 ,but when use ImageCreateFromJPEG: br bWarning/b: imagecreatefromjpeg: .../testout.jpg' is not a valid JPEG file in b../a.php/b on line b4/bbr br bWarning/b: Supplied argument is not a valid Image resource in b../a.php/b on line b14 = ImageJPEG() what is my problem -- Best Regards Miguel Joaquim Rodrigues Loureiro -- 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] upload problem
Hello all, when I want to do an upload ( form ENCTYPE=multipart/form-data action= . $PHP_SELF . method=post), sometimes ( having in form, several input file types, ex.:input type=file name=aa), after submit , dont show me the values uploaded ( aa_name ; aa_type) ?? Any ideas why ? thanks for your time... -- Best Regards Miguel Joaquim Rodrigues Loureiro -- 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] Re:php modules
Sorry for taking your time, but I solve my problem, T.Y. Best RegardsMiguel Joaquim R. Loureiro [EMAIL PROTECTED] NEXTVISION - DEVTEAM www.nextvision.pt
[PHP] No more connection??
Hello , since may 15 I dont receive your mail , why I lost the connection???
[PHP] shutted down!!!!!
Hello all, but since 15 of May I dont receive mail from php-general-digest, and even from php-db-digest, there is any problem, or its my problem... Best Regards mailto:[EMAIL PROTECTED]
[PHP] require_once , include_once Vs irix
Hello all, when I use the functions require_once and include_once in Linux I have no problem (php 4.0.2), but using it in irix and in older version of php (4.04bl1) I have problems, any idea? Best Regards Miguel Loureiro [EMAIL PROTECTED]
[PHP] Re:user info?
Hello, have you saw the result of phpinfo(); try and see in Apache Environment, if make a login use a sessions... Good luck and good code Best Regards Miguel Loureiro [EMAIL PROTECTED]
[PHP] Re:Passing Parameter
By my understanding what Jack said,the problem can be solved with something like this: echo "a href="namefrom.ext?part_no=".$partvalue.""" and in nameform.ext you can use the partvalue... Hope that help, if its not what you want, well, sorry, and good luck, and code Best Regards Miguel Loureiro [EMAIL PROTECTED]
[PHP] Re:Passing Parameter
By my understanding what Jack said,the problem can be solved with something like this: echo "a href="namefrom.ext?part_no=".$partvalue.""" and in nameform.ext you can use the partvalue... Hope that help, if its not what you want, well, sorry, and good luck, and code. Best Regards Miguel Loureiro [EMAIL PROTECTED]
[PHP] Sorry....sessions ... again...with code...
|Hello all, I'm mad with mesorry but see if can understand why I'm mad. Copy the 3 attached files, and run it. In one.php just click to the link (it works.), now in two.php you can see: " and now: aaa", cool hum... Clicking in OFF link you can see the result of phpinfo, but section of Apache Evironment, in HTTP_COOKIE you (at least I have) the PHPSESSID with value, in spite of in off.php code I make a session_destroy Now if you use history back button, go to two.php, and OK the session variable dont appear, Back again, Forward and voila' here is a. I have try to follow some Jeff Armstrong tips, but I have no success.Thank you very much Jeff (really...I'm no jocking...). Any ideas ?? T.Y all Best Regards Miguel Loureiro [EMAIL PROTECTED] CODE: one.php ? session_start(); session_register("a"); $a="a"; ? html body form a href="two.php" 2 /a /form /body /html two.php ? session_start(); ? html body and now : ?echo $a? a href="off.php"OFF/a /body /html off.php ? session_start(); unset($a); session_destroy(); phpinfo(); ?
[PHP] session destroy???
Hello all, when using sessions, if use command session_destroy shouldn't all variables related with used session destroyed??? It seams that is a crazy question, but, after make a logout(session_destroy()), I use the browser buttons to go back to inicial page and forward until logout page, it continues appers sessions data, it's bad because someone can enter in my browser after me and make fully things in my page How can I solve this problem? I already try to use OnLoad and UnOnload events in Javascript T.Y all Best Regards Miguel Loureiro [EMAIL PROTECTED]
[PHP] variable on 2 forms
Hello all, I have a normal form (form1) with a variable (var1) and a form inside a layer (form2) with a variable (var2). After submit (form1), how can I have access to var2 ? (if I must use javascript should use: document.layer.var2 or document.form2.var2 or document.layer.form2.var2 ...???).I try to read directly $var2, but without result T.Y all Best Regards Miguel Loureiro [EMAIL PROTECTED]
[PHP] javascript question
Hello all, I have a small problem, when using IE4.0 the property, in javascript, document.name_form_nameRadio[n].DISABLED it woks fine, but in Netscape 4.6 it dont. Anyone can give an ideia or an url for more information. I know that this isn't a php question, sorry. T.Y. all Miguel Loureiro[EMAIL PROTECTED]
[PHP] refresh
Hello, to refresh a site I use this (META HTTP-EQUIV="Refresh" CONTENT="300" ), but, now I make some updates im my right page and I want to refresh other page( left page of frameset ).How can I do it? T.Y. Best Regards Miguel Loureiro [EMAIL PROTECTED]
[PHP] blank spaces???
Hello all, is there any solution when working with variables that have blank spaces, because when read the variavel to a select, it only appears the first word (e.g. having: "aaa bbb ccc", it only appears "aaa"). T.Y.All Best Regards Miguel Loureiro [EMAIL PROTECTED]
[PHP] javascript VS php
Hello all I would like to know if its possible from a javascript function call a php function (uiuiuiuiui...) ? This because I have a bidimensional array, and when user select a option of a checbox, on javascript function I read the selectedIndex and want to see the values of that name ( see arr[selectedIndex] with for cicle). If not possible(and I think it isnt), there is any solution? TY all Best Regards Miguel Loureiro [EMAIL PROTECTED]
[PHP] second select how???
Hello all, I have a dynamic select box, according information in database, but I want to restrict a second select box with the choice made in the first select box, but my problem is that I only know the value of the first one after submit form. It is possible to know a choice of a select box without submited ?? T.Y. Best Regards Miguel Loureiro [EMAIL PROTECTED]
[PHP] listing files and directories...
Hello all, To see all fields(directories and files) inside a directory I use the "dir" and "read", what I would like to know is, if there other way to do the same, others commands because now I have to problems, I want to make a sort of the list (by name or by date), and I have to use my program in irix system, any ideas ??? Thank you all Best Regards
[PHP] uploading...
Hi, I have a problem when I'm making an upload of big images (see attach), even having,in first step, a function that checks the file size, but when images are bigger the message(attach) appears . Anyone have some problem ? How can I solv this one? T.Y. Best Regards Miguel Loureiro[EMAIL PROTECTED]
[PHP] rename?
Hi , having a hierarchy of directories, like A\b\d, A\c, I would like to move directory A\b\d to A\c\d , to (try) to get it I test something like rename(d,".. / c/d"), but I get " Warning: Rename failed (No such file or directory) in ", it's necessary create the directory first, I mean , Mkdir(second_d) ? but the command its RENAME... or there are other, better , ways to do what I want. Consider that the directory d have lots of things (files and directories...). T.Y Best Regards Miguel Loureiro [EMAIL PROTECTED]
[PHP] radiobutton
Hello, I have sometging like this: input type="Radio" name="radio1" value=? echo $opt1 ?"Opt1 how I know if some user choose some radiobutton??? I tried if($opt1) , but without success.... T.Y. Miguel Loureiro [EMAIL PROTECTED]
[PHP] function problem ...
Hello I have a script that use other script file(php) twice, I call a function with certain parameters and call it again with other parameters and when runnig the script, the first function works well, but on second time I got a error message: "Fatal error: Cannot redeclare getndays() in Unknown on line 5". Anyone kows what is my problem ??? T.Y. Miguel Loureiro [EMAIL PROTECTED]
[PHP] Is correct ??
Hi, Anybody knows if this sourcecode is correct to calculate the numbers of days in certain date ? $m - month; $d - day, $y - year if($m=2){ $y--; $m+=13; } else $m++; $nd = (1461 * $y / 4) + (153*$m/5) + $d; Because I use this code in a function and sometimes it your and others dont Best Regards Miguel Loureiro [EMAIL PROTECTED]
[PHP] Saving Images...
Hi, could you tell me how to save image created ( with ImageCreate , and other stuff ..), there is any SaveImageAs... or something like that ? Do you know where can I find tutorials about creating, using thumb nails? Thanks your time... Miguel Loureiro [EMAIL PROTECTED] ENJOY LIFE...
[PHP] Recompile GD ??
How can I do it ??? I installed jpeg-6b, and I readed that before recompile PHP(with option : --with-jpeg-dir=/.../jpeg-6b), I must recompile gd, its really necessary ? If si, how recompile gd. Thanks Miguel Loureiro [EMAIL PROTECTED]
Fw: [PHP] Images ???
-Original Message- From: Ignacio Vazquez-Abrams [EMAIL PROTECTED] To: Miguel Loureiro [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Tuesday, January 16, 2001 7:36 PM Subject: Re: [PHP] Images ??? On Tue, 16 Jan 2001, Miguel Loureiro wrote: Hello, I want to show a list of images ( but in a small size - should I use ImageCopyResized ? how ? ), existed in a directory ( they are uploaded to dir, and the name of each image is also inserted into a DataBase ), with a link to the respective image and real size. To work with images ( I think its the only way... ) I declare a Header telling that the content is an image, but the kind of image can be different (*.jpeg,*.png, *.gif, ...), so ( I think ...) should I have a different Headders ? My other problem is to show the small copied images in a page that already have other information(ex: the name of the user, for that I'm using sessions), so can I do it, is it possible ? Thanks Miguel Loureiro That's what databases are for. Store the image data and the image mimetype when the image is uploaded. -- Ignacio Vazquez-Abrams [EMAIL PROTECTED] Agree, but my real problem is to show the images in a small size, is ImageCopyResized the solution, because that command thake a part of the original message, there is another one ? Thanks your attention Miguel Loureiro -- 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] Images ???
Hello, I want to show a list of images ( but in a small size - should I use ImageCopyResized ? how ? ), existed in a directory ( they are uploaded to dir, and the name of each image is also inserted into a DataBase ), with a link to the respective image and real size. To work with images ( I think its the only way... ) I declare a Header telling that the content is an image, but the kind of image can be different (*.jpeg,*.png, *.gif, ...), so ( I think ...) should I have a different Headders ? My other problem is to show the small copied images in a page that already have other information(ex: the name of the user, for that I'm using sessions), so can I do it, is it possible ? Thanks Miguel Loureiro