[PHP] Re: image generation with PHP
I did this just today -- http://www.php.net/manual/en/function.imagecreate.php Its real short and sweet. If you're running on Linux, I'm sure you'll be able to get it to work just fine - on Windows, make sure you have the gd extention, and that it will be loaded with php.ini. Hope this helps! -Jason Myrage wrote: is it possible to generate images with texts automatically?? like for eg. if the text is 7555 then automatically an image is generated with the text 7555 in it any help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: image generation with PHP
You'll need the full PHP package (the 5 MB zip file, not the 400k quickie) .. it'll be in the extensions/ directory of there.. php_gd.dll.. Myrage wrote: i am using windows and I cannot seem to find the necessary libs and dlls "Jason Young" wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >I did this just today -- >http://www.php.net/manual/en/function.imagecreate.php > >Its real short and sweet. If you're running on Linux, I'm sure you'll be >able to get it to work just fine - on Windows, make sure you have the gd >extention, and that it will be loaded with php.ini. > >Hope this helps! >-Jason > >Myrage wrote: > > >>is it possible to generate images with texts automatically?? like for >>eg. if >>the text is 7555 then automatically an image is generated with the >>text 7555 >>in it >> >>any help? >> >> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: image generation with PHP
Did you tell php.ini to load this extension, and then restart your webserver? (I am taking it that you're using IIS or PWS? -- Someone else will have to field the question on whether or not GD/PHP works with this.. I would imagine so, but I am not sure enough to put any money on it :) ) Myrage wrote: No luck I have installed GD lib and zlib and all into c:\php\extensions bur i still get an error *Fatal error*: Call to undefined function: imagecreate() in *c:\inetpub\wwwroot\image.php* on line *24* image.php code : -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Feasability of Serial functions and constantly running progrms
After upgrading to RedHat 8.0 and effectively breaking some python caller-id script that I have no clue how to fix.. I'm curious of whether or not PHP would be able to get caller-id data from a modem.. I imagine it could, and probably won't be too difficult to overcome... but I am posing that question just to get any feedback of any problems.. What the real question is about... is there any solid way of keeping a PHP script running (to latch onto the modem and constantly monitor it, of course...) and have it run without it crying about too much memory being used or being run too long. Any ideas, insight, etc? --Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Too all who are stuck with PHP/Apache2 under RH8
Just a quick reiteration of something I found that probably most people already know.. but since I went through the painstaking trouble of removing the PHP and Apache RPMs and building them from scratch (I hate building sources), I wanted to make sure this is out there. If you're having problems getting any PHP code to parse and you ususally use ... In the /etc/php.ini file change the short_open_tag variable to On That's all there is to it.. lol Also, you might wanna find the extention=mysql.so and uncomment that, since it's commented by default Credit goes out to the people who have previously posted this, but it's been a while since it's been said recently, I just thought I'd help out. --Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Error with file upload: "No file uploaded in Unknown on line 0"
I have some code that a user can set a description about an item to be posted, and then add some image files of the item. Its a 3x3 frame of fields, along with an 'include' line for each one.. only selecting a file with the 'Browse' button, or entering a website manually will trigger this include.. Of course, there aren't always going to be 9 images to upload, so sometimes they have to be left blank ... everytime I submit something without all 9 entries filled, I get a bunch of lines in my error log like the following: [error] PHP Notice: No file uploaded in Unknown on line 0 Is there something I can do to combat this? It's quite annoying to see up to 9 of these lines everytime I submit something from my page. I don't want to turn off all error reporting or anything like that, either... I'd like to see something that'll make it a non-error. Thanks! -Jason Young -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error with file upload: "No file uploaded in Unknown on
Thanks for your reply... However, is that the ONLY way? Shouldn't this be something that is not reported as an error to begin with? But even so, what about the other Notices I might receive in regards to other debugging.. I have to get rid of all that, too? Basically I'm asking if this is the only way to do it.. Thanks. -Jason Marek Kilimajer wrote: > Turn off notice logging in your php.ini, just keep warnings and errors. > > Jason Young wrote: > >> I have some code that a user can set a description about an item to be >> posted, and then add some image files of the item. >> >> Its a 3x3 frame of fields, along with an 'include' >> line for each one.. only selecting a file with the 'Browse' button, or >> entering a website manually will trigger this include.. >> >> Of course, there aren't always going to be 9 images to upload, so >> sometimes they have to be left blank ... everytime I submit something >> without all 9 entries filled, I get a bunch of lines in my error log >> like the following: >> >> [error] PHP Notice: No file uploaded in Unknown on line 0 >> >> Is there something I can do to combat this? It's quite annoying to see >> up to 9 of these lines everytime I submit something from my page. >> I don't want to turn off all error reporting or anything like that, >> either... I'd like to see something that'll make it a non-error. >> >> Thanks! >> -Jason Young >> >> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: apache problem......
This seems to be a browser problem, as I often get similar errors when trying to access sites with port numbers. That looks like an IE error.. and I know I have the same problem with Mozilla. Anil Garg wrote: > hi > in my httpd.conf i have added a virtual host as: > > > # General setup for the virtual host > DocumentRoot "/netvcr/www/niksun" > ServerName niksun.com > #ServerAdmin [EMAIL PROTECTED] > ErrorLog "|/usr/local/sbin/rotatelogs /var/log/httpd-error.log 172800 10" > TransferLog "|/usr/local/sbin/rotatelogs /var/log/httpd-access.log 172800 > 10" > > > but now if from browser i try to access "http:10.70.0.215:90" the things go > fine...but if i dont type 'http' and just type "10.70.0.215:90" in the > browser.i get the following error message: > > > The page cannot be displayed > The page you are looking for might have been removed or had its name > changed. > > -- > > Please try the following: > > a.. Open the s: home page, and then look for links to the > information you want. > > b.. If you typed the page address in the Address bar, make sure that > it is spelled correctly. > > > -- > Can someone one tell me when this error comes. > > Thanx and regards > anil > p.s. php,query, > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Sorry to butt in :) Arguments to web scripts are done in the format: page.php?arg1=data1&arg2=data2 So you would use that full string as the lynx path. Hope this helps :) -Jason Daren Cotter wrote: > Thanks for the info Chris, it works! > > How do I pass arguments to the script? I'm assuming > it'd just be: > > test.php arg1 arg2 > > The stuff I've read says $argc should be the count of > the # of arguments, and $argv should be an array > holding them...but when I do a simple: > print "# of Arguments: $argc\n"; > It prints nothing, not even 0 > > > --- Chris Hewitt <[EMAIL PROTECTED]> wrote: > >>> >>>On Wed, 25 Sep 2002, Daren Cotter wrote: >>> >>> My problem, is that I absolutely NEED to run a PHP script using crontab. The script needs to send numerous queries to a database every hour. Is >>> >>there >> any way I can accomplish this, directly or >>> >>indirectly? >> >>Are you sure its not already there? Commonly in >>/usr/bin. Try a "which >>php" and see if it finds anything? >> >>HTH >>Chris >> > > > > __ > Do you Yahoo!? > New DSL Internet Access from SBC & Yahoo! > http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
I can't say I'm really too familiar with the php commandline.. You're using /usr/bin/php (or equivalent) and attempting to use your exec() that way? If you do 'php -?' you'll get a list of commands that you can use, and I don't see a way to pass cmdline arguments as variables.. Having said that, I Just went and looked further into it.. if I make a test script, and at the top I put: $hi = $argv[1]; then $hi becomes whatever you've specified as the first argument.. I'm assuming this is what you want? To clarify: phpfile.php contains: Running the command "php -f phpfile.php test" returns "test" Does this help at all?? -Jason Daren Cotter wrote: > Jason, > > I'm not using a web script any longer, I'm using > command-line (I determined that it is installed on the > server). > > I read about $argc and $argv, but when I call the > script passing two arguments, both $argc and $argv are > blank. Is this a php.ini setting I need to change or > somethign? > > --- Jason Young <[EMAIL PROTECTED]> wrote: > >>Sorry to butt in :) >> >>Arguments to web scripts are done in the format: >>page.php?arg1=data1&arg2=data2 >> >>So you would use that full string as the lynx path. >> >>Hope this helps :) >>-Jason >> >>Daren Cotter wrote: >> >>>Thanks for the info Chris, it works! >>> >>>How do I pass arguments to the script? I'm >> >>assuming >> >>>it'd just be: >>> >>>test.php arg1 arg2 >>> >>>The stuff I've read says $argc should be the count >> >>of >> >>>the # of arguments, and $argv should be an array >>>holding them...but when I do a simple: >>>print "# of Arguments: $argc\n"; >>>It prints nothing, not even 0 >>> >>> >>>--- Chris Hewitt <[EMAIL PROTECTED]> >> >>wrote: >> >>>>>On Wed, 25 Sep 2002, Daren Cotter wrote: >>>>> >>>>> >>>>> >>>>>>My problem, is that I absolutely NEED to run a >>>>> >>PHP >> >>>>>>script using crontab. The script needs to send >>>>>>numerous queries to a database every hour. Is >>>>> >>>>there >>>> >>>> >>>>>>any way I can accomplish this, directly or >>>>> >>>>indirectly? >>>> >>>>Are you sure its not already there? Commonly in >>>>/usr/bin. Try a "which >>>>php" and see if it finds anything? >>>> >>>>HTH >>>>Chris >>>> >>> >>> >>> >>>__ >>>Do you Yahoo!? >>>New DSL Internet Access from SBC & Yahoo! >>>http://sbc.yahoo.com >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> > > > > __ > Do you Yahoo!? > New DSL Internet Access from SBC & Yahoo! > http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Daren, This post from Robert explains why you're having trouble :) I forgot the PHP version on my machine doesn't have the register_globals problem. THAT should work. -Jason > > I'm think you're all forgetting about register_globals being off by > default these days... The following may help: > > $argc = $GLOBALS['HTTP_SERVER_VARS']['argc']; > $argv = $GLOBALS['HTTP_SERVER_VARS']['argv']; > > HTH, > Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Correction.. isn't it $_SERVER and not $SERVER Jason Young wrote: > Daren, > > This post from Robert explains why you're having trouble :) > > I forgot the PHP version on my machine doesn't have the register_globals > problem. > > THAT should work. > > -Jason > >> >> I'm think you're all forgetting about register_globals being off by >> default these days... The following may help: >> >> $argc = $GLOBALS['HTTP_SERVER_VARS']['argc']; >> $argv = $GLOBALS['HTTP_SERVER_VARS']['argv']; >> >> HTH, >> Rob. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cronjob
Jeez.. pardon me.. $_GLOBALS .. I don't know where I got SERVER from.. *sleeps before posting from now on* -J Jason Young wrote: > Correction.. isn't it $_SERVER and not $SERVER > > Jason Young wrote: > >> Daren, >> >> This post from Robert explains why you're having trouble :) >> >> I forgot the PHP version on my machine doesn't have the >> register_globals problem. >> >> THAT should work. >> >> -Jason >> >>> >>> I'm think you're all forgetting about register_globals being off by >>> default these days... The following may help: >>> >>> $argc = $GLOBALS['HTTP_SERVER_VARS']['argc']; >>> $argv = $GLOBALS['HTTP_SERVER_VARS']['argv']; >>> >>> HTH, >>> Rob. >> >> >> > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mysql timestamp and php date
In my pages, I just format the date from the SQL query: "SELECT DATE_FORMAT(last_modified, '%m/%d/%Y %h:%i:%s %p') AS last_modified (...)" Look up the DATE_FORMAT on mysql.com to get a list of the arguments. Hope this helps! -Jason Bryan Koschmann - Gkt wrote: > Hello, > > I have a table with timestamps in mysql. The timestamps of course are in > the format of 20020930014535 but I would like to format the output as > this: > > date("l F jS H:i:s", $last_modified) > > What is the simplest way to do this? I see there are a few ways to convert > it, but I was hoping for something easy (i.e. any built in functions that > I missed). > > Thanks! > > Bryan > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: mysql timestamp and php date
No problem! Refresh MY memory here.. I noticed you didn't return the DATE_FORMAT column "AS " .. is that working okay? I seemed to think that it returned a long unwieldy column name.. maybe things are good.. let me know :-D --Jason Bryan Koschmann - Gkt wrote: > Hi Jason, > > I had come across this earlier, and while I can get it to return > perfectly, I was more looking for something that I could do without having > to pull 2 queries. Err, well wait, I wouldn't have to would I? I have 4 > columns: > > idnum, title, date, news > > I was just doing a select * from newlist, but I suppose I can just address > each specifically: > > select idnum, title, DATE_FORMAT(date, '%W, %M %D \@ %h:%i%p'), news from > newslist > > right? Okay that works. > > (don't mind me talking to myself) > > Thanks for the help, and making me take a second to look further at it! > > Bryan > > > On Mon, 30 Sep 2002, Jason Young wrote: > > |In my pages, I just format the date from the SQL query: > | > |"SELECT DATE_FORMAT(last_modified, '%m/%d/%Y %h:%i:%s %p') AS > |last_modified (...)" > | > |Look up the DATE_FORMAT on mysql.com to get a list of the arguments. > | > |Hope this helps! > |-Jason > | > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] no errors ?
I noticed that by default, my display_errors was actually OFF, and the only way to see my errors was through Apache's error.log file I don't know if that's already been checked, but... figured I'd try to help. -Jason Gamin wrote: > Yes, > > On both my development machine and implmetation machine i have the same > error_reporting. >error_reporing = 2039 (that is what phpinfo() gives me ) is equivalent > to E_ALL^E_NOTICE. And still i cant seem to get any error, even on a winxp > system running Apache and PHP 4.2.1 (from the php.ini file) - > > error_reporting = E_ALL & ~E_NOTICE > > I still cant understand why PHP is not complaining ? > > thx > > gamin. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Incrementing the value
Try $hid++; This automatically increments by one, its just much easier to deal with than +1 .. besides, it wouldn't work on my Win32 platform, either. --Jason Uma Shankari T. wrote: > Hello , > >border="0"> > > While clicking this link the $hid value get incremented and fetch the value > from the database according to that..the same thing is working in linux > platform and it is not working for the windows platform..the value is not > getting increment..Can anyone please tell me how to go about with this..?? > > Regards, > Uma > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Source files (.phps) cutting off prematurely
Hey guys and gals... I'm not sure if this is Apache, PHP, or a browser issue.. but.. .phps files get cut off while trying to access them in a browser.. anyone ever have a problem with this? I can't exactly calculate where in any particular file its doing this, but refreshing the page causes it to stop in the same place, so its not random.. Any help would be appreciated -Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: uploading files
How are you handling the transfer of files between its temporary area and where it's going to be stored? If you're copying instead of moving, I would imagine the file in the temp directory would still be present. -Jason Donahue Ben wrote: > I am uploading a gif file using > is_upload_file($filename) function. > I save the file with a file name img1.gif. It seems > to work fine. But when I delete the file img1.gif > then upload a different gif file and save it as > img1.gif, it displays the first image i uploaded not > the most recent one, why is this? Is there a way to > get around it? > > Ben > > __ > Do you Yahoo!? > Faith Hill - Exclusive Performances, Videos & More > http://faith.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Weird, weird, weird!
You're doubling up on your mysql_query's .. the first one runs, and I don't know the ins and outs of PHP, but the second mysql_query causes the resource to not be available... had a similar problem recently. Take the mysql_query out of the $cartquery assignment. -Jason Mike At Spy wrote: > Anyone ever have the experience of working on a site, working with MySQL and > then having something almost inexplicable happen? > > I was working on a script, and had this weird event. A very simple script > with this: > > mysql_connect("localhost","user","pass"); > mysql_select_db("dbname") > or die("Query Connection Database failed"); > $old=date("z")-1; > mysql_query("DELETE FROM Users WHERE Date < $old"); > > $cartquery = mysql_query("SELECT CartItemsID,Date FROM CartItems") > or die("Query failed"); > $cartnow = mysql_query($cartquery); > $cr=0; > $cartme = mysql_num_rows($cartnow); <<< while ($cr < $cartme){ > $cartrow=mysql_fetch_row($cartnow); > $CII=$cartrow[0]; > $CDa=$cartrow[1]; > $pieces=explode(":",$CDa); > $DCHK=$pieces[1]; > if ($DCHK < $old) { > mysql_query("DELETE FROM CartItems WHERE CartItemsID = '$CII'"); > } > } > > Started spitting this error at me: > > Warning: Supplied argument is not a valid MySQL result resource in (exact > location snipped) > > This is the line containing mysql_num_rows that is getting this error. > > Someone please tell me I'm missing something obvious! Yes, the connects to > MySQL database are fine. I can run the query right in phpMyAdmin with no > issues. > > If mysql_num_rows returns 0, or empty, it shouldn't be complaining, should > it? It would just skip the loop, correct? > > Thanks, > > -Mike > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: who's in the chat?
What's the chat built in? Is this web-page-based, telnet-based? Is this your code (i.e. you have access to the source and can modify it on-the-fly)? Oliver Witt wrote: > Hi all, > Here's my problem: > I created a web site with a chat. People have to log in to get on the > site, but not to get into the chat. I can tell who's on the site but not > in the chat. Is there anywhy to tell who's in the chat? > Thanks, > Olli > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problems with Fileupload
Hmm.. I have a page where I can upload up to 9 files at once -- and it works quite well.. However, these are just standard JPG pictures, and wouldn't get anywhere near 3M -- maybe its the way that PHP scripts time out after 30 seconds?? --Jason Sascha Braun wrote: > Hi freaks, > > my image library isn't still finished yet, but it's running and with a > running system are comming new problems up. > > I remember that there was a discussion about big file uploads. > > It seems, that i stepped into the same trap, 'cause my web- > server doesn't accept more than two uploads each upload > session. I wrote a script which should make it possible to > upload 10 files at a time. The files are up to 3 MB each so > I had to set up the upload_max_filesize in php.ini to an > amount of 50 MB Data. But it seems, that there still can > be uploaded about 5 or 6 MB in two files at a time. > > Would be nice if somebody could tell me about made > experiences. > > Thank you very much. > > Sascha Braun > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: who's in the chat?
Without knowing how your chat works as far as entering the chat, you DO have to put some sort of name with the person, right? Perhaps you could just update a temp table with their chat name.. Or if you can only get into chat by logging into the site, you could just set a bit with their cookie data or something.. Is this not what you wanted to do? (I guess I should have asked you to elaborate :) ) Just throwing suggestions out there -Jason Oliver Witt wrote: > Jason Young schrieb: > > >>What's the chat built in? Is this web-page-based, telnet-based? >>Is this your code (i.e. you have access to the source and can modify it >>on-the-fly)? >> >>Oliver Witt wrote: >> >>>Hi all, >>>Here's my problem: >>>I created a web site with a chat. People have to log in to get on the >>>site, but not to get into the chat. I can tell who's on the site but not >>>in the chat. Is there anywhy to tell who's in the chat? >>>Thanks, >>>Olli >>> > > > Yeah, I wrote the chat, it's php. I have access to everything. > Olli > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: who's in the chat?
Well, when they enter, when its building all of the frames or however you ahd it set up.. just throw an INSERT in there.. Do you know if the chat patrons use the 'leave' button? That could throw out another SQL statement, or put it wherever you have your unload functions... -J Oliver Witt wrote: > Jason Young schrieb: > > >>Without knowing how your chat works as far as entering the chat, you DO >>have to put some sort of name with the person, right? Perhaps you could >>just update a temp table with their chat name.. >> >>Or if you can only get into chat by logging into the site, you could >>just set a bit with their cookie data or something.. >> >>Is this not what you wanted to do? (I guess I should have asked you to >>elaborate :) ) >> >>Just throwing suggestions out there >>-Jason >> > > > I've been trying something similar like that. How can I update a temp table > when they enter and leave the chat? That's my problem, > Olli > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Argh! nulls un stuff..
My suggestion would be to checck for isset($_SESSION["temp"]) and if ($_SESSION["temp"] > "0") with quotes .. PHP is very forgiving with data types, and I've found its much easier to keep track of what exactly is going on if I reference everything in a string format. -Jason Sam Masiello wrote: > How about something like this: > > if ($_SESSION["temp"] > 0) ? > > Or if you want to be really sure: > > if ($_SESSION["temp"] > 0 && $_SESSION["temp"] != "") > > ORif you want to be sure the value is a number as well: > > if ($_SESSION["temp"] > 0 && $_SESSION["temp"] != "" && > is_numeric($_SESSION["temp"]) > > HTH > > Sam Masiello > Software Quality Assurance Engineer > Synacor > (716) 853-1362 x289 > [EMAIL PROTECTED] > > > > -Original Message- > From: Francis [mailto:[EMAIL PROTECTED]] > Sent: Monday, October 14, 2002 9:23 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Argh! nulls un stuff.. > > > ok going mad all I need to do is check a variable and if it has a number > in it then do something, so anything from 0 up, but it keeps thinking 0 > is null and failing, anyway around this? or am I just being stupid as > usual? > > $_SESSION["temp"] = 0; > $tempVar = 0; > > if($_SESSION["temp"] !=""){ echo "!= condition > "; } > if(isset($_SESSION["temp"])){ echo "isset condition > ";} > if(isset($tempVar)){ echo "tempVar isset condition > ";} if($tempVar > !=""){ echo "tempVar != condition > ";} if(!empty($tempVar)){ echo > "tempVar !empty condition > ";} > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Another odd file problem / Limit on File uploads?
Hey yet again... I've got a 3x3 grid of type 'file' input elements, for a nifty total of 9 upload spaces.. After specifying a file in all 9, and attempting upload, I only got 5.. I noticed the total filesize was 2 megs, so I changed the php.ini to 8.. yet I still got that problem. So I checked how my file array was being posted, and it turns out only 5 of them go through! Hopefully someone can follow this particular code... In the HTML Form, we have: Include Include . Include (The picInc array just allows them to set whether or not they really want that picture included (in case they mess up and don't want to upload such a pic - I wouldn't expect some of the users to be savvy enough to know to just delete the text from the field)) In the PHP upload, to check to see which elements are being parsed, I have: $current = 0; while (list($key) = each($_FILES['picname'])) { echo $current; /* -- This is the normal code just to satisfy everyone's curiosity. if ($picInc[$current] == true) { if (!is_dir($dir)) mkdir($dir); if (!is_uploaded_file ($_FILES['picname']['tmp_name'][$current])) echo "" . $_FILES['picname']['name'][$current] . " couldn't be copied!"; if (is_uploaded_file ($_FILES['picname']['tmp_name'][$current])) { move_uploaded_file($_FILES['picname']['tmp_name'][$current], $dir.$current.".jpg"); $log_query = "INSERT INTO pictures (pictureID, series) VALUES ('$pID', '$current')"; $log_result = mysql_query($log_query) or die ("Couldn't Insert Picture Record!"); } } */ -- End curiosity mode ;-) $current++; } On my output, I just get 01234 .. 5 elements. My question is specifically on how to get all 9 to upload, those 5 files, if specified, do indeed upload fine - just clearing that up :-) Any insight? 5 elements seems to be something deliberate, but I can't be sure, myself. Thanks! -Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Another odd file problem / Limit on File uploads?
Can't anyone help me with this? :-/ Read below... I wrote: > Hey yet again... > > I've got a 3x3 grid of type 'file' input elements, for a nifty total of > 9 upload spaces.. > > After specifying a file in all 9, and attempting upload, I only got 5.. > I noticed the total filesize was 2 megs, so I changed the php.ini to 8.. > yet I still got that problem. So I checked how my file array was being > posted, and it turns out only 5 of them go through! > > Hopefully someone can follow this particular code... > In the HTML Form, we have: > > Include > Include > . > Include > > (The picInc array just allows them to set whether or not they really > want that picture included (in case they mess up and don't want to > upload such a pic - I wouldn't expect some of the users to be savvy > enough to know to just delete the text from the field)) > > In the PHP upload, to check to see which elements are being parsed, I > have: > > $current = 0; > > while (list($key) = each($_FILES['picname'])) { > > echo $current; > /* -- This is the normal code just to satisfy everyone's curiosity. > if ($picInc[$current] == true) { > > if (!is_dir($dir)) > mkdir($dir); > > if (!is_uploaded_file ($_FILES['picname']['tmp_name'][$current])) > echo "*" . $_FILES['picname']['name'][$current] . "* couldn't > be copied!"; > > if (is_uploaded_file ($_FILES['picname']['tmp_name'][$current])) { > move_uploaded_file($_FILES['picname']['tmp_name'][$current], > $dir.$current.".jpg"); > > $log_query = "INSERT INTO pictures (pictureID, series) VALUES > ('$pID', '$current')"; > $log_result = mysql_query($log_query) or die ("Couldn't Insert > Picture Record!"); > } > } > */ -- End curiosity mode ;-) > $current++; > } > > On my output, I just get 01234 .. 5 elements. > My question is specifically on how to get all 9 to upload, those 5 > files, if specified, do indeed upload fine - just clearing that up :-) > > Any insight? 5 elements seems to be something deliberate, but I can't be > sure, myself. > > Thanks! > -Jason > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Another odd file problem / Limit on File uploads?
Sure.. post_max_size = 10M upload_max_filesize = 8M memory_limit = 8M As I said before, however.. even without throwing files there, my loop test code only spits out '01234', meaning that its only looping 5 times through the code before exiting... Does file handling only allow for 5 files at a time?? -Jason Paul Nicholson wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Can you post the values of the post_max_size, upload_max_filesize, > & memory limit ini settings? > ~Paul > > On Tuesday 15 October 2002 03:21 pm, Jason Young wrote: > > >Can't anyone help me with this? :-/ > > > >Read below... > > > >I wrote: > > > >>Hey yet again... > >> > >>I've got a 3x3 grid of type 'file' input elements, for a nifty total of > >>9 upload spaces.. > >> > >>After specifying a file in all 9, and attempting upload, I only got 5.. > >>I noticed the total filesize was 2 megs, so I changed the php.ini to 8.. > >>yet I still got that problem. So I checked how my file array was being > >>posted, and it turns out only 5 of them go through! > >> > >>Hopefully someone can follow this particular code... > >>In the HTML Form, we have: > >> > >>Include > >>Include > >>. > >>Include > >> > >>(The picInc array just allows them to set whether or not they really > >>want that picture included (in case they mess up and don't want to > >>upload such a pic - I wouldn't expect some of the users to be savvy > >>enough to know to just delete the text from the field)) > >> > >>In the PHP upload, to check to see which elements are being parsed, I > >>have: > >> > >>$current = 0; > >> > >>while (list($key) = each($_FILES['picname'])) { > >> > >> echo $current; > >> /* -- This is the normal code just to satisfy everyone's curiosity. > >> if ($picInc[$current] == true) { > >> > >>if (!is_dir($dir)) > >> mkdir($dir); > >> > >>if (!is_uploaded_file ($_FILES['picname']['tmp_name'][$current])) > >> echo "*" . $_FILES['picname']['name'][$current] . "* couldn't > >>be copied!"; > >> > >>if (is_uploaded_file ($_FILES['picname']['tmp_name'][$current])) { > >> move_uploaded_file($_FILES['picname']['tmp_name'][$current], > >>$dir.$current.".jpg"); > >> > >> $log_query = "INSERT INTO pictures (pictureID, series) VALUES > >>('$pID', '$current')"; > >> $log_result = mysql_query($log_query) or die ("Couldn't Insert > >>Picture Record!"); > >>} > >> } > >> */ -- End curiosity mode ;-) > >> $current++; > >>} > >> > >>On my output, I just get 01234 .. 5 elements. > >>My question is specifically on how to get all 9 to upload, those 5 > >>files, if specified, do indeed upload fine - just clearing that up :-) > >> > >>Any insight? 5 elements seems to be something deliberate, but I can't be > >>sure, myself. > >> > >>Thanks! > >>-Jason > > > - -- > ~Paul Nicholson > Design Specialist @ WebPower Design > "The webthe way you want it!" > [EMAIL PROTECTED] > > "It said uses Windows 98 or better, so I loaded Linux!" > Registered Linux User #183202 using Register Linux System # 81891 > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.0.6 (GNU/Linux) > Comment: For info see http://www.gnupg.org > > iD8DBQE9rHAlDyXNIUN3+UQRAkOFAJ9WZ7n1319LPagN8UlG8SHhOxBL+QCbBQnY > ffiyL5zI3kpCpr4nj7F41s4= > =eTBn > -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Another odd file problem / Limit on File uploads?
Well... you asked for it :D Here's the code: Key: When the user puts the URL or clicks the "Browse" button, they're required to hit the "Show Picture" button. This puts that picture into the 'pic[]' img space, and enables picInc[]. I didn't bother putting the javascript function picShow in here, because that works and doesn't cause problems. I'm about to leave work at this very moment so I apologize for not cleaning up the table tags beforehand.. I need to get out of here.. lol Include Include Include Include Include Include Include Include Include As I said before, its not even a problem with the pictures themselves.. as I noted in my PHP code earlier, I looped through it just printing the current $_FILES index it was working on, and it stops at 4 (the fifth file) no matter what... Other people have mentioned that their 5+ file uploads work just fine... I don't think I've done anything different between picname[4] and picname[5]... --Jason Paul Nicholson wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hey, > AFAIK, There is no "limit" on the amount of files that can be uploaded at > once. Could you post the html code for the form? > Note: The post_max_size should be larger than the upload_max_filesize & > the memory limit has to be larger than the post_max_size. > So you should have something like: > upload_max_filesize = 8M > post_max_size = 14M > memory_limit = 16M > ~Paul > > On Tuesday 15 October 2002 03:58 pm, Jason Young wrote: > > >Sure.. > > > >post_max_size = 10M > >upload_max_filesize = 8M > >memory_limit = 8M > > > >As I said before, however.. even without throwing files there, my loop > >test code only spits out '01234', meaning that its only looping 5 times > >through the code before exiting... Does file handling only allow for 5 > >files at a time?? > > > >-Jason > > > - -- > ~Paul Nicholson > Design Specialist @ WebPower Design > "The webthe way you want it!" > [EMAIL PROTECTED] > > "It said uses Windows 98 or better, so I loaded Linux!" > Registered Linux User #183202 using Register Linux System # 81891 > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.0.6 (GNU/Linux) > Comment: For info see http://www.gnupg.org > > iD8DBQE9rHllDyXNIUN3+UQRAnWhAJoCzG5nR92Vvq/XL7H0y/O6NBfDaQCgiTbV > cUr4AQHsTOrqDPqtGaiRGWo= > =gVfa > -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_FILES posting limited to 5?
I'm going to approach this question in a different way, in case some people were put off by the complexity of it yesterday. For all those who don't know my question from yesterday, I have a form where I can upload up to 9 files at a time. Unfortunately, only the first 5 of those files are being uploaded at any given time. As a test, I just created a simple form with only input type 'file's, and attempted to find out how many its attempting to parse. It is still only 5. I have posted the full code below so people might be able to try it on their own systems... please let me know what you might find: loop-test.php - File Loop Test - End Code - Thanks for everyone's time on this! --Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: $_FILES limited to 5? (Server versions)
Just wanted to let everyone know: PHP version is 4.2.1 Apache is 1.3.24 Running WindowsXP Pro -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Odd finding while researching $_FILES
Without going into the process of how I came to do this, I just wanted to throw out there that even if you only have 1 file input, it still seems to loop 5 times... Is this something with my code... -- $current = 0; while (list($key) = each($_FILES['picname'])) { echo $current; $current++; } -- ...or is there something freaky going on with the $_FILES array? -J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_FILES posting limited to 5?
BEAUTIFUL! This was the problem... it wasn't that there was a limit of 5 maximum uploads, it was just that my 'while' statement was only counting as many fields as the first sub-array for $_FILES.. which is 5. Tom, thanks a bunch! -Jason Tom Rogers wrote: > Hi, > > Wednesday, October 16, 2002, 11:49:04 PM, you wrote: > JY> I'm going to approach this question in a different way, in case some > JY> people were put off by the complexity of it yesterday. > > JY> For all those who don't know my question from yesterday, I have a > form > JY> where I can upload up to 9 files at a time. Unfortunately, only the > JY> first 5 of those files are being uploaded at any given time. > > JY> As a test, I just created a simple form with only input type 'file's, > JY> and attempted to find out how many its attempting to parse. It is > still > JY> only 5. > > JY> I have posted the full code below so people might be able to try > it on > JY> their own systems... please let me know what you might find: > > picname has 5 sub arrays called: > > name() > type() > tmp_name() > error() > size() > > You need to loop through those sub arrays like: > > while (list($key) = each($_FILES['picname'])) { > echo "$key "; > while(list($key2,$val2) = each($_FILES['picname'][$key])){ > echo "[$key2] $val2 "; > } > echo ' > '; > } > > print_r($_FILES) will show you all. > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Blank PHP pages.
Make sure all of your code is executing properly. I had this problem for a little bit, actually. Edit your php settings to give you errors on the output, or just check your server logs.. there's gotta be something there. Just one problem and my whole PHP page failed to print anything within tags. Angel Gabriel wrote: > I get absolutly NOTHING! I get the most basic HTML page, but blank, as in > the following > > > > -Original Message- > From: Marek Kilimajer [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 16, 2002 4:26 PM > To: PHP > Subject: Re: [PHP] Blank PHP pages. > > > Do you get at least any output, i.e. empty html document? Check in the > logs if your server is not dying > > Angel Gabriel wrote: > > > >I checked and register_globals is set to "on" - so that can't be the > >problem > > > >-Original Message- > >From: Jay Blanchard [mailto:[EMAIL PROTECTED]] > >Sent: Wednesday, October 16, 2002 2:33 PM > >To: 'Angel Gabriel'; [EMAIL PROTECTED] > >Subject: RE: [PHP] Blank PHP pages. > > > > > >[snip] > > I've got PHP working, on my server, I know this because I used that > >small PHP script that shows all the variables, and that worked fine. The > >problem seems to be that every other script shows me a blank pages. I'm > >using redhat 7.3, and I installed PHP, MySQL and Apache from RPM's and > > they > > >are all up2date - I have no idea what I could have missed. Has anyone > else > >encountered a similar problem, and if so, how did you remedy it? I have > >followed the install instructions to the letter, and I can't seem to find > >what the problem is. Any suggestions, hints or tips, greatfully recieved! > >Thanks in advance > >[/snip] > > > >Check register_globals in php.ini. It is probably set to "off" > > > >HTH! > > > >Jay > > > > > > > > > >--- > >Incoming mail is certified Virus Free > >Checked by AVG anti-virus system (http://www.grisoft.com) > >Version: 6.0.404 / Virus Database: 228 - Release Date: 10/15/2002 > > > >--- > >Outgoing mail is certified Virus Free > >Checked by AVG anti-virus system (http://www.grisoft.com) > >Version: 6.0.404 / Virus Database: 228 - Release Date: 10/15/2002 > > > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.404 / Virus Database: 228 - Release Date: 10/15/2002 > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.404 / Virus Database: 228 - Release Date: 10/15/2002 > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with fputs/fgets
I'm in the process of writing a very very simple web-based email client, just for my personal use, so I can perm-delete all the spam that comes in through the day on my home account before i get home. On the very first connect, its great.. connects, does a 'uidl' which lists all the mail ID's (the 'else' part of the if statement below) The problem lies where I click the generated link and attempt to read a message, the browser load just hangs (despite the set_time_limit()) and when I cancel it, the server tells me there's another connection active. I have an fputs($pop, "QUIT\r\n); as well as an fclose($pop); .. Shouldn't this be sufficient to make sure the connection is closed before my visit to trying to read a message? Or is that not the problem? I'm thinking its something with the actual ($action == "read") code.. but... what would it be? Thanks for all help! -Jason Code "; $list = substr($list, 4, strpos($list, " ", 3)); for ($i = 1; $i <= $list; $i++) { $curr = fgets($pop); echo "$curr"; } echo "$list messages"; } fputs($pop,"QUIT\r\n"); echo fgets($pop); fclose($pop); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problem with fputs/fgets - Scratch that.
Scratch this.. as some of you probably have already picked up on.. I failed to terminate my 'top' line .. Sorry for that 0:) -J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_FILES posting limited to 5?
Yeah, this has been worked out already - turns out I was looping on the file elements themselves (size, name, tmp_name, etc) isntead of the actual number of files. Thanks for your reply tho! :) -J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with fputs/fgets
Oh.. I had no idea.. I suppose I will be looking that up then ;-) Thanks for the heads up! -Jason Paul Nicholson wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hey, > I saw that you fixed this but have you ever thought of using the imap_* > functions for this? It'd be a lot easier and it does work on pop3 servers. > ~Paul > > On Wednesday 16 October 2002 05:02 pm, Jason Young wrote: > >>I'm in the process of writing a very very simple web-based email client, >>just for my personal use, so I can perm-delete all the spam that comes >>in through the day on my home account before i get home. >> >> >>On the very first connect, its great.. connects, does a 'uidl' which >>lists all the mail ID's (the 'else' part of the if statement below) >> >>The problem lies where I click the generated link and attempt to read a >>message, the browser load just hangs (despite the set_time_limit()) and >>when I cancel it, the server tells me there's another connection active. >> >>I have an fputs($pop, "QUIT\r\n); as well as an fclose($pop); .. >>Shouldn't this be sufficient to make sure the connection is closed >>before my visit to trying to read a message? Or is that not the problem? >> >>I'm thinking its something with the actual ($action == "read") code.. >>but... what would it be? >> >>Thanks for all help! >>-Jason >> >>Code >> >>>if (isset($_GET['action'])) >> $action = $_GET['action']; >>if (isset($_GET['msg'])) >> $msg = $_GET['msg']; >> >>$pop = fsockopen("pop.server", 110, $errno, $errstr, 300); >> >>fgets($pop,255); >> >>fputs($pop,"USER name\r\n"); >>fgets($pop,255); >> >>fputs($pop,"PASS word\r\n"); >>$status = fgets($pop,255); >> >>if (substr($status, 0, 4) == "-ERR") { >> echo $status; >> exit(); >>} >> >>if ($action == "read") { >> set_time_limit(10); >> $cmd = "top $msg 10"; >> fputs($pop, $cmd); >> $themsg = fgets($pop); >> echo $themsg; >>} else { >> fputs($pop,"uidl\r\n"); // Get list of messages >> $list = fgets($pop,255).""; >> $list = substr($list, 4, strpos($list, " ", 3)); >> for ($i = 1; $i <= $list; $i++) { >> $curr = fgets($pop); >> echo ">"))."\">$curr"; >> } >> echo "$list messages"; >>} >> >>fputs($pop,"QUIT\r\n"); >>echo fgets($pop); >> >>fclose($pop); >>?> > > > - -- > ~Paul Nicholson > Design Specialist @ WebPower Design > "The webthe way you want it!" > [EMAIL PROTECTED] > > "It said uses Windows 98 or better, so I loaded Linux!" > Registered Linux User #183202 using Register Linux System # 81891 > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.0.6 (GNU/Linux) > Comment: For info see http://www.gnupg.org > > iD8DBQE9rgbwDyXNIUN3+UQRAuO3AJ9zntAWZ6RkOC2LHQDSEVlirN1CegCfZatW > JGjOasC8q+s56CcF1j9Odok= > =49DU > -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: upload files
I'm not sure of the backwards compatibility, but if you're running PHP 4.2.x (I think? Maybe it came in earlier) .. use the $_FILES global variable, in place of $HTTP_POST_FILES. The array is exactly the same: $_FILES[name_of_file][attributes] Hopefully this helps? -Jason Cyrille Andres wrote: Hello everybody, I want to allow the client to upload a text file on my web server, so I use this code : Uploaded files details ", $HTTP_POST_FILES["userfile"]["name"]); printf("Temporary Name : %s ", $HTTP_POST_FILES["userfile"]["tmp_name"]); printf("Size : %s ", $HTTP_POST_FILES["userfile"]["size"]); printf("Type : %s ", $HTTP_POST_FILES["userfile"]["type"]); if (copy ($HTTP_POST_FILES["userfile"]["tmp_name"],"temp/".$HTTP_POST_FILES["userfile "]["name"])) { printf("File successfully copied");} else{ printf("Error: failed to copy file");} ?> the $http_post_files doesn't return me anything, anybody would have a clue ?? ( roughly speaking I am not able to retrieve the field the client try to send me). Thanks a lot. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: displaying flash from db
Well how exactly are you using this DB? Are you using a 'blob' type format to actually write the flash binary to the database, or are you using it to keep track of where it is in the filesystem? -J Yonatan Ben-Nes wrote: Hi all! Does anyone know where can i find some information about displaying flash from a db? I'm breaking my head over it, searching at newsgroups, searching at the net, addressing newsgroups but still nothing! Help b4 im cutting my hands off!!! With hopes to be saved :P Yonatan Ben-Nes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] upload several files
I was going to post a similar response to this.. but I do recall that Hotmail uses a form where you select the filename and pop it over to a listbox.. then when you submit, it throws all the files into the email.. one page, one form, any number of files (up to 1 or 2 megs, however hotmail's limiting you these days)... Anyone happen to know how that one works? --Jason Kevin Stone wrote: http://www.php.net/manual/en/features.file-upload.multiple.php -Kevin - Original Message - From: "Andres, Cyrille" To: Sent: Tuesday, October 29, 2002 12:19 PM Subject: [PHP] upload several files >Hello everybody, > >I created a form allowing user to upload some files on my server. It works >very fine. >But now I would like him -the user- to be able to choose several files and >upload them at the same time by submitting the form. > >Actually I don't really know how to do that, if somebody would have an >example or a link to an example where I can check the code, it would be >great. > > >THANKS > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Form variables vs Sessions
Apologies if I'm being too simplistic here, but make sure that your first page's form elements have something similar to: And of course.. that your POST data is being grabbed accordingly by the first page to be able to set those variables. Maybe this helped? -Jason John W wrote: I am having a problem with a form system that I am developing. It is a multi page form with over a hundred different possible variables. The problem that I'm having is that when a user enters invalid data on one page and then submits to the next page I want that page to go back to the previous page with the form fields already filled in. Currently I have the form going to the previous page with a custom error message, but am having a problem with getting the fields filled in. I pass the variables from page to page by using PHP to convert them to hidden form fields. I have considered using sessions but am concerned with the high overhead due to the number of variables. Any help with this problem would be greatly appreciated.Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Upload images to server other than web server?
Does it have direct access to this filesystem? Or maybe FTP access? I've seen a lot of talk about automatic FTP transfers on the list, maybe you can filter the topics and grab something from there? Just a few cents to throw in :) -Jason Greg Macek wrote: This topic may have been covered before, but I couldn't find any info on it. We have a Cobalt RaQ4 that serves up all our intranet sites, a couple of which will have forms for uploading files that are related to records stored in a DB. I'm not planning on storing the files in the DB, don't worry. :) However, the files themselves will not be stored on the RaQ, but a different file server on the network which has substantial space for files. What is the best way to go about this? Have the file uploaded to a temp. location on the RaQ and FTP it to its final destination? Or is there a way to automatically redirect the file? I've considered NFS for this, but I'm unsure if the RaQ has tools for mounting NFS shares. Ideas/comments welcome. Thanks. - Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Code Advice
I (think I) have come up with an interesting little solution for pages that have/can potentially have a lot of get vars, and I just wanted to throw it by everyone to see if I know what I'm talking about... Instead of having a whole bunch of ... "if (isset($_GET['var'])) $var = $_GET['var']" .. lines on top of each page.. does this code look feasable to you? - $get_allow = array('foo', 'bar', 'add', 'takeovertheworld'); while (list($key,$val)=each($get_allow)) { if (isset($_GET[$key])) $$key = $val; } - It SEEMS to work so far, I just don't want to throw this into a production environment if something's all screwy, so I figure I'll get a few hundred pairs of eyes.. I'm sure someone else probably thought of such a thing, I was just tired of having a page of 'if $_GET''s everywhere, and its scalable with just adding a word to the array, instead of two new lines. Any potential bugs? --Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code Advice
Hmm.. So then can anyone tell me why its working so far? ;) I am trying out every single function in this page in hopes to catch something, but so far I don't see any breakage - I can see there are a few ways to skin this cat.. the original code I posted DOES work.. I still may be blind to any future breakings.. that's why I posted it. Unfortunately, I'm getting responses saying that this code won't work at all - when it does.. :-/ Mike Ford wrote: -Original Message- From: Kevin Stone [mailto:kevin@;helpelf.com] Sent: 06 November 2002 18:50 To: [EMAIL PROTECTED] Subject: Re: [PHP] Code Advice All I have to go by is what I see. The method was this.. $get_allow = array('foo', 'bar', 'add', 'takeovertheworld'); while (list($key,$val)=each($get_allow)) { if (isset($_GET[$key])) $$key = $val; } ?> The array $get_allow has numerical indicies. Looping through that in the method described is going to set an integer to $key. So your first error is going to be that $_GET[0] is Undefined. Second error is going to be $$key is an invalid variable name. Mea culpa -- you're quite right, and I should read more carefully! (Well, it is 7pm and going home time) This should, of course, be done like this: $get_allow = array(..); foreach ($get_allow as $key): if (isset($_GET($key)): $$key = $_GET[$key]; endif; endforeach; Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code Advice
register_globals is definately off.. Maybe its a PHP miracle, as Ernest suggested.. maybe Rasmus or someone else on the PHP dev team has something to say about it, but it works.. maybe you all could use it :-D Hopefully I didn't find a bug :-o -J Kevin Stone wrote: It's probably working becuase you have register_globals = ON in your php.ini and those variable names are being set by default. Your posted code is actually doing nothing. What I can't figure is why you're not getting any errors. :-\ -Kevin - Original Message - From: "Jason Young" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 06, 2002 12:13 PM Subject: Re: [PHP] Code Advice Hmm.. So then can anyone tell me why its working so far? ;) I am trying out every single function in this page in hopes to catch something, but so far I don't see any breakage - I can see there are a few ways to skin this cat.. the original code I posted DOES work.. I still may be blind to any future breakings.. that's why I posted it. Unfortunately, I'm getting responses saying that this code won't work at all - when it does.. :-/ Mike Ford wrote: -Original Message- From: Kevin Stone [mailto:kevin@;helpelf.com] Sent: 06 November 2002 18:50 To: [EMAIL PROTECTED] Subject: Re: [PHP] Code Advice All I have to go by is what I see. The method was this.. The array $get_allow has numerical indicies. Looping through that in the method described is going to set an integer to $key. So your first error is going to be that $_GET[0] is Undefined. Second error is going to be $$key is an invalid variable name. Mea culpa -- you're quite right, and I should read more carefully! (Well, it is 7pm and going home time) This should, of course, be done like this: $get_allow = array(..); foreach ($get_allow as $key): if (isset($_GET($key)): $$key = $_GET[$key]; endif; endforeach; Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Code Advice
I just saw that post... I feel completely stupid at this point, might I point out. You're right - register_globals is by default 'on' on this particular server I"m working on (I don't do a lot of PHP work on it), cuz its an older version and I haven't been bothered enough to upgrade it... I haven't tested it on something that has register_globals set to on. So yes.. indeed my code did absolutely nothing. Who wants to hire me? hah. Thanks for all the help, though.. I definately learned a few things and got some decent code in return to fiddle with! Thanks to all, apologies for the brain-death. -Jason Ernest E Vogelsinger wrote: At 20:40 06.11.2002, Jason Young spoke out and said: [snip] register_globals is definately off.. Maybe its a PHP miracle, as Ernest suggested.. maybe Rasmus or someone else on the PHP dev team has something to say about it, but it works.. maybe you all could use it :-D [snip] Jason, as Chris already pointed out, this code doesn't do what you intend to do. You don't get an error because you do not access the variable name directly - at least not the variable your code generates (which is $0, $1, $2, etc). If you did you'd get a decent parser error - but unfortunately your data hides behind these identifiers. If register_globals is off I have absolutely no idea why you still have them available. Please recheck your testing code - I'm sure you'll notice the glitch... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Lynx/Apache PHP execution vs. PHP interpreter
I've got a CallerID program that I've found on Freshmeat.net (elcid, for those keeping track)... I've edited the reporting functions so that instead of throwing it up on the console like it normally does, it instead calls lynx with the -dump parameter to the PHP page, and that in turn puts the variables into a DB... (Basically I can access my full CallerID information from anywhere) My question is ... is there any difference for me to call system() to lynx, or for me to call the PHP interpreter directly? I've noticed a lot of lag time between the phone ringing, and the data being reflected on the report page (between 7 - 10 full seconds) .. Now I know for a fact that the elcid program is partly at 'fault' as far as a delay in displaying the info from the modem (developer is looking into it as time allows, from what I hear) .. but I know it wasn't 7-10 seconds. Of course, I'd try it myself and see if there's any improvement, but I'm short on time and don't have enough people to bother to say "Hey call me back real quick" .. and besides, no sense editing and recompiling C code if there's no difference :-D Insight, as always, is very appreciated. Thanks much! -Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: arg parsing
This is a common upgrader's 'register_globals' confusion problem ;-) Basically what it means is that arbitrary values are not parsed in a GET-type request, like your action=new. You must explicitly ask for them.. *I* personally use this (I'm sure others will follow up with their code) at the top of my files: if ($_GET['action']) // $_GET[] is the superglobal for GET requests $action = $_GET['action']; Hope this clears it up! -Jason Phil wrote: Apologies for revisting any old ground but I am not able to resolve this. I have been running a php script that uses an argument http://..././process.php?action=new It used to work on linux 7.3 php4 apache 1.3.2 I have just upgraded my test environment to linux 8.0 php4.3.2 apache 2.040 now it doesn't work becuase the arg does not get parsed. I am sure that this is a config issue but I do not know it - any assistance much appreciated. regards Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to echo the end marker '?>'
If you're trying to get a LITERAL ?> Use > for your > symbol so that you have ?> I also noticed you didn't have a Does this help? John W. Holmes wrote: >subject's allready my question ! I want to echo something like : " action = \",?php echo $PHP_SELF ?> \" >" so that the action becomes echo $PHP_SELF ?> !! But I can't figure out how to escape ?> so that the > interpreter doesn't take it as the end of the script ! Any idea ? Maybe I don't understand... but, echo "\" >"; ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CLI [Lack of] Performance on Windows
I'm not much for running PHP on Windows, but I thought that many of the performance issues had been worked out... However, I'm trying to run a PHP through CLI and having a terrible experience with speed. This is running Windows Server 2008 (with a Quad-Core Intel, 4 GB of RAM). My problem in particular is a small script that bzread()s from a large-ish (104 MB) file, and throws some data into a sqlite db. It's not really hitting any resource limits that I know of - the PHP process isn't even using 3% CPU, and RAM usage is minimal... it's just... slow. It's not even just this script. It's not doing it now, but when I was playing around with it last night, it was taking quite a bit to execute small echo statements from reading stdin from the php process (although 'php -qa' doesn't exhibit this behavior) Anyway, Windows processes about 4,000 rows per minute, while Linux does 10.6K. I know I shouldn't expect much out of the platform, but this just straight CLI, I figured it would be at least respectably similar. Any insight? Thanks! -Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting backtrace through GDB?
Hi all, I'm trying to follow the instructions for getting a GDB backtrace from the PECL site ( http://bugs.php.net/bugs-generating-backtrace.php ). For some reason, I'm not getting any symbol output when I try to generate the backtrace, it simply gives me the memory address and '??'. I'm using a clean install of PHP, and I've specified --enable-debug in the configure script (which I know works, since PHP will identify and print memory leaks). Has anyone else had any trouble with this and found a solution? I'd really like to get generate these so I can better help the PECL developer this is needed for. Thanks for any insight or suggestions you can give! -Jason Young -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Getting backtrace through GDB?
Anyone, anyone? Bueller? :P I'm sure someone has experience with GDB? I'm not looking for a newbie primer, I'm just curious if anyone has had experience with the problem below and knew how to correct it.. Thanks :) Jason Young wrote: Hi all, I'm trying to follow the instructions for getting a GDB backtrace from the PECL site ( http://bugs.php.net/bugs-generating-backtrace.php ). For some reason, I'm not getting any symbol output when I try to generate the backtrace, it simply gives me the memory address and '??'. I'm using a clean install of PHP, and I've specified --enable-debug in the configure script (which I know works, since PHP will identify and print memory leaks). Has anyone else had any trouble with this and found a solution? I'd really like to get generate these so I can better help the PECL developer this is needed for. Thanks for any insight or suggestions you can give! -Jason Young -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] this has got me baffled: imagesx() andimagesy()reporting the wrong size?
Indeed. Using ImageMagick's 'identify' command, the first layer is 30x24 on a 32x32 canvas. radioactive-bread-eek.gif[0] GIF 30x24 32x32+2+6 8-bit PseudoClass 256c 2.11kb radioactive-bread-eek.gif[1] GIF 32x27 32x32+0+4 8-bit PseudoClass 256c 2.11kb If getimagesize() works on the canvas, then you might want to use that, instead. gd and gifs don't really have a steady relationship, anyway. Ashley Sheridan wrote: It does indeed seem to be some sort of bug. I've just tested it with your image on my machine here and for imagesx() and imagesy() it gives 30 and 24 respectively. getimagesize() does return the correct dimensions though. The same image saved as a flat single layer gif from the Gimp behaves exactly the same way. This might not be a proper bug as such, as the image itself might be 32x32, but the first layer (the first frame in the animated version) is 30x24 when you remove the dead, unused, transparent background. Perhaps GD is meant to report on the *actual* size of the image, rather than the dimensions of the frame? Thanks, Ash http://www.ashleysheridan.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Merging two partially-transparent images results in black pixels
Hello, I have an image that uses partial transparency for borders and such. At first, I tried using the whole image; creating a truecolor 'holder' image, then imagecopymerge-ing it, but that resulted in the outside transparent areas (the ones that would instead show the 'holder' image) were black, while the portions of transparency on the inside (these are rounded-squares) that had actual other images below them were white. Then, I made two images. One having the outside transparency, and setting imagesavealpha to make it work as intended... then adding the needed images, then adding the 'window'-type transparent image on top. This gives the best result, but the 'window' image also has partial transparency, and is instead showing in black. I'm pretty much at wit's end. Everything's imagecopymerge'd, I've tried just about everything I could think of. Can you actually not have two transparent images on top of one another? Is there something else I can try? And as an offshoot question, why won't any transparent images natively load/import as transparent? I always seem to have to call imagecolortransparent on portions that are definitely transparent in Photoshop, etc. Any help would be much appreciated! Thank you -Jason Young -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GD/Freetype text problems with bold or size < 8
Currently, I'm running PHP 5.0.4 (only because it's the only one I can get to work on my FC4 x64 install!), but for some reason, using pixel sizes under 8, or using bold fonts, makes the text look horrible. My old host (1&1 in case anyone else has them..) had this working well, but I have no idea what their settings were. I've heard that editing the gd.h file to change the resolution from 96 to 72 helps, but I'm assuming I'd have to recompile something for that to take effect, and I can't find a PHP-GD Source RPM for my arch. What must I do to get everything smooth again? Fedora Core 4, x64 PHP 5.0.4 PHP-GD module (separate RPM install) Freetype 2.1 gd-2.0.33 Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GD/Freetype text problems with bold or size < 8 - Followup
Just to followup on this, I was able to install PHP 5.1.1 with its embedded GD library, and it turns out that GD is definitely the cause of the issues. So my question now is what changes to the source can be made to ensure the highest-quality fonts in smaller sizes? As I've said, I've been on hosts with very smooth rendering of smaller text (size < 8, assuming 96 pixel resolution), but my current build looks horrible. http://card.mygamercard.net/mini/Morgon.jpg is what it looks like now - all text is 6 point aside from the bold text at the top, which is 8. This is the 5.0.4 install. http://data.mygamercard.net/test.png is an image I created using a built-but-not-installed version of PHP 5.1.1. I changed the GD_RESOLUTION to 72 point font, so to compensate, these are a font size of 9. What I would like is for the fonts to look similar to what would really be displayed, had this been standard system fonts in a browser or other application. If anyone has had experience with rendering text, I would really appreciate some hints on how to tweak GD to make things look proper. Thanks Jason Young wrote: Currently, I'm running PHP 5.0.4 (only because it's the only one I can get to work on my FC4 x64 install!), but for some reason, using pixel sizes under 8, or using bold fonts, makes the text look horrible. My old host (1&1 in case anyone else has them..) had this working well, but I have no idea what their settings were. I've heard that editing the gd.h file to change the resolution from 96 to 72 helps, but I'm assuming I'd have to recompile something for that to take effect, and I can't find a PHP-GD Source RPM for my arch. What must I do to get everything smooth again? Fedora Core 4, x64 PHP 5.0.4 PHP-GD module (separate RPM install) Freetype 2.1 gd-2.0.33 Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Repost: GD/Freetype text problems with bold or size < 8
Is anyone able to assist with this? I need to have 6 point fonts looking like they should, instead of all scrunched up. Paid consultation okay, if that's what's stopping an answer. What needs to be changed in the bundled GD source to make these fonts look decent? Thank you. Jason Young wrote: Just to followup on this, I was able to install PHP 5.1.1 with its embedded GD library, and it turns out that GD is definitely the cause of the issues. So my question now is what changes to the source can be made to ensure the highest-quality fonts in smaller sizes? As I've said, I've been on hosts with very smooth rendering of smaller text (size < 8, assuming 96 pixel resolution), but my current build looks horrible. http://card.mygamercard.net/mini/Morgon.jpg is what it looks like now - all text is 6 point aside from the bold text at the top, which is 8. This is the 5.0.4 install. http://data.mygamercard.net/test.png is an image I created using a built-but-not-installed version of PHP 5.1.1. I changed the GD_RESOLUTION to 72 point font, so to compensate, these are a font size of 9. What I would like is for the fonts to look similar to what would really be displayed, had this been standard system fonts in a browser or other application. If anyone has had experience with rendering text, I would really appreciate some hints on how to tweak GD to make things look proper. Thanks Jason Young wrote: Currently, I'm running PHP 5.0.4 (only because it's the only one I can get to work on my FC4 x64 install!), but for some reason, using pixel sizes under 8, or using bold fonts, makes the text look horrible. My old host (1&1 in case anyone else has them..) had this working well, but I have no idea what their settings were. I've heard that editing the gd.h file to change the resolution from 96 to 72 helps, but I'm assuming I'd have to recompile something for that to take effect, and I can't find a PHP-GD Source RPM for my arch. What must I do to get everything smooth again? Fedora Core 4, x64 PHP 5.0.4 PHP-GD module (separate RPM install) Freetype 2.1 gd-2.0.33 Thank you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php