php-general Digest 28 Jan 2008 15:43:50 -0000 Issue 5261
php-general Digest 28 Jan 2008 15:43:50 - Issue 5261 Topics (messages 268183 through 268195): i enconter a question when use Zend Framework's _foward function 268183 by: little btx 268184 by: Nathan Nobbe 268185 by: Nathan Nobbe Re: php installation problem 268186 by: Umar Getting part of string matched with regular expressions 268187 by: Teck 268188 by: Paul Scott 268189 by: Jochem Maas 268190 by: Max Antonov 268194 by: Per Jessen Getting nuequiz pro wo to work in php5 268191 by: Don Don Re: interface inheritance 268192 by: Jochem Maas [SOVLED - ISH] Re: [PHP] pack it in 268193 by: Jochem Maas Re: Posting Summary for Week Ending 25 January, 2008: [EMAIL PROTECTED] 268195 by: Zoltán Németh Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- in the function init() ,i want to use the function _foward but it doesn't work. how to deal the problem ---End Message--- ---BeginMessage--- On Jan 27, 2008 9:53 PM, little btx [EMAIL PROTECTED] wrote: in the function init() ,i want to use the function _foward but it doesn't work. how to deal the problem i think youll have to be more specific, can you supply some code that illustrates the problem ? -nathan ---End Message--- ---BeginMessage--- On Jan 27, 2008 10:01 PM, little btx [EMAIL PROTECTED] wrote: public function init() try{ $this-subject = new subject($subject_id); }catch (Zend_Exception $e) { $this-_forward('index','error',null,array('error'=$e-getMessage()); } } when it catch the Zend_Exception ,the function _forward doesn't work please keep posts on list for the benefit of others. what is the precise error you receive when _forward() is called? also, what is the context of this code you have posted? are you extending a class from the zend framework? -nathan ---End Message--- ---BeginMessage--- Hi Andres! Thanks for your reply.. That is intresting there is no libiconv or icon installed on my First Slackware machine where I have successfully installed php. But there is a libiconv installed on second Slackware machine. Regards, Umar Draz Andrés Robinet wrote: -Original Message- From: Andrés Robinet [mailto:[EMAIL PROTECTED] Sent: Sunday, January 27, 2008 11:03 AM To: [EMAIL PROTECTED] Subject: RE: [PHP] php installation problem -Original Message- From: Umar [mailto:[EMAIL PROTECTED] Sent: Sunday, January 27, 2008 3:55 AM To: [EMAIL PROTECTED] Subject: [PHP] php installation problem Dear Members! I have installed php-5.2.5 on slackware 12.0 with these option successfully ./configure --prefix=/usr/local/php --with- apxs=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --with-pcre-regex --with-layout=GNU --enable-sysvshm --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-exif --enable-ftp --enable-safe-mode --enable-bcmath --disable-debug --enable-sockets --enable-force-cgi- redirect --with-gettext --with-zlib --with-gd --enable-gd-native-ttf -- disable- rpath --enable-mbregex --with-bz2 --with-mime-magic --enable-calendar --enable-inline-optimization --enable-magic-quotes --enable- wddx=shared --with-ncurses=shared --with-xmlrpc --with-regex=system --with-pear --with-curl --with-gmp --with-png-dir=/usr/local --enable-mbstring --with-jpeg-dir=/usr/local --with-pic --with-mm=/usr/local --with-libexpat-dir=/usr/local --with-xsl=/usr/local --with-mcrypt --with-mhash --with-ldap=/usr/local/ldap Now I am trying to install php-5.2.5 on another slackware 12.0 with same options but i got error on make ext/gd/libgd/.libs/gdkanji.o: In function `do_convert': /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/gd/libgd/gdkanji.c:350: und efined reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/gd/libgd/gdkanji.c:365: und efined reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/gd/libgd/gdkanji.c:381: und efined reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `_php_iconv_strlen': /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:603: undefine d reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:626: undefine d reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:660: undefine d reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `php_iconv_string': /home/data/pkgs_docs/unix-pkgs/web/php/php- 5.2.5/ext/iconv/iconv.c:441: undefine d reference to `libiconv_open'
Re: [PHP] Getting part of string matched with regular expressions
Teck schreef: Hi, I'm trying to find a way to get part of a string where the part is matched with regular expressions. So, for example, if I have a string: a2b3cd5ef6ghi7232jklmn I need to grab 12b3cd5 using regular expressions and store the part in a variable. what are the rules for determining 12b3cd5 is what you want? do you want to match the exact string? do you want to match the length? the combination of letters and numbers? $match = array(); $res = preg_match(#^(\d{2}[a-z]\d[a-z]{2}\d).*#, 12b3cd5ef6ghi7232jklmn, $match); if ($res) var_dump($match); else echo no match.; the above code matches the beginning of a string that starts with 2 digits, followed by a lower case letter followed by a digit followed by 2 lower case letters followed by a digit followed by anything. $var = do_something(,,a2b3cd5ef6ghi7232jklmn); I was using preg_replace for this, and try to delete (i.e., replace the non-matched part with an empty string) the second part, but I can't make it work. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Getting part of string matched with regular expressions
Teck wrote: Hi, I'm trying to find a way to get part of a string where the part is matched with regular expressions. So, for example, if I have a string: a2b3cd5ef6ghi7232jklmn I need to grab 12b3cd5 using regular expressions and store the part in a variable. $var = do_something(,,a2b3cd5ef6ghi7232jklmn); I was using preg_replace for this, and try to delete (i.e., replace the non-matched part with an empty string) the second part, but I can't make it work. You can use backreferences in regular expressions. $var= preg_replace('/([a-z]+)/is','$1','azxcvjf937^88'); if($var==='azxcvjf') echo MATCH; http://php.net/manual/en/function.preg-replace.php look at Example1. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting nuequiz pro wo to work in php5
http://nuedream.com/nuequizpro/ I cant get the above product to work in php5. The product works in php4 but has problems with a $this variable in the database class with php5. Has anyone used the above product in php5 and found a way arround it ? Cheers Don - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
Re: [PHP] interface inheritance
Nathan Nobbe schreef: all, previously, on this list and elsewhere, i have raised the topic of interface inheritance, lamenting that php is void of the feature. to my utter amazement i discovered that php does in fact support interface inheritance, reading through some of Marcus Boergers' code in SPL.. i noticed RecursiveIterator extends Iterator, which is an internal interface (part of the zend engine), so i thought to myself, perhaps only internal interfaces can be extended, but then a quick test proved my suspicions wrong. in fact, interfaces can even extend multiple parent interfaces, just like java (*ducks*). here is the sample code so you can see for yourself: ?php interface Somethingable { public function doSomething(); } interface Crazyfiable { public function getCrazy(); } interface Extendable extends Somethingable, Crazyfiable { public function extend(); } class SuperClass implements Extendable { public function doSomething() { echo 'i did something ..' . PHP_EOL; } public function extend() { echo 'i extended something..' . PHP_EOL; } public function getCrazy() { echo 'im a crazy bastard now!' . PHP_EOL; } } /* * TEST HERE */ $sc = new SuperClass(); $sc-doSomething(); $sc-extend(); $sc-getCrazy(); ? and the output: [EMAIL PROTECTED] /usr/share/php5/splExperiment/tests $ php testInterfaceInheritence.php i did something .. i extended something.. im a crazy bastard now! i for one am quite excited. heres to happy adventures in oop-land w/ php! nice bit of info! as an aside, I often use php -r to test snippets like this e.g.: $ php -r 'echo foo!;' very handy and saves having to create a file everytime you test something, it does mean your forced to use double quotes only in the code (otherwise the shell misinterprets). I recommend using double quotes in snippets you post in order to make it easier for people to quickly test your gems for themselves :-) -nathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [SOVLED - ISH] Re: [PHP] pack it in
thanks to everyone for there info/feedback/help/etc - I have a somewhat better understanding of this pack/unpack/binary stuff now :-) Jochem Maas schreef: someone asked about checksum values in another thread, I believe he got his answer no thanks to me. but whilst I was trying to help I got stuck playing with pack/unpack. so now I have the broadbrush question of what would one use pack/unpack for? can anyone point at some realworld examples/code that might help me broaden my horizons? rds, jochem [ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting part of string matched with regular expressions
Teck wrote: I'm trying to find a way to get part of a string where the part is matched with regular expressions. So, for example, if I have a string: a2b3cd5ef6ghi7232jklmn I need to grab 12b3cd5 using regular expressions and store the part in a variable. Assuming you meant to grab '2b3cd5': $matches=preg_match( '/2b3cd5/',$text,$match ); $var=$match[0]; /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Posting Summary for Week Ending 25 January, 2008: php-general@lists.php.net
Zoltán Németh schreef: hey Dan, where is the stats for last week? the experiment is over or what? ;) ha, so I'm not the only one wanting to know how close to the truth my predictions for this weeks stat are ;-) greets Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting part of string matched with regular expressions
Teck wrote: Hi, I'm trying to find a way to get part of a string where the part is matched with regular expressions. So, for example, if I have a string: a2b3cd5ef6ghi7232jklmn I need to grab 12b3cd5 using regular expressions and store the part in a variable. how do you decide what the above quoted string is going to be? 1. Will is always be in the same position in the string? 2. Will the pattern always be the same? (##x#xx#) ? 3. Will you be supplying the patter or search string from an outside source? $var = do_something(,,a2b3cd5ef6ghi7232jklmn); I was using preg_replace for this, and try to delete (i.e., replace the non-matched part with an empty string) the second part, but I can't make it work. -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] i enconter a question when use Zend Framework's _foward function
Nathan Nobbe wrote: On Jan 27, 2008 10:01 PM, little btx [EMAIL PROTECTED] wrote: public function init() try{ $this-subject = new subject($subject_id); }catch (Zend_Exception $e) { $this-_forward('index','error',null,array('error'=$e-getMessage()); You are missing one parenthesis at the end of the above line } } when it catch the Zend_Exception ,the function _forward doesn't work please keep posts on list for the benefit of others. what is the precise error you receive when _forward() is called? also, what is the context of this code you have posted? are you extending a class from the zend framework? -nathan -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to prevent direct access..
Chuck wrote: I have a php file that produces an image and is only referred to from an img tag like so: img src=getRandImage.php I want to prevent anyone from directly accessing the getRandImage.php file. The file has to be world readable or the image will not display. I played around with testing $_SERVER['HTTP_REFERER'] using regular expressions but the above image tag appears in the default splash page and there is no http referer set when they first visit the site. (also ran into some IE quirkiness as well) I played around with putting getRandImage.php into a subdirectory that is only viewable by the user the web server is running as and the image also would not appear. I couldn't figure out a way to embed this into a function that could be hidden in a non-world readable subdirectory -- which would be my preferred approach. (Is there a way to call a php function that returns an image from within an img tag, instead of calling a php file?) I can easily check http request type but the img tag is doing a GET request which is also what request type is used if they try and directly access the URL. I'm sure its something simple I am overlooking. Maybe another $_SERVER variable or something I can work with. fyi: running php 5.2.5 and apache 2.2. Thanks for any help.. /CC I would do something like what Nathan said, but with a twist. From the page with the anchor tag, I would use a unique value in the image URL, but I would store that value in my session, along with a timestamp of when it was generated. Then, in the getRandImage.php script, I would check to see if the unique value in the session exists? if no, then boot them else then check to see if it is expired. if yes, boot them, else display random image and delete unique value and timestamp. Then, it doesn't matter if they access the URL directly, if they do, they won't have a value in there session. Because the only place that the value gets set is in the original calling HTML page. -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Posting Summary for Week Ending 25 January, 2008: php-general@lists.php.net
hey Dan, where is the stats for last week? the experiment is over or what? ;) greets Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting nuequiz pro wo to work in php5
On Mon, 2008-01-28 at 11:49 -0500, Nathan Nobbe wrote: ive always thought about trying moodle for this purpose. Not to rag Moodle or anything, but trying to customize that thing is a nightmare. Besides, if you are willing to try out Chisimba, you can always ask me :) There is a test install at http://pear.uwc.ac.za/elearn/ that you can play around with. The admin username and password are available too (just mail me) if you want to take an in depth look. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Posting Summary for Week Ending 25 January, 2008:php-general@lists.php.net
[snip] where is the stats for last week? the experiment is over or what? ;) [/snip] There are no stats for last week because I participated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: how dod you get to do multiple mysql queries concurrently?
On Sat, January 26, 2008 3:22 am, Per Jessen wrote: Yeah, but that's just like running off-line reports and having them sent by email. It kind of ruins the idea of having the information available on-line in real-time. All depends how you define real :-) A lot of times, in a web app, the difference between now and five minutes ago is pretty meaningless to the end user. Of course, a lot of times, it's all the difference in the world. :-) Knowing which is which can make a real dog of an application in a speed demon... But later posts make it sound like you've already done this bit... :-v -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to prevent direct access..
On Sun, January 27, 2008 6:38 pm, Chuck wrote: I have a php file that produces an image and is only referred to from an img tag like so: img src=getRandImage.php I want to prevent anyone from directly accessing the getRandImage.php file. The file has to be world readable or the image will not display. I played around with testing $_SERVER['HTTP_REFERER'] using regular expressions but the above image tag appears in the default splash page and there is no http referer set when they first visit the site. (also ran into some IE quirkiness as well) I played around with putting getRandImage.php into a subdirectory that is only viewable by the user the web server is running as and the image also would not appear. I couldn't figure out a way to embed this into a function that could be hidden in a non-world readable subdirectory -- which would be my preferred approach. (Is there a way to call a php function that returns an image from within an img tag, instead of calling a php file?) You can set some kind of cookie in the previous page, and then check that they have the cookie... Or you can require some kind of login to get to the image -- same technique. Referer is useless. Not all browsers send it; and it's far too easy to fake. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Posting Summary for Week Ending 25 January, 2008:php-general@lists.php.net
Jay Blanchard schreef: [snip] where is the stats for last week? the experiment is over or what? ;) [/snip] There are no stats for last week because I participated. any way you cut it Richard wins ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using CURLOPT_TIMEOUT_MS correctly?
T'he behavior I'm experiencing from using this option (CURLOPT_CONNECTTIMEOUT_MS, also) is strange. Here is a code snippet: -- $c = curl_init(www.google.com); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_FOLLOWLOCATION, true); curl_setopt($c, CURLOPT_TIMEOUT_MS, 500); $resp = curl_exec($c); -- This ALWAYS returns an errno 28 (Timeout was reached) for ANY URL that I try. The only way I can get it to work is if I set the MS timeout value = 1000. I can set it to 999 and it immediately fails, but bump it up to 1000 and everything is fine. Is anyone else seeing this behavior? -- My PHP- PHP 5.2.5 (cli) (built: Jan 24 2008 17:17:05) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies My cURL- curl 7.17.1 (i686-pc-linux-gnu) libcurl/7.17.1 OpenSSL/0.9.7e zlib/1.2.2 Protocols: tftp ftp telnet dict ldap http file https ftps Features: IPv6 Largefile NTLM SSL libz -- Thanks for any help you can provide. -Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Posting Summary for Week Ending 25 January, 2008: php-general@lists.php.net
On Mon, 2008-01-28 at 16:43 +0100, Zoltán Németh wrote: where is the stats for last week? the experiment is over or what? ;) Jochem already did it for this week, so I think Dan is taking the week off. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting nuequiz pro wo to work in php5
On Jan 28, 2008 11:35 AM, Jim Lucas [EMAIL PROTECTED] wrote: Well, since this quiz app doesn't work. Does anybody have suggestions on a good tool to use for in-house/office training? Sort of like an employee initial training or evaluation quiz application. Guess it doesn't have to be just for employment purposes, but something that works with PHP5. ive always thought about trying moodle for this purpose. -nathan
[PHP] Setting session from within iframe?
I have a problem that maybe someone can shed some light on. I have a page, lets say it is located here... www.domain1.com On this page is a iframe with a src like so... www.domain2.com/mypage.php This php page has a session _start call in it. The problem is, the session cookie is not set when the php is called into an iframe. The session_id changes each time the iframe is refreshed. If I go to the page directly, then the cookie is set (and stays set). This happens in Safari, not FF. Is there some sort of bug that will not allow session cookies to be set when a page is called from an iframe? I have heard IE does this as well? -- Mike B^) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting nuequiz pro wo to work in php5
Don Don wrote: http://nuedream.com/nuequizpro/ I cant get the above product to work in php5. The product works in php4 but has problems with a $this variable in the database class with php5. Has anyone used the above product in php5 and found a way arround it ? Cheers Don - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. Well, just on a whim, I tried to install it and see what this app was all about. Been looking for a quiz style software app for the office training program. I fixed the $this error just be returning instead of reassigning the variable, but there are many other problems with the code for this app besides the error you mention. Every time I fixed an error, two more came up. After 10 minutes of fixes, I gave up. I can see this snowballing into a nice big project. Well, since this quiz app doesn't work. Does anybody have suggestions on a good tool to use for in-house/office training? Sort of like an employee initial training or evaluation quiz application. Guess it doesn't have to be just for employment purposes, but something that works with PHP5. -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how dod you get to do multiple mysql queries concurrently?
On Mon, 2008-01-28 at 12:29 -0600, Richard Lynch wrote: Back on the mysql side of things, try using geometry columns rather than numerical primary keys, with spatial indexes.. it's a MASSIVE performance upgrade (I've cut 5 second queries down to 0.005 by using geo columns) Uh, could you could elaborate a bit on that (whilst I go and do some googling)? If you are doing geography/geometry stuff, spatial indices can be nice. I suspect that massive performance upgrade just came from having what is essentially a multi-field index, because MySQL can only use *ONE* index per query. Yeah, for sure! You will need to use GEOS to index those rows. Also, if your database is getting large, consider switching to PostGIS on Postgres, as opposed to MySQL. The MySQL spatial extension is still quite new and immature compared to PostGIS. I routinely create and manage databases of over 10 million rows of spatial data on PostGIS, and have never needed to look further. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: how do you get to do multiple mysql queries concurrently?
On Sat, January 26, 2008 3:32 am, Per Jessen wrote: Richard Lynch wrote: Process forking has EVERYTHING to do with thread safety. Whatever is going to go wrong in a threaded environment is going to also go wrong when you fork the process, almost for sure. Forking a process and creating a thread are really two very different concepts (from a programming pov). In a threaded environment you often have e.g. semaphores and mutexes to coordinate access to shared data. When you've forked a process, you share data over IPC or similar. When you create a new thread, it has access to global scope variables in the main tread. It has access to shared heap storage. None of this applies to a forked process. That all depends on which implementation of threading you are using... And, ultimately, if the program wasn't written correctly to handle being forked/threaded it's gonna crash... Whether it's two threads or two processes trying to utilize the same resource as it they had exclusive access when they don't, you end up in the same position... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how dod you get to do multiple mysql queries concurrently?
Richard Lynch wrote: On Sat, January 26, 2008 3:45 am, Per Jessen wrote: Nathan Rixham wrote: Back on the mysql side of things, try using geometry columns rather than numerical primary keys, with spatial indexes.. it's a MASSIVE performance upgrade (I've cut 5 second queries down to 0.005 by using geo columns) Uh, could you could elaborate a bit on that (whilst I go and do some googling)? If you are doing geography/geometry stuff, spatial indices can be nice. OK, what is a 'geometry column' and what is a 'spatial index' ? /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how dod you get to do multiple mysql queries concurrently?
Richard Lynch wrote: When you create a cursor, it's like a handle to a running query in the background process, and returns immediately. Create three cursors, and you SHOULD have them running in parallel. Ah, I see. Hmm, interesting idea. Although it won't be much good as I'm not actually fetching a lot of rows. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how dod you get to do multiple mysql queries concurrently?
On Sat, January 26, 2008 3:45 am, Per Jessen wrote: Nathan Rixham wrote: I posted you a short script on this thread at 04:07 GMT today that'll get you multithreading (via cli) - but even then you can shell exec that cli script from apache.. Yeah, I noticed, thanks. The thing is - once pcntl_fork() is added to the mix, it's getting a little too complicated for what was otherwise a simple php web-application. I'm thinking I'm probably better off with my iframe-rpc stuff. Back on the mysql side of things, try using geometry columns rather than numerical primary keys, with spatial indexes.. it's a MASSIVE performance upgrade (I've cut 5 second queries down to 0.005 by using geo columns) Uh, could you could elaborate a bit on that (whilst I go and do some googling)? If you are doing geography/geometry stuff, spatial indices can be nice. I suspect that massive performance upgrade just came from having what is essentially a multi-field index, because MySQL can only use *ONE* index per query. If your where and/or order by force MySQL to pick among several possible indices, it can get ugly fast. If you have an index with all the data it needs for both where and order by clauses, it will (usually) pick the right one, and have USEFUL indices, instead of not-so-useful indices. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how dod you get to do multiple mysql queries concurrently?
On Sat, January 26, 2008 3:17 am, Per Jessen wrote: Richard Lynch wrote: On Fri, January 25, 2008 3:35 am, Per Jessen wrote: I have a website where some of the pages require several mysql queries - they're independent, so in principle they could easily be run in parallel. Has anyone looked at doing that? If MySQL has implemented cursors in some new version, you have just described a cursor... There may be something else in MySQL to do this, mind you, but that's the easiest way I know of in other DBs... cursors exist in mysql too, but I don't quite see how I could use them to run two queries concurrently? Also, these queries don't return a lot of data. When you create a cursor, it's like a handle to a running query in the background process, and returns immediately. Create three cursors, and you SHOULD have them running in parallel. The overhead of a cursor may be more than you save for fast queries though... Or maybe not, as a cursor should not have THAT much overhead. Only used them in PostgreSQL and SQL Server/Sybase, though, so don't know for sure about MySQl. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Exception thrown without a stack frame
On Sat, January 26, 2008 2:43 am, Nathan Rixham wrote: way offf topic-ish here.. class destructors, surely they differ from the register_shutdown_function in execution style? seeing as one can echo / do a bit of jiggery pokery before the buffers close. what exactly is the difference? I dunno... I guess class destructors get called early in the shutdown sequence, and shutdown functions get called later... Use the source, Luke: http://lxr.php.net/ -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] determine file-upload's tmp-filename
On Sat, January 26, 2008 5:57 pm, Michael Fischer wrote: hi there, is there a way to determine the tmp-filename of a file upload while the upload is still in progress? the tmp-file is stored in /tmp and it's name is something like PHP. what i would like to do is: i want to upload a file via a html-form and while the upload is in progress make repeatedly ajax-requests to a php-script on the server that replies the size of the tmp file (the amount of data that was already uploaded). So in this script i need to know what the tmp-filename is. or do you think this is a completely useless approach? Google for PHP upload meter instead. That's probably how it works, more or less... I still think it's STOOPID to round-trip back and forth to the server to get an upload progress meter -- The browser developers should be providing you with some kind of progress notification system locally! -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] determine file-upload's tmp-filename
On Mon, 2008-01-28 at 12:17 -0600, Richard Lynch wrote: On Sat, January 26, 2008 5:57 pm, Michael Fischer wrote: hi there, is there a way to determine the tmp-filename of a file upload while the upload is still in progress? the tmp-file is stored in /tmp and it's name is something like PHP. what i would like to do is: i want to upload a file via a html-form and while the upload is in progress make repeatedly ajax-requests to a php-script on the server that replies the size of the tmp file (the amount of data that was already uploaded). So in this script i need to know what the tmp-filename is. or do you think this is a completely useless approach? Google for PHP upload meter instead. That's probably how it works, more or less... I still think it's STOOPID to round-trip back and forth to the server to get an upload progress meter -- The browser developers should be providing you with some kind of progress notification system locally! well, i agree with you - the browser should provide some sort of functionality to find out the amount of data already sent. but i don't know any browser that does. all the php upload meters that i found on google either require to patch php or use perl. lg, Michi -- Sautergasse 27-29/35 1160 Wien phone: 0043 650 2526276 email: [EMAIL PROTECTED] web: http://www.webfischer.at -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hex Strings Appended to Pathnames
On Sun, January 27, 2008 7:57 am, Mick wrote: Operating System: CentOS 4.6 PHP Version: 4.3.9-3.22.9 Zend Optimizer (free) version: 3.2.6 Hello. I've got somewhat of a strange problem here involving Squirrelmail. Basically, what is happening is that one of our customers is logged out of his Squirrelmail session at random intervals. This can occur when he goes to read an email or, after composing an email, when he clicks on the Send button. The following log entries correspond with those times that the customer is logged out. [error] [client X.X.X.X] File does not exist: /var/www/squirrelmail/src/redirect.php3a5def33 [error] [client X.X.X.X] File does not exist: /var/www/squirrelmail/src/redirect.php29e09f87 [error] [client X.X.X.X] File does not exist: /var/www/squirrelmail/src/move_messages.phpf9f96dfb [error] [client X.X.X.X] File does not exist: /var/www/squirrelmail/src/redirect.phpdc6cc80a So what would be the cause of appending those hex strings to those pathnames? You'll probably have to ask the squirrelMail guy... Unless you can reproduce it with other applications, it's not in PHP itself, probably. PS I'm a squirrelMail user, and I get logged out a lot too. :-( -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] htmlentities() does not remove escape
On Sun, January 27, 2008 12:27 pm, jekillen wrote: Hello: I have a form that has a textarea and I do not want to disallow the use of single quote as apostrophe, or for any other normal stylization. So I am using html entities to change these characters into html entities. But the function does not remove the escapes added by the browser when sending the input. Is there a special function in php for removing the \ escapes as well? My plan b would be to look for a similar function in javascript and convert to html entities before the input is sent to the server. I want to screen for damaging code but do not want to prevent legitimate use of punctuation. If the input in the text field is then displayed as html (which it will be) I do not want things like 'It\'s a nice day' showing up in the html. If you are using htmlentities (et al) correctly, you should not get an extra \ in the browser, not even in the textarea, and most especially not coming back into your input $_POST data. Check that you don't have Magic Quotes on as well as using mysql_real_escape_string. Also check that you aren't doing htmlentities/htmlspecialchars twice. Somewhere, somehow, you're probably adding an EXTRA \ in your code. If you have to use stripslashes() you've done something wrong in the first place... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Fwd: Posting Summary for Week Ending 25 January, 2008: [EMAIL PROTECTED]
Whoops :-x The odd thing is, the characters came out fine during the tests, and because some changes were made to the script during the week, some people will show up two or more times (read: people with non-English characters in their names). I've been pretty sick all week, so I haven't really worked on it at all. Once I get the bugs worked out and the scripts cleaned up, I'll post the source and database. For now, I'm going back to bed Posting Summary for PHP-General List Week Ending: Friday, 25 January, 2008 Messages| Bytes | Sender ++-- 567 (100%) 1420607 (100%) EVERYONE 77 (13.6%) 113559 (8%)Richard Lynch ceo at l-i-e dot com 56 (9.9%) 73653 (5.2%) Nathan Nobbe quickshiftin at gmail dot com 51 (9%)82210 (5.8%) Jochem Maas jochem at iamjochem dot com 34 (6%)74332 (5.2%) Eric Butera eric dot butera at gmail dot com 29 (5.1%) 42938 (3%)Daniel Brown parasane at gmail dot com 23 (4.1%) 35023 (2.5%) Dotan Cohen dotancohen at gmail dot com 22 (3.9%) 36344 (2.6%) Robert Cummings robert at interjinn dot com 19 (3.4%) 12639 (0.9%) Per Jessen per at computer dot org 18 (3.2%) 27591 (1.9%) Jason Pruim japruim at raoset dot com 17 (3%)19199 (1.4%) Chris dmagick at gmail dot com 12 (2.1%) 29497 (2.1%) Zoltán NÃ(c)meth znemeth at alterationx dot hu 10 (1.8%) 11840 (0.8%) David Powers Email Removed 8 (1.4%) 12421 (0.9%) nihilism machine nihilismmachine at gmail dot com 8 (1.4%) 7667(0.5%) Apple applepro at gmail dot com 6 (1.1%) 8460(0.6%) Stut stuttle at gmail dot com 6 (1.1%) 25309 (1.8%) Wolf LoneWolf at nc dot rr dot com 6 (1.1%) 19482 (1.4%) Jay Blanchard jblanchard at pocket dot com 6 (1.1%) 9857(0.7%) Nathan Rixham nrixham at gmail dot com 5 (0.9%) 9818(0.7%) Bastien Koert bastien_k at hotmail dot com 5 (0.9%) 9964(0.7%) Tom Ray [Lists] lists at blazestudios dot com 5 (0.9%) 3100(0.2%) Floor Terra floort at gmail dot com 5 (0.9%) 6743(0.5%) Jim Lucas lists at cmsws dot com 5 (0.9%) 4849(0.3%) mike mike503 at gmail dot com 5 (0.9%) 21985 (1.5%) AndrÃ(c)s Robinet agrobinet at bestplace dot biz 5 (0.9%) 3583(0.3%) Colin Guthrie gmane at colin dot guthr dot ie 4 (0.7%) 5240(0.4%) Paul Scott pscott at uwc dot ac dot za 4 (0.7%) 3486(0.2%) Richard Heyes richardh at phpguru dot org 4 (0.7%) 3920(0.3%) Alain Roger raf dot news at gmail dot com 4 (0.7%) 54333 (3.8%) mattias mj at mjw dot se 4 (0.7%) 5407(0.4%) Thijs Lensselink dev at lenss dot nl 3 (0.5%) 4161(0.3%) Tor Vidvei tor dot vidvei at event dot no 3 (0.5%) 4169(0.3%) Dave Goodchild buddhamagnet at gmail dot com 3 (0.5%) 7109(0.5%) James Ausmus james dot ausmus at gmail dot com 3 (0.5%) 1883(0.1%) Pastor Steve smarquez at ccfortsmith dot com 3 (0.5%) 7054(0.5%) Andrew Ballard aballard at gmail dot com 3 (0.5%) 2781(0.2%) Luc Maltier lmaltier at lcandco dot com 3 (0.5%) 3512(0.2%) Casey heavyccasey at gmail dot com 3 (0.5%) 3445(0.2%) Marcus marcus dot k79 at arcor dot de 3 (0.5%) 3875(0.3%) Al news at ridersite dot org 3 (0.5%) 3690(0.3%) Børge Holen borge at arivene dot net 3 (0.5%) 1751(0.1%) Emil Edeholt emil at knmedical dot se 3 (0.5%) 10211 (0.7%) Keith Roberts keith at karsites dot net 2 (0.4%) 4396(0.3%) shiplu shiplu dot net at gmail dot com 2 (0.4%) 3808(0.3%) Rob rrichards at php dot net 2 (0.4%) 1729(0.1%) Roberto Mansfield robertom at sas dot upenn dot edu 2 (0.4%) 2829(0.2%) Peter Jackson tasmaniac at iprimus dot com dot au 2 (0.4%) 2897(0.2%) Dan frozendice at gmail dot com 2 (0.4%) 272188 (19.2%) Earn More Moneyrsjtql at yahoo dot com dot my 2 (0.4%) 201342 (14.2%) Improve Your Life Styleukxtmz at blue dot url dot com
Re: [PHP] Re: how do you get to do multiple mysql queries concurrently?
Richard Lynch wrote: On Sat, January 26, 2008 3:32 am, Per Jessen wrote: In a threaded environment you often have e.g. semaphores and mutexes to coordinate access to shared data. When you've forked a process, you share data over IPC or similar. When you create a new thread, it has access to global scope variables in the main tread. It has access to shared heap storage. None of this applies to a forked process. That all depends on which implementation of threading you are using... Very true. What I described is posix threading in linux as well as the general idea of threading found in MVS/zOS. And, ultimately, if the program wasn't written correctly to handle being forked/threaded it's gonna crash... Also true. But that's like saying an incorrectly written for-loop will crash :-) Whether it's two threads or two processes trying to utilize the same resource as it they had exclusive access when they don't, you end up in the same position... True again. However, I was commenting on your assertion that Process forking has EVERYTHING to do with thread safety, which I will stay is wrong. When you fork another process, you don't need to worry about whether your code is thread-safe or not. You don't have to be reentrant, you could even use self-modifying code if you felt the urge. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] determine file-upload's tmp-filename
This is the info available to upload scripts I have not done this, but am inspired to do it now. My design is to develop my own meter by compare $FILES;'size'] to the actual size on disk as the file uploads; I would use some sort of JavaScript / Ajax service connection so that the upload meter is displayed in the current browsing window or an upload popup. $_FILES['userfile']['name'] $_FILES['userfile']['type'] $_FILES['userfile']['size'] $_FILES['userfile']['tmp_name'] $_FILES['userfile']['error'] -Original Message- From: Michael Fischer [mailto:[EMAIL PROTECTED] Sent: Monday, January 28, 2008 2:50 PM To: php-general Subject: Re: [PHP] determine file-upload's tmp-filename On Mon, 2008-01-28 at 12:17 -0600, Richard Lynch wrote: On Sat, January 26, 2008 5:57 pm, Michael Fischer wrote: hi there, is there a way to determine the tmp-filename of a file upload while the upload is still in progress? the tmp-file is stored in /tmp and it's name is something like PHP. what i would like to do is: i want to upload a file via a html-form and while the upload is in progress make repeatedly ajax-requests to a php-script on the server that replies the size of the tmp file (the amount of data that was already uploaded). So in this script i need to know what the tmp-filename is. or do you think this is a completely useless approach? Google for PHP upload meter instead. That's probably how it works, more or less... I still think it's STOOPID to round-trip back and forth to the server to get an upload progress meter -- The browser developers should be providing you with some kind of progress notification system locally! well, i agree with you - the browser should provide some sort of functionality to find out the amount of data already sent. but i don't know any browser that does. all the php upload meters that i found on google either require to patch php or use perl. lg, Michi -- Sautergasse 27-29/35 1160 Wien phone: 0043 650 2526276 email: [EMAIL PROTECTED] web: http://www.webfischer.at -- 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] php installation problem
Perhaps you don't have iconv and/or iconv-devel installed on the second box? On Sun, January 27, 2008 2:54 am, Umar wrote: Dear Members! I have installed php-5.2.5 on slackware 12.0 with these option successfully ./configure --prefix=/usr/local/php --with-apxs=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --with-pcre-regex --with-layout=GNU --enable-sysvshm --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-exif --enable-ftp --enable-safe-mode --enable-bcmath --disable-debug --enable-sockets --enable-force-cgi-redirect --with-gettext --with-zlib --with-gd --enable-gd-native-ttf --disable-rpath --enable-mbregex --with-bz2 --with-mime-magic --enable-calendar --enable-inline-optimization --enable-magic-quotes --enable-wddx=shared --with-ncurses=shared --with-xmlrpc --with-regex=system --with-pear --with-curl --with-gmp --with-png-dir=/usr/local --enable-mbstring --with-jpeg-dir=/usr/local --with-pic --with-mm=/usr/local --with-libexpat-dir=/usr/local --with-xsl=/usr/local --with-mcrypt --with-mhash --with-ldap=/usr/local/ldap Now I am trying to install php-5.2.5 on another slackware 12.0 with same options but i got error on make ext/gd/libgd/.libs/gdkanji.o: In function `do_convert': /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/gd/libgd/gdkanji.c:350: und efined reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/gd/libgd/gdkanji.c:365: und efined reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/gd/libgd/gdkanji.c:381: und efined reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `_php_iconv_strlen': /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:603: undefine d reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:626: undefine d reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:660: undefine d reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `php_iconv_string': /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:441: undefine d reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:453: undefine d reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:467: undefine d reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:478: undefine d reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `_php_iconv_strpos': /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:851: undefine d reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:879: undefine d reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:993: undefine d reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `_php_iconv_appendl': /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:348: undefine d reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:385: undefine d reference to `libiconv' ext/iconv/.libs/iconv.o: In function `_php_iconv_substr': /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:723: undefine d reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:747: undefine d reference to `libiconv' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:802: undefine d reference to `libiconv_close' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:806: undefine d reference to `libiconv_close' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:755: undefine d reference to `libiconv_open' ext/iconv/.libs/iconv.o: In function `_php_iconv_mime_decode': /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:1354: undefin ed reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:1465: undefin ed reference to `libiconv_close' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:1468: undefin ed reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:1823: undefin ed reference to `libiconv_close' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:1826: undefin ed reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `php_iconv_stream_filter_dtor': /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:2465: undefin ed reference to `libiconv_close' ext/iconv/.libs/iconv.o: In function `_php_iconv_mime_encode': /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:1043: undefin ed reference to `libiconv_open' /home/data/pkgs_docs/unix-pkgs/web/php/php-5.2.5/ext/iconv/iconv.c:1057: undefin ed reference to `libiconv_open'
Re: [PHP] determine file-upload's tmp-filename
On Jan 28, 2008 2:50 PM, Michael Fischer [EMAIL PROTECTED] wrote: well, i agree with you - the browser should provide some sort of functionality to find out the amount of data already sent. but i don't know any browser that does. all the php upload meters that i found on google either require to patch php or use perl. its a shame javascript cant hook into the local filesystem, but i think its just a matter of time until we get there. http://labs.mozilla.com/2007/10/prism/ anyway im pretty sure you can get this effect w/ a flash plugin, that is a progress meter that doesnt have to poll the webserver for status info, if thats what ur after.. -nathan
Re: [PHP] Setting session from within iframe?
On Mon, January 28, 2008 10:37 am, Mike Yrabedra wrote: I have a problem that maybe someone can shed some light on. I have a page, lets say it is located here... www.domain1.com On this page is a iframe with a src like so... www.domain2.com/mypage.php This php page has a session _start call in it. The problem is, the session cookie is not set when the php is called into an iframe. The session_id changes each time the iframe is refreshed. There is a timing issue here, perhaps: If the browser has not received the cookie header for the main page, it can't send them for the iframe. If it doesn't send them, you can't tell it's the same user. You'll have to have the cookie sent on a previous non-iframe page, or have the iframed page re-direct to a non-session version when there is no cookie, or... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting nuequiz pro wo to work in php5
On Mon, 2008-01-28 at 08:35 -0800, Jim Lucas wrote: Well, since this quiz app doesn't work. Does anybody have suggestions on a good tool to use for in-house/office training? Sort of like an employee initial training or evaluation quiz application. Guess it doesn't have to be just for employment purposes, but something that works with PHP5. Well, you could always help test and evaluate the Chisimba e-learning stuff, due for release at end of March. The quiz stuff I think is complete, and should be usable now. http://avoir.uwc.ac.za/ and go to the Chisimba section. Oh, hang on, you will need an anonymous CVS checkout to actually use the v2 stuff now. sigh, will be released as a RC next week. --Paul All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] determine file-upload's tmp-filename
The name of the upload tmp file MUST be known. If the $_FILES[] is not available until the upload completes; perhaps a kludge is to set a unique upload_tmp_dir, for the session, that will only contain the upload for this user in this session. There will only be one file to monitor with filesize(). * Now the server can know the destination filename. The form will have to have an OnClick method that passes the srcfilesize to the php service who stores it in a session variable. The existence of the session variable enables the connection to the service and the discovery of the location of the special upload directory The service will just service requests for the filesize. That's half the problem solved. The other half is to make the srcfilesize available to the client JavaScript. -Original Message- From: Michael Fischer [mailto:[EMAIL PROTECTED] Sent: Monday, January 28, 2008 3:51 PM To: 'php-general' Subject: RE: [PHP] determine file-upload's tmp-filename On Mon, 2008-01-28 at 15:34 -0500, Mr Webber wrote: On Mon, 2008-01-28 at 12:17 -0600, Richard Lynch wrote: On Sat, January 26, 2008 5:57 pm, Michael Fischer wrote: hi there, is there a way to determine the tmp-filename of a file upload while the upload is still in progress? the tmp-file is stored in /tmp and it's name is something like PHP. what i would like to do is: i want to upload a file via a html-form and while the upload is in progress make repeatedly ajax-requests to a php-script on the server that replies the size of the tmp file (the amount of data that was already uploaded). So in this script i need to know what the tmp-filename is. or do you think this is a completely useless approach? Google for PHP upload meter instead. That's probably how it works, more or less... I still think it's STOOPID to round-trip back and forth to the server to get an upload progress meter -- The browser developers should be providing you with some kind of progress notification system locally! well, i agree with you - the browser should provide some sort of functionality to find out the amount of data already sent. but i don't know any browser that does. all the php upload meters that i found on google either require to patch php or use perl. I have not done this, but am inspired to do it now. My design is to develop my own meter by compare $FILES;'size'] to the actual size on disk as the file uploads; I would use some sort of JavaScript / Ajax service connection so that the upload meter is displayed in the current browsing window or an upload popup. $_FILES['userfile']['name'] $_FILES['userfile']['type'] $_FILES['userfile']['size'] $_FILES['userfile']['tmp_name'] $_FILES['userfile']['error'] two problems: - the $_FILES array becomes available when the file-upload is complete. that's too late. - how do you determine the actual size on the disk of the uploaded file, while the upload is in progress? lg, Michi -- Sautergasse 27-29/35 1160 Wien phone: 0043 650 2526276 email: [EMAIL PROTECTED] web: http://www.webfischer.at -- 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] determine file-upload's tmp-filename
On Mon, 2008-01-28 at 15:26 -0500, Nathan Nobbe wrote: On Jan 28, 2008 2:50 PM, Michael Fischer [EMAIL PROTECTED] wrote: well, i agree with you - the browser should provide some sort of functionality to find out the amount of data already sent. but i don't know any browser that does. all the php upload meters that i found on google either require to patch php or use perl. its a shame javascript cant hook into the local filesystem, but i think its just a matter of time until we get there. http://labs.mozilla.com/2007/10/prism/ anyway im pretty sure you can get this effect w/ a flash plugin, that is a progress meter that doesnt have to poll the webserver for status info, if thats what ur after.. -nathan hm, i think that access to the local filesystem in javascript would be a serious security issue. it would be enough if the browser knew how much data it has already sent. i know all the solutions in flash and java - they require the user to have some kind of browser-plugin installed. it's not so much that i need this desperately for a project - i just tried to do an upload-meter out of interest and hit that problem. lg, Michi -- Sautergasse 27-29/35 1160 Wien phone: 0043 650 2526276 email: [EMAIL PROTECTED] web: http://www.webfischer.at -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] curl timeout vs socket timeout
Ravi Menon wrote: Hi, We have two versions of client code, one using curl, and other one using raw sockets via fsockopen(), and we use the following code to set the i/o timeouts: 1) curl: . . curl_setopt( $handle, CURLOPT_TIMEOUT, 1 ); From the manual CURLOPT_TIMEOUT The maximum number of seconds to allow cURL functions to execute. Notice: functions, I would take this as the entire process. . . $resp = curl_exec($handle) 2) sockets: stream_set_timeout( $sock, 1); From the manual Set timeout period on a stream This would tell me that it is on the entire process, not just one function call like fwrite() or fread(). Here we use frwrite() and fread() to send the request and read the response respectively. In (1), how is the timeout applied - is it: a) timeout includes the entire curl_exec() call - the combined socket write() ( to send the request ) and the read() ( read the response ) calls. or True for both b) timeout is independently applied to write() and read() end respectively. False for both Some of our tests seem to indicate it is (a). In (2), I am assuming the stream timeout is applied at each i/o call independently for fwrite() and fread() - I am pretty much certain on this as this is how it would map to underlying C calls. It will be good to get a confirmation on our doubts. Thanks, Ravi This is what I have experienced at least. -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] determine file-upload's tmp-filename
Michael Fischer wrote: On Mon, 2008-01-28 at 15:34 -0500, Mr Webber wrote: On Mon, 2008-01-28 at 12:17 -0600, Richard Lynch wrote: On Sat, January 26, 2008 5:57 pm, Michael Fischer wrote: hi there, is there a way to determine the tmp-filename of a file upload while the upload is still in progress? the tmp-file is stored in /tmp and it's name is something like PHP. what i would like to do is: i want to upload a file via a html-form and while the upload is in progress make repeatedly ajax-requests to a php-script on the server that replies the size of the tmp file (the amount of data that was already uploaded). So in this script i need to know what the tmp-filename is. or do you think this is a completely useless approach? Google for PHP upload meter instead. That's probably how it works, more or less... I still think it's STOOPID to round-trip back and forth to the server to get an upload progress meter -- The browser developers should be providing you with some kind of progress notification system locally! well, i agree with you - the browser should provide some sort of functionality to find out the amount of data already sent. but i don't know any browser that does. all the php upload meters that i found on google either require to patch php or use perl. I have not done this, but am inspired to do it now. My design is to develop my own meter by compare $FILES;'size'] to the actual size on disk as the file uploads; I would use some sort of JavaScript / Ajax service connection so that the upload meter is displayed in the current browsing window or an upload popup. $_FILES['userfile']['name'] $_FILES['userfile']['type'] $_FILES['userfile']['size'] $_FILES['userfile']['tmp_name'] $_FILES['userfile']['error'] two problems: - the $_FILES array becomes available when the file-upload is complete. that's too late. exactly right! - how do you determine the actual size on the disk of the uploaded file, while the upload is in progress? he is probably talking about the amount of data that has been uploaded so far. The size of the tmp file would reflect that amount. lg, Michi I would create your own perl/cgi up-loader that runs like the perl version. I would run it from (x)inetd, or something similar. I have created a number of socket servers that run 24/7 on my server with no glitches. Because of the size of data and the connection duration, I would suggest forking the parent for every child connection that comes in. But then have that child process report what it needs to a database, or temp data file. The incoming TCP connection will report the payload size and from that you can then figure the rest out. You would have to handle all the data connections, creating the tmp_file and such, but it would all be possible. I have been thinking about doing this myself and soon. -- Jim Lucas Some men are born to greatness, some achieve greatness, and some have greatness thrust upon them. Twelfth Night, Act II, Scene V by William Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Posting Summary for Week Ending 25 January, 2008: php-general@lists.php.net
On Jan 28, 2008, at 11:26 AM, Jochem Maas wrote: Zoltán Németh schreef: hey Dan, where is the stats for last week? the experiment is over or what? ;) ha, so I'm not the only one wanting to know how close to the truth my predictions for this weeks stat are ;-) Oh, I'm interested... :) Just haven't sent an e-mail about it yet... Least not until I hit send. -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] curl timeout vs socket timeout
Hi, We have two versions of client code, one using curl, and other one using raw sockets via fsockopen(), and we use the following code to set the i/o timeouts: 1) curl: . . curl_setopt( $handle, CURLOPT_TIMEOUT, 1 ); . . $resp = curl_exec($handle) 2) sockets: stream_set_timeout( $sock, 1); Here we use frwrite() and fread() to send the request and read the response respectively. In (1), how is the timeout applied - is it: a) timeout includes the entire curl_exec() call - the combined socket write() ( to send the request ) and the read() ( read the response ) calls. or b) timeout is independently applied to write() and read() end respectively. Some of our tests seem to indicate it is (a). In (2), I am assuming the stream timeout is applied at each i/o call independently for fwrite() and fread() - I am pretty much certain on this as this is how it would map to underlying C calls. It will be good to get a confirmation on our doubts. Thanks, Ravi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hex Strings Appended to Pathnames
Mick wrote: Operating System: CentOS 4.6 PHP Version: 4.3.9-3.22.9 Zend Optimizer (free) version: 3.2.6 Hello. I've got somewhat of a strange problem here involving Squirrelmail. Basically, what is happening is that one of our customers is logged out of his Squirrelmail session at random intervals. This can occur when he goes to read an email or, after composing an email, when he clicks on the Send button. The following log entries correspond with those times that the customer is logged out. [error] [client X.X.X.X] File does not exist: /var/www/squirrelmail/src/redirect.php3a5def33 [error] [client X.X.X.X] File does not exist: /var/www/squirrelmail/src/redirect.php29e09f87 [error] [client X.X.X.X] File does not exist: /var/www/squirrelmail/src/move_messages.phpf9f96dfb [error] [client X.X.X.X] File does not exist: /var/www/squirrelmail/src/redirect.phpdc6cc80a They sort of look partially like a session id but that's just a wild guess. You're better off asking the squirrelmail list(s) though. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: how dod you get to do multiple mysql queries concurrently?
Richard Lynch wrote: On Sat, January 26, 2008 3:22 am, Per Jessen wrote: Yeah, but that's just like running off-line reports and having them sent by email. It kind of ruins the idea of having the information available on-line in real-time. All depends how you define real :-) A lot of times, in a web app, the difference between now and five minutes ago is pretty meaningless to the end user. Well, there isn't much difference between an OLTP user and a web-app user. Any transaction lasting less than 3 seconds is considered real-time or inter-active. Anything that takes longer is batch. Cached transactions are a little foreign in an OLTP environment, but they're essentially still classed as batch. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] determine file-upload's tmp-filename
On Mon, 2008-01-28 at 15:34 -0500, Mr Webber wrote: On Mon, 2008-01-28 at 12:17 -0600, Richard Lynch wrote: On Sat, January 26, 2008 5:57 pm, Michael Fischer wrote: hi there, is there a way to determine the tmp-filename of a file upload while the upload is still in progress? the tmp-file is stored in /tmp and it's name is something like PHP. what i would like to do is: i want to upload a file via a html-form and while the upload is in progress make repeatedly ajax-requests to a php-script on the server that replies the size of the tmp file (the amount of data that was already uploaded). So in this script i need to know what the tmp-filename is. or do you think this is a completely useless approach? Google for PHP upload meter instead. That's probably how it works, more or less... I still think it's STOOPID to round-trip back and forth to the server to get an upload progress meter -- The browser developers should be providing you with some kind of progress notification system locally! well, i agree with you - the browser should provide some sort of functionality to find out the amount of data already sent. but i don't know any browser that does. all the php upload meters that i found on google either require to patch php or use perl. I have not done this, but am inspired to do it now. My design is to develop my own meter by compare $FILES;'size'] to the actual size on disk as the file uploads; I would use some sort of JavaScript / Ajax service connection so that the upload meter is displayed in the current browsing window or an upload popup. $_FILES['userfile']['name'] $_FILES['userfile']['type'] $_FILES['userfile']['size'] $_FILES['userfile']['tmp_name'] $_FILES['userfile']['error'] two problems: - the $_FILES array becomes available when the file-upload is complete. that's too late. - how do you determine the actual size on the disk of the uploaded file, while the upload is in progress? lg, Michi -- Sautergasse 27-29/35 1160 Wien phone: 0043 650 2526276 email: [EMAIL PROTECTED] web: http://www.webfischer.at -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Your Favourate PHP IDE?
Hi all, We all know that PHP IDE is one of the most popular themes... Maybe you are already a PHP professional, then could you please spend a little time to cast your vote to tell the newbies what you are using? Maybe you are just starting using PHP, then it's highly recommended that you look at the vote results first instead of asking the questions directly to the mailing list. Maybe you are... Come and vote! Share your ideas here: http://www.phparch.cn Tell me which is your selection and get an opportunity to win Olympic gifts. :-) -- Regards, Shelley -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php