[PHP] who is online?
i have built a function to tell me how many users are on my site at any given time... ? //define function function bc_who ($who, $location) { //first we erase any expired entries //entries will expire after 5 mins $whoTime = time(); $whoTime = $whoTime - 300; mysql_query(Delete FROM bc_who where expire $whoTime) or die(mysql_error()); //here we difine the variables needed to preform the check $whoExpire = time(); $whoIp = $_SERVER[REMOTE_ADDR]; //this will be changed as soon as user registration is finished $whoUser= Guest; //do the actual mysql queries mysql_query(Delete FROM bc_who where '$whoIp' = ip); mysql_query(Insert INTO bc_who (id, user, ip, location, expire, status) VALUES (NULL, '$whoUser', '$whoIp', '$location', '$whoExpire', '$whoStatus')); } //end who is function ? this fuction works fine, however, i want to know if what i am about to ask is possible. the problem i have is, this function assumes that after five minutes if the user has not refreshed the page, or gone onto another page the user must be gone. in reality, i have pages users might be on for an hour or so without refreshing. i want my whos online to as acurate as possible so is there a way to do this on the fly? like, forgetting about the expire time and using a server side peice of code to communicate to the database, when there is no more communication the entry is deleted? please tell me there is a way, thank you in advance.
[PHP] XPath question
Hi, ns:root i=0 tag ns:node i=1/ /tag ns:anothernode i=2 ns:notme i=3 ns:meneither i=4/ /ns:notme anothertag/ /ns:anothernode /ns:root I need to retrieve a list of all the INNER ns:* nodes (not the root i=0 node), that do not have an ancestor of any ns:* node but the root ns:root i=0 node. In other words: get all ns:* nodes with i in {1,2}. -thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] include file identifier
Richard Lynch wrote: On Sat, February 3, 2007 7:05 pm, Eli wrote: Does any included file in PHP have a unique identifier? (like a stack of includes identifier). Down in the guts of PHP source, there may be some kind of file handler which is unique... Actually, that's what I need. I want to know which instance of the file is running.. __FILE__ only gives the filename, but if the file is included in itself, there's no way to distinct which instance of them is currently running.. The base reason for this is storing some extra environment data on each file included.. -thanks, Eli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] who is online?
benifactor wrote: i have built a function to tell me how many users are on my site at any given time... ? //define function function bc_who ($who, $location) { //first we erase any expired entries //entries will expire after 5 mins $whoTime = time(); $whoTime = $whoTime - 300; mysql_query(Delete FROM bc_who where expire $whoTime) or die(mysql_error()); //here we difine the variables needed to preform the check $whoExpire = time(); $whoIp = $_SERVER[REMOTE_ADDR]; //this will be changed as soon as user registration is finished $whoUser= Guest; //do the actual mysql queries mysql_query(Delete FROM bc_who where '$whoIp' = ip); mysql_query(Insert INTO bc_who (id, user, ip, location, expire, status) VALUES (NULL, '$whoUser', '$whoIp', '$location', '$whoExpire', '$whoStatus')); } //end who is function ? this fuction works fine, however, i want to know if what i am about to ask is possible. the problem i have is, this function assumes that after five minutes if the user has not refreshed the page, or gone onto another page the user must be gone. in reality, i have pages users might be on for an hour or so without refreshing. i want my whos online to as acurate as possible so is there a way to do this on the fly? like, forgetting about the expire time and using a server side peice of code to communicate to the database, when there is no more communication the entry is deleted? please tell me there is a way, thank you in advance. Assuming you actually mean client side not server side (because server-side is what you already have), you could do this in a number of ways with Javascript. You could periodically call the server using XmlHttpRequest, or you could keep it simple and reload an image which points at a PHP script. Either way this is not a question for a PHP list because it relates to client-side code. Google will almost certainly have several useful sites. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Encoding problem
I have a string with an n with a tilde. mb_detect_encoding says it's UTF-8. I set the http encoding to UTF-8 and also the internal encoding. However, I cannot produce proper output with echo $varwithtilde. echo $returnArray[$i]-address1.' has '.mb_detect_encoding($returnArray[$i]-address1) does NOT produce correct output in a browser or with the W3C validator, although it says the encoding of the var is UTF-8. What's wrong? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] who is online?
sorry if you misunderstood, i just wanted to know if it could be done with php alone. - Original Message - From: Stut [EMAIL PROTECTED] To: benifactor [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Monday, February 05, 2007 5:18 AM Subject: Re: [PHP] who is online? benifactor wrote: i have built a function to tell me how many users are on my site at any given time... ? //define function function bc_who ($who, $location) { //first we erase any expired entries //entries will expire after 5 mins $whoTime = time(); $whoTime = $whoTime - 300; mysql_query(Delete FROM bc_who where expire $whoTime) or die(mysql_error()); //here we difine the variables needed to preform the check $whoExpire = time(); $whoIp = $_SERVER[REMOTE_ADDR]; //this will be changed as soon as user registration is finished $whoUser= Guest; //do the actual mysql queries mysql_query(Delete FROM bc_who where '$whoIp' = ip); mysql_query(Insert INTO bc_who (id, user, ip, location, expire, status) VALUES (NULL, '$whoUser', '$whoIp', '$location', '$whoExpire', '$whoStatus')); } //end who is function ? this fuction works fine, however, i want to know if what i am about to ask is possible. the problem i have is, this function assumes that after five minutes if the user has not refreshed the page, or gone onto another page the user must be gone. in reality, i have pages users might be on for an hour or so without refreshing. i want my whos online to as acurate as possible so is there a way to do this on the fly? like, forgetting about the expire time and using a server side peice of code to communicate to the database, when there is no more communication the entry is deleted? please tell me there is a way, thank you in advance. Assuming you actually mean client side not server side (because server-side is what you already have), you could do this in a number of ways with Javascript. You could periodically call the server using XmlHttpRequest, or you could keep it simple and reload an image which points at a PHP script. Either way this is not a question for a PHP list because it relates to client-side code. Google will almost certainly have several useful sites. -Stut -- 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: XPath question
Eli wrote: Hi, ns:root i=0 tag ns:node i=1/ /tag ns:anothernode i=2 ns:notme i=3 ns:meneither i=4/ /ns:notme anothertag/ /ns:anothernode /ns:root I need to retrieve a list of all the INNER ns:* nodes (not the root i=0 node), that do not have an ancestor of any ns:* node but the root ns:root i=0 node. In other words: get all ns:* nodes with i in {1,2}. Solved. :-) $XPathQuery = /*//ns:*[not(ancestor::ns:*[ancestor::ns:*])] -thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] who is online?
benifactor wrote: sorry if you misunderstood, i just wanted to know if it could be done with php alone. It can't, and this should be fairly obvious. If the client-side makes no contact with the server for a period of time, how do you expect it to know that the user hasn't moved to another page? The bottom line is that this needs some client-side code to work, whether it be Javascript or just an iframe with a meta refresh tag. -Stut - Original Message - From: Stut [EMAIL PROTECTED] To: benifactor [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Monday, February 05, 2007 5:18 AM Subject: Re: [PHP] who is online? benifactor wrote: i have built a function to tell me how many users are on my site at any given time... ? //define function function bc_who ($who, $location) { //first we erase any expired entries //entries will expire after 5 mins $whoTime = time(); $whoTime = $whoTime - 300; mysql_query(Delete FROM bc_who where expire $whoTime) or die(mysql_error()); //here we difine the variables needed to preform the check $whoExpire = time(); $whoIp = $_SERVER[REMOTE_ADDR]; //this will be changed as soon as user registration is finished $whoUser= Guest; //do the actual mysql queries mysql_query(Delete FROM bc_who where '$whoIp' = ip); mysql_query(Insert INTO bc_who (id, user, ip, location, expire, status) VALUES (NULL, '$whoUser', '$whoIp', '$location', '$whoExpire', '$whoStatus')); } //end who is function ? this fuction works fine, however, i want to know if what i am about to ask is possible. the problem i have is, this function assumes that after five minutes if the user has not refreshed the page, or gone onto another page the user must be gone. in reality, i have pages users might be on for an hour or so without refreshing. i want my whos online to as acurate as possible so is there a way to do this on the fly? like, forgetting about the expire time and using a server side peice of code to communicate to the database, when there is no more communication the entry is deleted? please tell me there is a way, thank you in advance. Assuming you actually mean client side not server side (because server-side is what you already have), you could do this in a number of ways with Javascript. You could periodically call the server using XmlHttpRequest, or you could keep it simple and reload an image which points at a PHP script. Either way this is not a question for a PHP list because it relates to client-side code. Google will almost certainly have several useful sites. -Stut -- 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] How can I know if a browser is cookies enables?
How can I know if a web browser is cookies enables? Send them ONE cookie and see if you get it back on the next page. yep Actually, just use session_start() and see if it works or not is even easier. having sessions working is not dependent on cookies. -- View this message in context: http://www.nabble.com/How-can-I-know-if-a-browser-is-cookies-enables--tf3172563.html#a8806163 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] who is online?
hmm it was obvious to me, tis why i asked. just had to be sure. thank you for your help. - Original Message - From: Stut [EMAIL PROTECTED] To: benifactor [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Monday, February 05, 2007 5:30 AM Subject: Re: [PHP] who is online? benifactor wrote: sorry if you misunderstood, i just wanted to know if it could be done with php alone. It can't, and this should be fairly obvious. If the client-side makes no contact with the server for a period of time, how do you expect it to know that the user hasn't moved to another page? The bottom line is that this needs some client-side code to work, whether it be Javascript or just an iframe with a meta refresh tag. -Stut - Original Message - From: Stut [EMAIL PROTECTED] To: benifactor [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Monday, February 05, 2007 5:18 AM Subject: Re: [PHP] who is online? benifactor wrote: i have built a function to tell me how many users are on my site at any given time... ? //define function function bc_who ($who, $location) { //first we erase any expired entries //entries will expire after 5 mins $whoTime = time(); $whoTime = $whoTime - 300; mysql_query(Delete FROM bc_who where expire $whoTime) or die(mysql_error()); //here we difine the variables needed to preform the check $whoExpire = time(); $whoIp = $_SERVER[REMOTE_ADDR]; //this will be changed as soon as user registration is finished $whoUser= Guest; //do the actual mysql queries mysql_query(Delete FROM bc_who where '$whoIp' = ip); mysql_query(Insert INTO bc_who (id, user, ip, location, expire, status) VALUES (NULL, '$whoUser', '$whoIp', '$location', '$whoExpire', '$whoStatus')); } //end who is function ? this fuction works fine, however, i want to know if what i am about to ask is possible. the problem i have is, this function assumes that after five minutes if the user has not refreshed the page, or gone onto another page the user must be gone. in reality, i have pages users might be on for an hour or so without refreshing. i want my whos online to as acurate as possible so is there a way to do this on the fly? like, forgetting about the expire time and using a server side peice of code to communicate to the database, when there is no more communication the entry is deleted? please tell me there is a way, thank you in advance. Assuming you actually mean client side not server side (because server-side is what you already have), you could do this in a number of ways with Javascript. You could periodically call the server using XmlHttpRequest, or you could keep it simple and reload an image which points at a PHP script. Either way this is not a question for a PHP list because it relates to client-side code. Google will almost certainly have several useful sites. -Stut -- 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] Encoding problem
Guus Ellenkamp wrote: I have a string with an n with a tilde. mb_detect_encoding says it's UTF-8. I set the http encoding to UTF-8 and also the internal encoding. However, I cannot produce proper output with echo $varwithtilde. echo $returnArray[$i]-address1.' has '.mb_detect_encoding($returnArray[$i]-address1) does NOT produce correct output in a browser or with the W3C validator, although it says the encoding of the var is UTF-8. What's wrong? Character set issues can be very complex, but I'm going to take a guess If you're outputting something that is actually UTF-8, you'll need to make sure that you've done these: header('Content-Type: text/html; charset=utf-8'); I believe that IE6 requires this one as well within your html head. meta http-equiv=Content-Type content=text/html; charset=utf-8 / If that doesn't work, then it could be that your character isn't actually UTF-8 encoded. jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] who is online?
hey. for my $0.02 worth.. these kinds of questions are not exactly only php. however, i still see them as being valuable, and belonging to the php list, as they get into areas the php developers of sites might grapple with. i'm of the opinion more, rather than less. so if you have more intelligent discussions regarding php/site development technologies that integrate with php, this is the place for it!! peace.. -Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: Monday, February 05, 2007 5:31 AM To: benifactor Cc: php-general@lists.php.net Subject: Re: [PHP] who is online? benifactor wrote: sorry if you misunderstood, i just wanted to know if it could be done with php alone. It can't, and this should be fairly obvious. If the client-side makes no contact with the server for a period of time, how do you expect it to know that the user hasn't moved to another page? The bottom line is that this needs some client-side code to work, whether it be Javascript or just an iframe with a meta refresh tag. -Stut - Original Message - From: Stut [EMAIL PROTECTED] To: benifactor [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Monday, February 05, 2007 5:18 AM Subject: Re: [PHP] who is online? benifactor wrote: i have built a function to tell me how many users are on my site at any given time... ? //define function function bc_who ($who, $location) { //first we erase any expired entries //entries will expire after 5 mins $whoTime = time(); $whoTime = $whoTime - 300; mysql_query(Delete FROM bc_who where expire $whoTime) or die(mysql_error()); //here we difine the variables needed to preform the check $whoExpire = time(); $whoIp = $_SERVER[REMOTE_ADDR]; //this will be changed as soon as user registration is finished $whoUser= Guest; //do the actual mysql queries mysql_query(Delete FROM bc_who where '$whoIp' = ip); mysql_query(Insert INTO bc_who (id, user, ip, location, expire, status) VALUES (NULL, '$whoUser', '$whoIp', '$location', '$whoExpire', '$whoStatus')); } //end who is function ? this fuction works fine, however, i want to know if what i am about to ask is possible. the problem i have is, this function assumes that after five minutes if the user has not refreshed the page, or gone onto another page the user must be gone. in reality, i have pages users might be on for an hour or so without refreshing. i want my whos online to as acurate as possible so is there a way to do this on the fly? like, forgetting about the expire time and using a server side peice of code to communicate to the database, when there is no more communication the entry is deleted? please tell me there is a way, thank you in advance. Assuming you actually mean client side not server side (because server-side is what you already have), you could do this in a number of ways with Javascript. You could periodically call the server using XmlHttpRequest, or you could keep it simple and reload an image which points at a PHP script. Either way this is not a question for a PHP list because it relates to client-side code. Google will almost certainly have several useful sites. -Stut -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Amortization calculator
Dan Harrington wrote: Hello, I am looking for a 365-day (as opposed to 360) amortization calculator. Does anyone know of one written in PHP that could be used to calculate payments, PI, etc on loans with the various variables changeable like this? http://ray.met.fsu.edu/cgi-bin/amortize Thanks Dan Usually 360 means number of months, not days, in an amortization calculator (30 years). That's a pretty standard loan term. I used this when I had to write my own amortization calculator: http://www.hughchou.org/calc/formula.html I think there's a PHP version you can download on it. -- Ray Hauge Primate Applications -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hello list
At 4:27 PM -0700 2/4/07, PHP Fusebox wrote: I've tried subscribing 3 times now. This is a test. For the third time -- we didn't get this. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I know if a browser is cookies enables?
At 11:36 PM -0500 2/4/07, Mauricio Muriel wrote: Hello. How can I know if a web browser is cookies enables? Regards Mauricio M. Give it a glass of milk and watch what happens. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] who is online?
I agree. hey. for my $0.02 worth.. these kinds of questions are not exactly only php. however, i still see them as being valuable, and belonging to the php list, as they get into areas the php developers of sites might grapple with. i'm of the opinion more, rather than less. so if you have more intelligent discussions regarding php/site development technologies that integrate with php, this is the place for it!! peace.. -Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: Monday, February 05, 2007 5:31 AM To: benifactor Cc: php-general@lists.php.net Subject: Re: [PHP] who is online? benifactor wrote: sorry if you misunderstood, i just wanted to know if it could be done with php alone. It can't, and this should be fairly obvious. If the client-side makes no contact with the server for a period of time, how do you expect it to know that the user hasn't moved to another page? The bottom line is that this needs some client-side code to work, whether it be Javascript or just an iframe with a meta refresh tag. -Stut - Original Message - From: Stut [EMAIL PROTECTED] To: benifactor [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Monday, February 05, 2007 5:18 AM Subject: Re: [PHP] who is online? benifactor wrote: i have built a function to tell me how many users are on my site at any given time... ? //define function function bc_who ($who, $location) { //first we erase any expired entries //entries will expire after 5 mins $whoTime = time(); $whoTime = $whoTime - 300; mysql_query(Delete FROM bc_who where expire $whoTime) or die(mysql_error()); //here we difine the variables needed to preform the check $whoExpire = time(); $whoIp = $_SERVER[REMOTE_ADDR]; //this will be changed as soon as user registration is finished $whoUser= Guest; //do the actual mysql queries mysql_query(Delete FROM bc_who where '$whoIp' = ip); mysql_query(Insert INTO bc_who (id, user, ip, location, expire, status) VALUES (NULL, '$whoUser', '$whoIp', '$location', '$whoExpire', '$whoStatus')); } //end who is function ? this fuction works fine, however, i want to know if what i am about to ask is possible. the problem i have is, this function assumes that after five minutes if the user has not refreshed the page, or gone onto another page the user must be gone. in reality, i have pages users might be on for an hour or so without refreshing. i want my whos online to as acurate as possible so is there a way to do this on the fly? like, forgetting about the expire time and using a server side peice of code to communicate to the database, when there is no more communication the entry is deleted? please tell me there is a way, thank you in advance. Assuming you actually mean client side not server side (because server-side is what you already have), you could do this in a number of ways with Javascript. You could periodically call the server using XmlHttpRequest, or you could keep it simple and reload an image which points at a PHP script. Either way this is not a question for a PHP list because it relates to client-side code. Google will almost certainly have several useful sites. -Stut -- 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 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] include file identifier
On 2/5/07, Richard Lynch [EMAIL PROTECTED] wrote: If you want to avoid the overhead of include_once, it's a pretty common practice (borrowed from C .h files) to do: Just out of curiosity, how much additional overhead are we talking about? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP book reviewers wanted
At 1:05 AM -0200 2/5/07, Manuel Lemos wrote: Demonstrating good English writing skills and having published good book reviews in the past gets me preference. gets me preference ??? Me get any money for this? tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] who is online?
Ditto. There's really no reason it can't go here. - Craige On 2/5/07, benifactor [EMAIL PROTECTED] wrote: I agree. hey. for my $0.02 worth.. these kinds of questions are not exactly only php. however, i still see them as being valuable, and belonging to the php list, as they get into areas the php developers of sites might grapple with. i'm of the opinion more, rather than less. so if you have more intelligent discussions regarding php/site development technologies that integrate with php, this is the place for it!! peace.. -Original Message- From: Stut [mailto:[EMAIL PROTECTED] Sent: Monday, February 05, 2007 5:31 AM To: benifactor Cc: php-general@lists.php.net Subject: Re: [PHP] who is online? benifactor wrote: sorry if you misunderstood, i just wanted to know if it could be done with php alone. It can't, and this should be fairly obvious. If the client-side makes no contact with the server for a period of time, how do you expect it to know that the user hasn't moved to another page? The bottom line is that this needs some client-side code to work, whether it be Javascript or just an iframe with a meta refresh tag. -Stut - Original Message - From: Stut [EMAIL PROTECTED] To: benifactor [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Monday, February 05, 2007 5:18 AM Subject: Re: [PHP] who is online? benifactor wrote: i have built a function to tell me how many users are on my site at any given time... ? //define function function bc_who ($who, $location) { //first we erase any expired entries //entries will expire after 5 mins $whoTime = time(); $whoTime = $whoTime - 300; mysql_query(Delete FROM bc_who where expire $whoTime) or die(mysql_error()); //here we difine the variables needed to preform the check $whoExpire = time(); $whoIp = $_SERVER[REMOTE_ADDR]; //this will be changed as soon as user registration is finished $whoUser= Guest; //do the actual mysql queries mysql_query(Delete FROM bc_who where '$whoIp' = ip); mysql_query(Insert INTO bc_who (id, user, ip, location, expire, status) VALUES (NULL, '$whoUser', '$whoIp', '$location', '$whoExpire', '$whoStatus')); } //end who is function ? this fuction works fine, however, i want to know if what i am about to ask is possible. the problem i have is, this function assumes that after five minutes if the user has not refreshed the page, or gone onto another page the user must be gone. in reality, i have pages users might be on for an hour or so without refreshing. i want my whos online to as acurate as possible so is there a way to do this on the fly? like, forgetting about the expire time and using a server side peice of code to communicate to the database, when there is no more communication the entry is deleted? please tell me there is a way, thank you in advance. Assuming you actually mean client side not server side (because server-side is what you already have), you could do this in a number of ways with Javascript. You could periodically call the server using XmlHttpRequest, or you could keep it simple and reload an image which points at a PHP script. Either way this is not a question for a PHP list because it relates to client-side code. Google will almost certainly have several useful sites. -Stut -- 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 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Amortization calculator
Try this: http://www.tonymarston.net/php-mysql/amortise.html -- Tony Marston http://www.tonymarston.net http://www.radicore.org Dan Harrington [EMAIL PROTECTED] wrote in message news:!~!UENERkVCMDkAAQACABgA0GQuLQQZMkSIxO1FcYz7L8KQVmQdtX3Lb0SRpx9/[EMAIL PROTECTED] Hello, I am looking for a 365-day (as opposed to 360) amortization calculator. Does anyone know of one written in PHP that could be used to calculate payments, PI, etc on loans with the various variables changeable like this? http://ray.met.fsu.edu/cgi-bin/amortize Thanks Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hello list
On Mon, 2007-02-05 at 11:01 -0500, tedd wrote: At 4:27 PM -0700 2/4/07, PHP Fusebox wrote: I've tried subscribing 3 times now. This is a test. For the third time -- we didn't get this. Didn't get what? :B Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP book reviewers wanted
On Mon, 2007-02-05 at 11:09 -0500, tedd wrote: At 1:05 AM -0200 2/5/07, Manuel Lemos wrote: Demonstrating good English writing skills and having published good book reviews in the past gets me preference. gets me preference ??? Me get any money for this? No money you get! Tingly feeling of goodwill spread throughout you it will. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP book reviewers wanted
-Message d'origine- De : tedd [mailto:[EMAIL PROTECTED] Envoyé : lundi 5 février 2007 17:10 À : Manuel Lemos; php-general@lists.php.net Objet : Re: [PHP] PHP book reviewers wanted At 1:05 AM -0200 2/5/07, Manuel Lemos wrote: Demonstrating good English writing skills and having published good book reviews in the past gets me preference. gets me preference ??? Quote: good English writing skills :P Me get any money for this? tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- 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] PHP5 Commercial Development
At 12:06 AM -0500 2/5/07, Craige Leeder wrote: Eric, PHP is fine for commercial environments. Many people are just afraid of it due to the fact it is known to break some poorly written PHP 4 scripts, and the fact that many people don't think it's new features are necessary. It is perfectly fine to use it in a commercial environment however. - Craige I feel the same way about cars. There are some terrible drivers out there, so we should all take the bus. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Billing client for studying documentation
Mike, Talk to the client, and explain the situation. I'm sure that you will be able to work out some sort of agreement. It may not be for all the hours, but that's not unreasonable considering the fact that this was not explained before you went ahead with your research. If nothing else, you come out on top with knowledge of what you learned during this experience. Good luck, - Craige On 2/5/07, Richard Lynch [EMAIL PROTECTED] wrote: On Sat, February 3, 2007 8:09 pm, Mike Mannakee wrote: I have a php project I have been working on for several months. The client's requirements have expanded to include interfacing to an online service using xml, which I was familiar with but have never worked with prior to this project. I have spent a good number of hours reading up on xml, and learning how to use it to integrate with this online service. I have also spent hours poring over hundreds of pages of documentation for the online service itself. My question is this - should I be billing the client for this time? It is needed to properly work with this framework, but it is not programming time in itself. Googling the topic has been useless. You should probably discuss it with the client... Actually, you should have discussed it before you started researching. :-v That said, you can probably safely invoice for a few hours of XML research, but it shouldn't be big enough to be more than a line item in the whole project invoice. On the plus side, acquiring knowledge is always expensive, and almost always worth the expense. :-) -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP book reviewers wanted
How many book reviews do you suppose Manuel has written in his life time? - Craige On 2/5/07, Tim [EMAIL PROTECTED] wrote: -Message d'origine- De: tedd [mailto:[EMAIL PROTECTED] Envoyé: lundi 5 février 2007 17:10 À: Manuel Lemos; php-general@lists.php.net Objet: Re: [PHP] PHP book reviewers wanted At 1:05 AM -0200 2/5/07, Manuel Lemos wrote: Demonstrating good English writing skills and having published good book reviews in the past gets me preference. gets me preference ??? Quote: good English writing skills :P Me get any money for this? tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is there socket.so file?
Yeni, On Linux, it is necessary to compile php with the --enable-sockets flag to be able to use php's socket functions. Hope this helps, - Craige On 2/5/07, Richard Lynch [EMAIL PROTECTED] wrote: On Sat, February 3, 2007 10:18 am, Yeni Setiawan wrote: Hi there, I'm currently writing an IRC bot using php (CLI) and get a little problem. For windows version, I need to enable socket extension (socket.dll) and my bot will be able to connect to an IRC server. But in linux version, it's unable to connect. So I wonder if there's a socket.so or something else to activate socket extension. And the question is, do I need socket extension in Linux? The answer is Yes but the rest of the answer depends on your version of PHP more than anything else... http://php.net/sockets lays that out rather nicely, actually. Did you do *any* research at all on this?... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP book reviewers wanted
At 11:14 AM -0500 2/5/07, Robert Cummings wrote: On Mon, 2007-02-05 at 11:09 -0500, tedd wrote: At 1:05 AM -0200 2/5/07, Manuel Lemos wrote: Demonstrating good English writing skills and having published good book reviews in the past gets me preference. gets me preference ??? Me get any money for this? No money you get! Tingly feeling of goodwill spread throughout you it will. Will what? Tingly feeling? Tingly feeling? I don't need no stinking tingly feeling! Paraphrased from Treasure of Sierra Madre -- but somehow, it doesn't sound right. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP book reviewers wanted
Hello, on 02/05/2007 02:09 PM tedd said the following: At 1:05 AM -0200 2/5/07, Manuel Lemos wrote: Demonstrating good English writing skills and having published good book reviews in the past gets me preference. gets me preference ??? Me get any money for this? Good catch! ;-) Those that never commited a typo, throw the first stone! Oh, you just did! ;-) -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator http://www.metastorage.net/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 Commercial Development
tedd wrote: At 12:06 AM -0500 2/5/07, Craige Leeder wrote: PHP is fine for commercial environments. Many people are just afraid of it due to the fact it is known to break some poorly written PHP 4 scripts, and the fact that many people don't think it's new features are necessary. It is perfectly fine to use it in a commercial environment however. I feel the same way about cars. There are some terrible drivers out there, so we should all take the bus. Won't work. There are some *really* terrible bus drivers out there. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sending secure mail
# [EMAIL PROTECTED] / 2007-02-05 00:22:57 +: I need to send a large number of emails (not spam!) through an external SMTP server that requires TLS and a username/password. I have some control over the SMTP server but very little over the web server where the scripts reside. How do I connect with TLS, authenticate and send the mail? I had problems with mail() originally (one of the reasons why we now have a dedicated mail server) and I had to connect to the SMTP server by hand with sockets and go through the SMTP steps by hand. I can connect to the new server with following code. $sock = fsockopen( 'smtp.eg.com', 25, $errNo, $errStr ); However, when I send the rcpt to: line, I'm told I don't have access to the relay - i.e. I need to log in. This is where my knowledge of SMTP reaches it's limit but I've read about the auth login command, however, it says it needs to be run over an encrypted connection, i.e. TLS. I can't disable this on the server, other services need TLS to be on the SMTP server. Why don't you let your local MTA handle the things for you? -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP book reviewers wanted
Hello, on 02/05/2007 02:14 PM Robert Cummings said the following: Demonstrating good English writing skills and having published good book reviews in the past gets me preference. gets me preference ??? Me get any money for this? No money you get! Tingly feeling of goodwill spread throughout you it will. Unfortunately, publishing book reviews is not the kind of thing that is worth the time it took me to develop the review system. That was true in the year 2000 and it is still true until today. Anyway, since the system is already done, hopefully it will help all book writers that are brave enough to invest plenty of time writing good PHP books. Often writing books is also not worth the effort. Many authors that try it, only write one book and then give up because the books do not sell enough and they realize they can make more doing something else like consulting. At least maybe the reviews can benefit the authors either helping the books sell more or getting them better known in the community and the consulting business. When that happens, I will be satisfied and feel compensated for all the time I invested in developing the review system. -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator http://www.metastorage.net/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] LDAP constants GSLC_SSL_...
# [EMAIL PROTECTED] / 2007-02-04 13:26:39 +0100: Hello, actually i am workinh with the ldap functions of php5. Reading the docs i found the constants GSLC_SSL_NO_AUTH GSLC_SSL_ONEWAY_AUTH GSLC_SSL_TWOWAY_AUTH They are simply documented, but i can't find any docs about them. Neither at php.net not via google. So - what they are for and how to use them ? I had *no problems* finding information on these constants using google. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Calculate string width using some font.
Hey list! :) I've got a problem trying to calculate a string width using an X font with some Y font size to use in an svg-to-pdf conversion. This is what I try to do: 1. Create a dummy image. 2. Set the text there using font X and the font size Y (it seems that when I create the image it renders it at 72dpi so I need to reduce it at 300dpi) I'm not sure what the imagettftext() function returns, are those values measured in pixels ? I read in some page that the proportion to reduce the image at 300dpi is reduce the size to 24% of its original size. http://www.printingforless.com/resolution.html That's the code: *** // Create dummy image. $rsc_image = imagecreate( 1, 1 ); // Set image. $arr_ftx = imagettftext( $rsc_image, $int_font_size, 0, 0, 0, -1, ./fonts/{$str_font_file}, $str_variable_value ); // Destroy dummy image. imagedestroy( $rsc_image ); // Set structure of widths. // TODO: Magik numbers. $arr_variable_pixels[$str_variable_index] = ( ( $arr_ftx[2] * 24 ) / 100 ); *** Thx for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] How can I know if a browser is cookies enables?
Hello tedd, Monday, February 5, 2007, 7:04:34 PM, you wrote: At 11:36 PM -0500 2/4/07, Mauricio Muriel wrote: Hello. How can I know if a web browser is cookies enables? Regards Mauricio M. Give it a glass of milk and watch what happens. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com It can also be done with JavaScript. Found an example at: http://techpatterns.com/downloads/javascript_check_cookies.php Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Server Stall
Hi, One of my scripts are using wget to get external xml data $fp = popen (wget -O - '.$dst.' | cat,r); Some time $dst host responds very slowly. And that time if I open another connection to same server the second request waits to complete wget operation. I'm very noobie about this file operations. Is there any suggestion about this situation ? Regards. Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I know if a browser is cookies enables?
Also try: http://www.aspfaqs.com/webtech/082400-1.shtml What would we do without search engines? :)) Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP4 to PHP5 issue
Hey all, I installed a new FreeBSD 6.0 server here in the office with PHP5. I moved over several sites we developed under PHP4, and all of those seem to be functioning perfectly, but I am getting an error on to sites, on PostNuke based and our dotProject system. Both errors are the same, and here is the one from dotProject: Fatal error: Call to a member function Execute() on a non-object in /usr/home/dotproject/public_html/classes/query.class.php on line 589 And the code: $this-_query_id = $db-Execute($q); Where $q is a pretty typical SQL statement. What I'm wondering if there is an easy way to convert $q to an object type rather than a string to satisfy Execute? Or some other straightforward fix? Thanks! Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 http://bigskypenguin.com =-=-=-=-=-=-=-=-=-= -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Calculate string width using some font.
Juan Felipe Alvarez Saldarriaga wrote: Hey list! :) my name's not list but what the heck: take a look at these function, they should light the way: http://php.net/manual/en/function.imageftbbox.php http://php.net/manual/en/function.imagepsbbox.php http://php.net/manual/en/function.imagettfbbox.php http://php.net/imageloadfont everything is pixels. there is no dpi - your screen printer has a certain dpi and that determine how big the image displays on either. okay not much help - I had brain freeze half thru. I've got a problem trying to calculate a string width using an X font with some Y font size to use in an svg-to-pdf conversion. This is what I try to do: 1. Create a dummy image. 2. Set the text there using font X and the font size Y (it seems that when I create the image it renders it at 72dpi so I need to reduce it at 300dpi) I'm not sure what the imagettftext() function returns, are those values measured in pixels ? yes. I read in some page that the proportion to reduce the image at 300dpi is reduce the size to 24% of its original size. http://www.printingforless.com/resolution.html That's the code: *** // Create dummy image. $rsc_image = imagecreate( 1, 1 ); // Set image. $arr_ftx = imagettftext( $rsc_image, $int_font_size, 0, 0, 0, -1, ./fonts/{$str_font_file}, $str_variable_value ); // Destroy dummy image. imagedestroy( $rsc_image ); // Set structure of widths. // TODO: Magik numbers. $arr_variable_pixels[$str_variable_index] = ( ( $arr_ftx[2] * 24 ) / 100 ); *** Thx for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP4 to PHP5 issue
Skip Evans wrote: Hey all, I installed a new FreeBSD 6.0 server here in the office with PHP5. I moved over several sites we developed under PHP4, and all of those seem to be functioning perfectly, but I am getting an error on to sites, on PostNuke based and our dotProject system. Both errors are the same, and here is the one from dotProject: Fatal error: Call to a member function Execute() on a non-object in /usr/home/dotproject/public_html/classes/query.class.php on line 589 And the code: $this-_query_id = $db-Execute($q); Where $q is a pretty typical SQL statement. What I'm wondering if there is an easy way to convert $q to an object type rather than a string to satisfy Execute? Or some other straightforward fix? the problem is not with $q but with $db. $db is not an object, why that is so I don't know - more bug hunting for you I'm afraid. Thanks! Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 http://bigskypenguin.com =-=-=-=-=-=-=-=-=-= -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Calculate string width using some font.
Jochem Maas wrote: Juan Felipe Alvarez Saldarriaga wrote: Hey list! :) my name's not list but what the heck: take a look at these function, they should light the way: http://php.net/manual/en/function.imageftbbox.php http://php.net/manual/en/function.imagepsbbox.php http://php.net/manual/en/function.imagettfbbox.php http://php.net/imageloadfont everything is pixels. there is no dpi - your screen printer has a certain dpi and that determine how big the image displays on either. okay not much help - I had brain freeze half thru. K, np, Ill try use imagettfbbox() function instead. Thx. I've got a problem trying to calculate a string width using an X font with some Y font size to use in an svg-to-pdf conversion. This is what I try to do: 1. Create a dummy image. 2. Set the text there using font X and the font size Y (it seems that when I create the image it renders it at 72dpi so I need to reduce it at 300dpi) I'm not sure what the imagettftext() function returns, are those values measured in pixels ? yes. I read in some page that the proportion to reduce the image at 300dpi is reduce the size to 24% of its original size. http://www.printingforless.com/resolution.html That's the code: *** // Create dummy image. $rsc_image = imagecreate( 1, 1 ); // Set image. $arr_ftx = imagettftext( $rsc_image, $int_font_size, 0, 0, 0, -1, ./fonts/{$str_font_file}, $str_variable_value ); // Destroy dummy image. imagedestroy( $rsc_image ); // Set structure of widths. // TODO: Magik numbers. $arr_variable_pixels[$str_variable_index] = ( ( $arr_ftx[2] * 24 ) / 100 ); *** Thx for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Converting string representation of a directory to multi-dimensional array
Over the weekend, I was tasked with taking a string representation of a directory ('\Interface\Addons\some dir\some file'), which can vary in length (no set number of depths) to a multi-dimensional array (i.e. array('Interface' = array('Addons' = array('some dir' = somefile)));). We came up with a very ugly hack to do it, but I'm curious if anyone can help us wrap our head around a better solution, without using eval (which we were able to find that solution quickly, but do not want to use eval). Our situation is a little unique in the fact that these files don't actually exist on a filesystem, so it makes it a bit more tough to actually create this array. Thanks for any help you can give in cleaning this up somewhat. Here is the function we currently use: ?php $array = array(); addToList('\interface\addons\clearfont\clearfont.toc2', $array); addToList('\interface\addons\clearfont\clearfont.toc3', $array); addToList('\interface\addons\clearfont\clearfont.toc4', $array); addToList('\interface\addons\clearfont\clearfont.toc5', $array); addToList('\interface\addons\clearfont\subdir\something.toc', $array); function addToList($str, $array) { $things = explode('\\', $str); if($things['0'] == '') { array_shift($things); } addToArray($things, $array); } function addToArray($things, $array) { $count = count($things); switch ($count) { case '1': $array[$things['0']] = $array(); break; case '2': $array[$things['0']][$things['1']] = $things['1']; break; case '3': $array[$things['0']][$things['1']][$things['2']] = $things['2']; break; case '4': $array[$things['0']][$things['1']][$things['2']][$things['3']] = $things['3']; break; previous code repeated down to 10 default: break; } } print_r($array); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP4 to PHP5 issue
Jochem Maas wrote: the problem is not with $q but with $db. $db is not an object, why that is so I don't know - more bug hunting for you I'm afraid. Woops! I sure read that one wrong. Thanks, I will dig deeper. Does anyone have any experience running dotProject under PHP5? Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 http://bigskypenguin.com =-=-=-=-=-=-=-=-=-= Check out PHPenguin, a lightweight and versatile PHP/MySQL development framework. http://phpenguin.bigskypenguin.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP4 to PHP5 issue
Hi, It look like your system cannot init adodb library. It may SQL setup problem... On Monday 05 February 2007 19:58, Skip Evans wrote: Hey all, I installed a new FreeBSD 6.0 server here in the office with PHP5. I moved over several sites we developed under PHP4, and all of those seem to be functioning perfectly, but I am getting an error on to sites, on PostNuke based and our dotProject system. Both errors are the same, and here is the one from dotProject: Fatal error: Call to a member function Execute() on a non-object in /usr/home/dotproject/public_html/classes/query.class.php on line 589 And the code: $this-_query_id = $db-Execute($q); Where $q is a pretty typical SQL statement. What I'm wondering if there is an easy way to convert $q to an object type rather than a string to satisfy Execute? Or some other straightforward fix? Thanks! Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 http://bigskypenguin.com =-=-=-=-=-=-=-=-=-= -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Converting string representation of a directory to multi-dimensional array
Matt Carlson wrote: Over the weekend, I was tasked with taking a string representation of a directory ('\Interface\Addons\some dir\some file'), which can vary in length (no set number of depths) to a multi-dimensional array (i.e. array('Interface' = array('Addons' = array('some dir' = somefile)));). We came up with a very ugly hack to do it, but I'm curious if anyone can help us wrap our head around a better solution, without using eval (which we were able to find that solution quickly, but do not want to use eval). Our situation is a little unique in the fact that these files don't actually exist on a filesystem, so it makes it a bit more tough to actually create this array. Thanks for any help you can give in cleaning this up somewhat. Here is the function we currently use: based on an answer to an old post ... below shows how to uses references to walk 'into' an array and set/create multilevel elements - given a bit of thought you should be able to figure out how to apply the concept to your own problem: ?php $ref = null; $keys = array(six,five,four,three,two,one); $val = string value; // the node value $arr = array(); // generated array $ref = $arr; while ($key = array_pop($keys)) { $ref[$key] = array(); $ref = $ref[$key]; } $ref = $val; var_dump($arr); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP4 to PHP5 issue
Hi, -Message d'origine- De : Skip Evans [mailto:[EMAIL PROTECTED] Envoyé : lundi 5 février 2007 19:31 Cc : PHP-General Objet : Re: [PHP] PHP4 to PHP5 issue Jochem Maas wrote: the problem is not with $q but with $db. $db is not an object, why that is so I don't know - more bug hunting for you I'm afraid. Woops! I sure read that one wrong. Thanks, I will dig deeper. Does anyone have any experience running dotProject under PHP5? Yes, our company used it for three months before dumping it regarding PHP5 incompatibility and some other mistakes.. I ended up having to fix/hack too many things (sessions doing weird things, broken forum, translations all messed up, user roles not working quite right, admin system funked) it wasn't worth my time, we developed a more specialized app for project management internally. Other then the fact that it is definitely NOT PHP5 compatible it seems to be a great project manager with many great features. I'd assume if you really want to use it, run it on a server with PHP4 you'll save yourself some time and headaches. Regards, Tim Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 http://bigskypenguin.com =-=-=-=-=-=-=-=-=-= Check out PHPenguin, a lightweight and versatile PHP/MySQL development framework. http://phpenguin.bigskypenguin.com/ -- 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] Server Stall
If you have cURL installed, you could use Curl to get the file, and manipulate the contents that way. Here is the standard function I use for grabbing a remote page. function doRequest($method, $url, $vars = '', $headers = '0') { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, $headers); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt'); if ($method == 'POST') { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $vars); } $data = curl_exec($ch); curl_close($ch); if ($data) { return $data; } else { return curl_error($ch); } } called with doRequest('GET', 'url'); $vars would be either a string or an array of post variables, and headers either shows or hides headers from the webserver. CURLOPT_TIMEOUT is set to 30, but you can change that to how many seconds you'd like to wait. - Original Message From: Sancar Saran [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Monday, February 5, 2007 11:42:56 AM Subject: [PHP] Server Stall Hi, One of my scripts are using wget to get external xml data $fp = popen (wget -O - '.$dst.' | cat,r); Some time $dst host responds very slowly. And that time if I open another connection to same server the second request waits to complete wget operation. I'm very noobie about this file operations. Is there any suggestion about this situation ? Regards. Sancar -- 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] PHP4 to PHP5 issue
Tim wrote: Yes, our company used it for three months before dumping it regarding PHP5 incompatibility and some other mistakes.. I ended up having to fix/hack too many things (sessions doing weird things, broken forum, translations all messed up, user roles not working quite right, admin system funked) it wasn't worth my time, we developed a more specialized app for project management internally. Well, I hate to use this kind of language on the list, but I feel I must say that sucks. But I want to thank you Tim for saving me all kinds of time trying to get dP going on PHP5. We still have the old server, of course, running right underneath the new rack jobbies, and I can use it for now to run dP for us. Unfortunately, we're quite wedded to it for project management, having modified and customized it extensively to suit our needs. Hate to use the box, though, just for dP since I had it slated to be converted to a pretty sweet workstation. Oh well, if life were perfect we'd... we'd... heck, we'd have a lot more fun. Thanks again, Tim. Any more experiences with dP and PHP5 are appreciated, although Tim seems to have pretty well nailed it. -- Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 http://bigskypenguin.com =-=-=-=-=-=-=-=-=-= Check out PHPenguin, a lightweight and versatile PHP/MySQL development framework. http://phpenguin.bigskypenguin.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Calculate string width using some font.
pdf_stringwidth() may help you regards fra* Hey list! :) my name's not list but what the heck: take a look at these function, they should light the way: http://php.net/manual/en/function.imageftbbox.php http://php.net/manual/en/function.imagepsbbox.php http://php.net/manual/en/function.imagettfbbox.php http://php.net/imageloadfont everything is pixels. there is no dpi - your screen printer has a certain dpi and that determine how big the image displays on either. okay not much help - I had brain freeze half thru. K, np, Ill try use imagettfbbox() function instead. Thx. I've got a problem trying to calculate a string width using an X font with some Y font size to use in an svg-to-pdf conversion. This is what I try to do: 1. Create a dummy image. 2. Set the text there using font X and the font size Y (it seems that when I create the image it renders it at 72dpi so I need to reduce it at 300dpi) I'm not sure what the imagettftext() function returns, are those values measured in pixels ? yes. I read in some page that the proportion to reduce the image at 300dpi is reduce the size to 24% of its original size. http://www.printingforless.com/resolution.html That's the code: *** // Create dummy image. $rsc_image = imagecreate( 1, 1 ); // Set image. $arr_ftx = imagettftext( $rsc_image, $int_font_size, 0, 0, 0, -1, ./fonts/{$str_font_file}, $str_variable_value ); // Destroy dummy image. imagedestroy( $rsc_image ); // Set structure of widths. // TODO: Magik numbers. $arr_variable_pixels[$str_variable_index] = ( ( $arr_ftx[2] * 24 ) / 100 ); *** Thx for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Calculate string width using some font.
setcookie wrote: pdf_stringwidth() may help you regards fra* Yea I saw that too but you know, pdflib is not free. Hey list! :) my name's not list but what the heck: take a look at these function, they should light the way: http://php.net/manual/en/function.imageftbbox.php http://php.net/manual/en/function.imagepsbbox.php http://php.net/manual/en/function.imagettfbbox.php http://php.net/imageloadfont everything is pixels. there is no dpi - your screen printer has a certain dpi and that determine how big the image displays on either. okay not much help - I had brain freeze half thru. K, np, Ill try use imagettfbbox() function instead. Thx. I've got a problem trying to calculate a string width using an X font with some Y font size to use in an svg-to-pdf conversion. This is what I try to do: 1. Create a dummy image. 2. Set the text there using font X and the font size Y (it seems that when I create the image it renders it at 72dpi so I need to reduce it at 300dpi) I'm not sure what the imagettftext() function returns, are those values measured in pixels ? yes. I read in some page that the proportion to reduce the image at 300dpi is reduce the size to 24% of its original size. http://www.printingforless.com/resolution.html That's the code: *** // Create dummy image. $rsc_image = imagecreate( 1, 1 ); // Set image. $arr_ftx = imagettftext( $rsc_image, $int_font_size, 0, 0, 0, -1, ./fonts/{$str_font_file}, $str_variable_value ); // Destroy dummy image. imagedestroy( $rsc_image ); // Set structure of widths. // TODO: Magik numbers. $arr_variable_pixels[$str_variable_index] = ( ( $arr_ftx[2] * 24 ) / 100 ); *** Thx for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] _GET('name') truncates
Hi all, I've written a php script, called test.php, consisting of the following statements: ?php error_reporting(E_ALL); $query = $_GET['sql']; echo $query; ? Using the script with 'small' values for the parameter sql works fine. Although, using the script with the sql query as specified below http://localhost/test.php?sql=SELECT orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified, date_purchased, orders_status, orders_date_finished, currency, currency_value FROM orders where ((date_purchased = 18991230 and last_modified is null) or last_modified = 18991230 ) and orders_status in (1,2,3) and ((date_purchased = 20071201203454 and last_modified is null) or last_modified = 20071201203454 ) and orders_id = 2 order by date_purchased results in the following: \SELECT orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified, date_purchased, orders_status, orders_date_finished, currency, currency_value FROM orders where ((date_purchased = 18991230 and last_modified is null) or last_modified = 18991230 ) and orders_status in (1,2,3) and%2Ãnà I do not understand why the value of the sql parameter is truncated. Any help is appreciated!! Thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP4 to PHP5 issue
Skip Evans wrote: Tim wrote: Yes, our company used it for three months before dumping it regarding PHP5 incompatibility and some other mistakes.. I ended up having to fix/hack too many things (sessions doing weird things, broken forum, translations all messed up, user roles not working quite right, admin system funked) it wasn't worth my time, we developed a more specialized app for project management internally. Well, I hate to use this kind of language on the list, but I feel I must say that sucks. But I want to thank you Tim for saving me all kinds of time trying to get dP going on PHP5. We still have the old server, of course, running right underneath the new rack jobbies, and I can use it for now to run dP for us. Unfortunately, we're quite wedded to it for project management, having modified and customized it extensively to suit our needs. Hate to use the box, though, just for dP since I had it slated to be converted to a pretty sweet workstation. you don't need to use the box - you can install a 2nd copy of apache and run php4 on it and use the apache ProxyPass directive to make the php4/apache setup available via the apache(2)/php5 [std] webserver. search the archives for 'ProxyPass' Oh well, if life were perfect we'd... we'd... heck, we'd have a lot more fun. Thanks again, Tim. Any more experiences with dP and PHP5 are appreciated, although Tim seems to have pretty well nailed it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] _GET('name') truncates
Ramon wrote: I've written a php script, called test.php, consisting of the following statements: ?php error_reporting(E_ALL); $query = $_GET['sql']; echo $query; ? Using the script with 'small' values for the parameter sql works fine. Although, using the script with the sql query as specified below snip I do not understand why the value of the sql parameter is truncated. Any help is appreciated!! If you really care then you need to sniff the traffic. Chances are that either the browser or server is truncating it. Oh, and please tell me you're not really doing that -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] _GET('name') truncates
I'll let everyone else do the why the hell are you doing this? security blah blah! bad practice blah blah! type stuff.. I'm sure there will be plenty. One reason this may be happening is, depending on your browser, there's a limit to the number of characters you can have in a URL. That seems to be cutting off around 900 characters. That's a lot to put into a URL. If you're really intent on setting up a PHP powered web page to test SQL statements, I might recommend using a web form either using input type=text or textarea form elements and a POST method instead of GET. If you don't have control over the server but do everything remotely, you might consider seeing if there's a phpMyAdmin set up with your hosting service that you can use for database management/queries/etc. If it's a localish database, you can still use phpMyAdmin, but might also have the option of setting up an ODBC connection and using a program like WinSQL or Navicat to connect and do queries and maintenance. If you have more specific questions about any of this, feel free to ask. -TG = = = Original message = = = Hi all, I've written a php script, called test.php, consisting of the following statements: ?php error_reporting(E_ALL); $query = $_GET['sql']; echo $query; ? Using the script with 'small' values for the parameter sql works fine. Although, using the script with the sql query as specified below http://localhost/test.php?sql=SELECT orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified, date_purchased, orders_status, orders_date_finished, currency, currency_value FROM orders where ((date_purchased = 18991230 and last_modified is null) or last_modified = 18991230 ) and orders_status in (1,2,3) and ((date_purchased = 20071201203454 and last_modified is null) or last_modified = 20071201203454 ) and orders_id = 2 order by date_purchased results in the following: \SELECT orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified, date_purchased, orders_status, orders_date_finished, currency, currency_value FROM orders where ((date_purchased = 18991230 and last_modified is null) or last_modified = 18991230 ) and orders_status in (1,2,3) and%2~n~ I do not understand why the value of the sql parameter is truncated. Any help is appreciated!! Thanks in advance! ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] _GET('name') truncates
Ramon-15 wrote: Hi all, I've written a php script, called test.php, consisting of the following statements: ?php error_reporting(E_ALL); $query = $_GET['sql']; echo $query; ? Using the script with 'small' values for the parameter sql works fine. Although, using the script with the sql query as specified below http://localhost/test.php?sql=SELECT orders_id, customers_id, customers_name, customers_company, customers_street_address, ---8--- last_modified = 18991230 ) and orders_status in (1,2,3) and%2Ãnà I do not understand why the value of the sql parameter is truncated. Any help is appreciated!! Thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php i assume you are running into the max size limit(1024?) for $_GET, use _POST instead, furthermore you should apply some security measures! -- View this message in context: http://www.nabble.com/_GET%28%27name%27%29--truncates-tf3176524.html#a8814114 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] _GET('name') truncates
When you send GET all the parameters are sent in the HTTP header and this header has a limited length. If you want to send large parameters in a form you have to use POST which send this data on the HTTP body and it has no limit. On 2/5/07, Ramon [EMAIL PROTECTED] wrote: Hi all, I've written a php script, called test.php, consisting of the following statements: ?php error_reporting(E_ALL); $query = $_GET['sql']; echo $query; ? Using the script with 'small' values for the parameter sql works fine. Although, using the script with the sql query as specified below -- Saludos Oscar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP4 to PHP5 issue
-Message d'origine- De : Jochem Maas [mailto:[EMAIL PROTECTED] Envoyé : lundi 5 février 2007 21:00 À : Skip Evans Cc : 'PHP-General' Objet : Re: [PHP] PHP4 to PHP5 issue Skip Evans wrote: Tim wrote: Yes, our company used it for three months before dumping it regarding PHP5 incompatibility and some other mistakes.. I ended up having to fix/hack too many things (sessions doing weird things, broken forum, translations all messed up, user roles not working quite right, admin system funked) it wasn't worth my time, we developed a more specialized app for project management internally. Well, I hate to use this kind of language on the list, but I feel I must say that sucks. But I want to thank you Tim for saving me all kinds of time trying to get dP going on PHP5. We still have the old server, of course, running right underneath the new rack jobbies, and I can use it for now to run dP for us. Unfortunately, we're quite wedded to it for project management, having modified and customized it extensively to suit our needs. Hate to use the box, though, just for dP since I had it slated to be converted to a pretty sweet workstation. you don't need to use the box - you can install a 2nd copy of apache and run php4 on it and use the apache ProxyPass directive to make the php4/apache setup available via the apache(2)/php5 [std] webserver. Cute, thanks :) search the archives for 'ProxyPass' Oh well, if life were perfect we'd... we'd... heck, we'd have a lot more fun. Thanks again, Tim. Any more experiences with dP and PHP5 are appreciated, although Tim seems to have pretty well nailed it. -- 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] Calculate string width using some font.
At 2:54 PM -0500 2/5/07, Juan Felipe Alvarez Saldarriaga wrote: setcookie wrote: pdf_stringwidth() may help you regards fra* Yea I saw that too but you know, pdflib is not free. Yes, but there's a free version -- Google fpdf. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] How can I know if a browser is cookies enables?
At 9:28 PM +0300 2/5/07, Ed Grigoryan wrote: Hello tedd, Monday, February 5, 2007, 7:04:34 PM, you wrote: At 11:36 PM -0500 2/4/07, Mauricio Muriel wrote: Hello. How can I know if a web browser is cookies enables? Regards Mauricio M. Give it a glass of milk and watch what happens. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com It can also be done with JavaScript. Found an example at: http://techpatterns.com/downloads/javascript_check_cookies.php Ed Yes, it can be done in both js and php -- the point was to just try to set a cookie and see if it works. If it does, then the browser has cookies enabled. If it doesn't, then either the browser doesn't have cookies enabled or you made a mistake in your coding. The Give is a glass of milk thing was simply a poke at the obvious. tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 Commercial Development
Eric Gorr skrev: I haven't tracked this particular issue, but I know when PHP5 was first released is wasn't recommended in a commercial/production environment. However, a lot of time has passed and we're at v5.2 now...have things changed? Have GoogleYahoo, for example, moved to PHP5? Or is PHP4 still the recommendation for such environments? My two cents: Any modern PHP-app should use prepared statements for efficiency and security. PEAR-DB and some other PHP 4 workable abstraction layers can emulate this, but it's only in PHP 5 you get the real thing, with mysqli or PDO, or a PHP class that's built on top of such an interface. To me, that's the must have feature of PHP 5 I can't be without. Nor do I think one could call him-/herself professional still doing old school mysql-interface calls to the DBMS. Lars Gunther -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular Expression
Do you know good regular expression editor or something simialar? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] _GET('name') truncates
At 3:11 PM -0500 2/5/07, [EMAIL PROTECTED] wrote: That seems to be cutting off around 900 characters. That's a lot to put into a URL. That figure varies. I did some testing on one of my servers and the cut off was somewhere around 7000 characters. However, I don't recommend the practice. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] Regular Expression
- Original Message - From: H.T [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Monday, February 05, 2007 10:12 PM Subject: [PHP] Regular Expression Do you know good regular expression editor or something simialar? This goes into the 'something similar' category: From the documentation: The Regex Coach together with this documentation can be downloaded from http://weitz.de/files/regex-coach.exe (Windows installer) or http://weitz.de/files/regex-coach.tgz (Linux tar archive). It's great to try and test the expressions -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] LDAP constants GSLC_SSL_...
Hello Roman, On Monday 05 February 2007 17:12, Roman Neuhauser wrote: actually i am workinh with the ldap functions of php5. Reading the docs i found the constants GSLC_SSL_NO_AUTH GSLC_SSL_ONEWAY_AUTH GSLC_SSL_TWOWAY_AUTH They are simply documented, but i can't find any docs about them. Neither at php.net not via google. So - what they are for and how to use them ? I had *no problems* finding information on these constants using google. The infos you find either link to the PHP page (in different languages) defining this constant (w/o explanation) or to the PHP source code section defining them. I have scanned about the first 50 results google retrieves when looking for GSLC_SSL_NO_AUTH. Anyway i found the docs myself when i limit the findings to Oracle. My suggestion for the docs is to say for this items that they are limited to the oracle directory server (and documented there). Anyway, a usage sample would be nice to have for those they need these constants. For me this question is solved for my scope (i use openldap). regards Petric -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Image upload
I have a small application that ran on one server and now gives me a problem with uploading images on a new server. I am running PHP 4.4.4 now on this server and hoping it is just something that needs adjusted in php.ini, but cannot seem to find. The file is posted as a file fields in a multipart/form-data form, the application tests the file with getimagesize() shown below. I am getting the die response in the browser. I tried echo of the file and it prints a random file name under the /tmp directory on this CentOS Linux system. If I sleep for 10 seconds, the file gets created and gone after the script finishes. Can someone suggest what my problem may be? if (!getimagesize($_FILES['filPhoto']['tmp_name'])) { die('The file you are attempting to upload is not an image file.'); } else { snip -- Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 Commercial Development
On Mon, 2007-02-05 at 22:00 +0100, Keryx Web wrote: Eric Gorr skrev: I haven't tracked this particular issue, but I know when PHP5 was first released is wasn't recommended in a commercial/production environment. However, a lot of time has passed and we're at v5.2 now...have things changed? Have GoogleYahoo, for example, moved to PHP5? Or is PHP4 still the recommendation for such environments? My two cents: Any modern PHP-app should use prepared statements for efficiency and security. PEAR-DB and some other PHP 4 workable abstraction layers can emulate this, but it's only in PHP 5 you get the real thing, with mysqli or PDO, or a PHP class that's built on top of such an interface. To me, that's the must have feature of PHP 5 I can't be without. Nor do I think one could call him-/herself professional still doing old school mysql-interface calls to the DBMS. I sincerely question the competence of someone who advocates a one size fits all approach to programming. There are many reasons why a developer may work with the old-school interface calls. For instance they may be supporting an old school application. They might be writing their own abstract layer. They might be optimizing an extremely loaded system whereby explicitly using the API calls improves speed. Prepared statements only improve speed when making multiple queries to the database having the same format. They slow things down when making unique queries. Any developer worth his salt doesn't need prepared statements to improve security, and assuming prepared statements will protect you is silly since they cannot protect against everything. A professional knows when to use any given approach given the environment and requirements. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 Commercial Development
Stut wrote: tedd wrote: At 12:06 AM -0500 2/5/07, Craige Leeder wrote: PHP is fine for commercial environments. Many people are just afraid of it due to the fact it is known to break some poorly written PHP 4 scripts, and the fact that many people don't think it's new features are necessary. It is perfectly fine to use it in a commercial environment however. I feel the same way about cars. There are some terrible drivers out there, so we should all take the bus. Won't work. There are some *really* terrible bus drivers out there. sandra bullock. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5 Commercial Development
Robert Cummings wrote: On Mon, 2007-02-05 at 22:00 +0100, Keryx Web wrote: Eric Gorr skrev: I haven't tracked this particular issue, but I know when PHP5 was first released is wasn't recommended in a commercial/production environment. However, a lot of time has passed and we're at v5.2 now...have things changed? Have GoogleYahoo, for example, moved to PHP5? Or is PHP4 still the recommendation for such environments? My two cents: Any modern PHP-app should use prepared statements for efficiency and security. PEAR-DB and some other PHP 4 workable abstraction layers can emulate this, but it's only in PHP 5 you get the real thing, with mysqli or PDO, or a PHP class that's built on top of such an interface. To me, that's the must have feature of PHP 5 I can't be without. Nor do I think one could call him-/herself professional still doing old school mysql-interface calls to the DBMS. I sincerely question the competence of someone who advocates a one size fits all approach to programming. There are many reasons why a developer may work with the old-school interface calls. For instance they may be supporting an old school application. They might be writing their own abstract layer. They might be optimizing an extremely loaded system whereby explicitly using the API calls improves speed. Prepared statements only improve speed when making multiple queries to the database having the same format. They slow things down when making unique queries. Any developer worth his salt doesn't need prepared statements to improve security, and assuming prepared statements will protect you is silly since they cannot protect against everything. A professional knows when to use any given approach given the environment and requirements. you forgot to mention the firebird users - who have the choice of using the 'old-school' interface (with all the kick-ass parameterized queries functionality that's actually part of firebird itself, etc) or use the PDO equivelant which is: a, pretty much broken for firebird. b, emulates the superior functionality of the firebird database at the php level. just my 2 old-school db calls. :-) Cheers, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image upload
Robert Fitzpatrick wrote: I have a small application that ran on one server and now gives me a problem with uploading images on a new server. I am running PHP 4.4.4 now on this server and hoping it is just something that needs adjusted in php.ini, but cannot seem to find. The file is posted as a file fields in a multipart/form-data form, the application tests the file with getimagesize() shown below. I am getting the die response in the browser. I tried echo of the file and it prints a random file name under the /tmp directory on this CentOS Linux system. If I sleep for 10 seconds, the file gets created and gone after the script finishes. Can someone suggest what my problem may be? no. but start by stopping the assumption that getimagesize() returns something equivelant to false to mean the same thing as that the file does not exist (or is not an image file.) this might help: http://php.net/is_uploaded_file also check it's not a permissions issue (i.e. the file is being created but the webserver cannot subsequently read the file) if (!getimagesize($_FILES['filPhoto']['tmp_name'])) { die('The file you are attempting to upload is not an image file.'); } else { snip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] LDAP constants GSLC_SSL_...
# [EMAIL PROTECTED] / 2007-02-05 23:03:41 +0100: On Monday 05 February 2007 17:12, Roman Neuhauser wrote: actually i am workinh with the ldap functions of php5. Reading the docs i found the constants GSLC_SSL_NO_AUTH GSLC_SSL_ONEWAY_AUTH GSLC_SSL_TWOWAY_AUTH They are simply documented, but i can't find any docs about them. Neither at php.net not via google. So - what they are for and how to use them ? I had *no problems* finding information on these constants using google. The infos you find either link to the PHP page (in different languages) defining this constant (w/o explanation) or to the PHP source code section defining them. I have scanned about the first 50 results google retrieves when looking for GSLC_SSL_NO_AUTH. Anyway i found the docs myself when i limit the findings to Oracle. They're quite visible when you exclude php. My suggestion for the docs is to say for this items that they are limited to the oracle directory server (and documented there). Yes, that'd be nice. Feel free to submit a PR. -- How many Vietnam vets does it take to screw in a light bulb? You don't know, man. You don't KNOW. Cause you weren't THERE. http://bash.org/?255991 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image upload
Jochem Maas wrote: Robert Fitzpatrick wrote: I have a small application that ran on one server and now gives me a problem with uploading images on a new server. I am running PHP 4.4.4 now on this server and hoping it is just something that needs adjusted in php.ini, but cannot seem to find. The file is posted as a file fields in amultipart/form-data form, the application tests the file with getimagesize() shown below. I am getting the die response in the browser. I tried echo of the file and it prints a random file name under the /tmp directory on this CentOS Linux system. If I sleep for 10 seconds, the file gets created and gone after the script finishes. Can someone suggest what my problem may be? no. but start by stopping the assumption that getimagesize() returns something equivelant to false to mean the same thing as that the file does not exist (or is not an image file.) this might help: http://php.net/is_uploaded_file Yes, actually that is done first, the getimagesize is used it the script to test it as an image. This was written by someone else and worked prior to moving servers. This is a more complete snippet of the code: if (is_uploaded_file($_FILES['filPhoto']['tmp_name'])) { // use getimagesize to make sure it's an image file if (!getimagesize($_FILES['filPhoto']['tmp_name'])) { die('The file you are attempting to upload is not an image file.'); snip also check it's not a permissions issue (i.e. the file is being created but the webserver cannot subsequently read the file) The /tmp directory where it is created is set with 777 perms. I have not checked the destination, but the script does not appear to get back the above point, giving us the die response. -- Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image upload
On Mon, February 5, 2007 4:29 pm, Robert Fitzpatrick wrote: I have a small application that ran on one server and now gives me a problem with uploading images on a new server. I am running PHP 4.4.4 now on this server and hoping it is just something that needs adjusted in php.ini, but cannot seem to find. The file is posted as a file fields in a multipart/form-data form, the application tests the file with getimagesize() shown below. I am getting the die response in the browser. I tried echo of the file and it prints a random file name under the /tmp directory on this CentOS Linux system. If I sleep for 10 seconds, the file gets created and gone after the script finishes. Can someone suggest what my problem may be? The file always goes away when the script finishes. See: http://php.net/move_uploaded_file if (!getimagesize($_FILES['filPhoto']['tmp_name'])) { die('The file you are attempting to upload is not an image file.'); Try various things like file_exists on the file to see if you are getting the file at all. fopen/fread the first N bytes and compare them to what you are uploading, to see if the data that gets there is the data you sent. getimagesize() only reads the first N bytes and then interprets that to decide what kind of file it is, and how big the width/height are, etc. I dunno exactly what N is, but it's relatively small. Different file formats have different size N, and PHP has to figure out what to do for all of them, so maybe it just reads the largest N, or maybe it reads a few bytes and then decides how many to read for the rest of the meta-info. At any rate, if you can fread a couple hundred bytes, and it matches what you uploaded, then you know that something is wrong with the original image and getimagesize() -- You could FTP it up just like your logo or buttons, and use getimagesize() on it, and it STILL wouldn't work. Actually, that's another good test to run: FTP the file up to your images directory and see what getimagesize does on that. } else { snip -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] Image upload
PS I forgot that the $_FILES array also has an 'error' field in it. Check that! On Mon, February 5, 2007 4:29 pm, Robert Fitzpatrick wrote: I have a small application that ran on one server and now gives me a problem with uploading images on a new server. I am running PHP 4.4.4 now on this server and hoping it is just something that needs adjusted in php.ini, but cannot seem to find. The file is posted as a file fields in a multipart/form-data form, the application tests the file with getimagesize() shown below. I am getting the die response in the browser. I tried echo of the file and it prints a random file name under the /tmp directory on this CentOS Linux system. If I sleep for 10 seconds, the file gets created and gone after the script finishes. Can someone suggest what my problem may be? if (!getimagesize($_FILES['filPhoto']['tmp_name'])) { die('The file you are attempting to upload is not an image file.'); } else { snip -- Robert -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] Regular Expression
On Mon, February 5, 2007 3:12 pm, H.T wrote: Do you know good regular expression editor or something simialar? The Regex Coach Helps you figure things out piece by piece with fancy color highlighting of what matches what, and a tree graph and everything. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] _GET('name') truncates
GET args can be truncated at some number, if the server does not want to allow longer args. I believe the minimum compliant limit is 1024 bytes. You also REALLY ought to be using http://php.net/urlencode on the GET args. And if you are spitting that URL out to a browser, you should then use http://php.net/htmlentities on it as well. On Mon, February 5, 2007 12:42 pm, Ramon wrote: Hi all, I've written a php script, called test.php, consisting of the following statements: ?php error_reporting(E_ALL); $query = $_GET['sql']; echo $query; ? Using the script with 'small' values for the parameter sql works fine. Although, using the script with the sql query as specified below http://localhost/test.php?sql=SELECT orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified, date_purchased, orders_status, orders_date_finished, currency, currency_value FROM orders where ((date_purchased = 18991230 and last_modified is null) or last_modified = 18991230 ) and orders_status in (1,2,3) and ((date_purchased = 20071201203454 and last_modified is null) or last_modified = 20071201203454 ) and orders_id = 2 order by date_purchased results in the following: \SELECT orders_id, customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, last_modified, date_purchased, orders_status, orders_date_finished, currency, currency_value FROM orders where ((date_purchased = 18991230 and last_modified is null) or last_modified = 18991230 ) and orders_status in (1,2,3) and%2Ãnà I do not understand why the value of the sql parameter is truncated. Any help is appreciated!! Thanks in advance! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] _GET('name') truncates
On Mon, February 5, 2007 2:11 pm, [EMAIL PROTECTED] wrote: If you're really intent on setting up a PHP powered web page to test SQL statements, I might recommend using a web form either using input type=text or textarea form elements and a POST method instead of GET. I belive the minimum compliant POST size is... 4096 bytes??? The HTTP spec upped this every version release, it seems like, so I could never keep track. *MOST* servers are way more lenient on the POST size limit than GET, though, in my experience of servers that enforce a limit. I believe Apahce mod_security may have such a limit -- Actually, that won't even let you pass in something that looks like a whole SQL query in the first place, which is a PITA if you want a back-end admin page with a simple POST form to replace the phpMyAdmin bloatware. :-( -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] Server Stall
Hi, Matt Thanks for answer, I try your solution and use it. And interestingly I found this, If my request coming from second tab of firefox it will wait util first request done. I think php does not open second thread for same session... Anyway thanks for answer. It was very useful.. Regards On Monday 05 February 2007 20:32, Matt Carlson wrote: function doRequest($method, $url, $vars = '', $headers = '0') { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, $headers); curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt'); if ($method == 'POST') { curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $vars); } $data = curl_exec($ch); curl_close($ch); if ($data) { return $data; } else { return curl_error($ch); } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Converting string representation of a directory to multi-dimensional array
On Mon, February 5, 2007 12:27 pm, Matt Carlson wrote: Over the weekend, I was tasked with taking a string representation of a directory ('\Interface\Addons\some dir\some file'), which can vary in length (no set number of depths) to a multi-dimensional array (i.e. array('Interface' = array('Addons' = array('some dir' = somefile)));). We came up with a very ugly hack to do it, but I'm curious if anyone can help us wrap our head around a better solution, without using eval (which we were able to find that solution quickly, but do not want to use eval). Our situation is a little unique in the fact that these files don't actually exist on a filesystem, so it makes it a bit more tough to actually create this array. Thanks for any help you can give in cleaning this up somewhat. Here is the function we currently use: ?php $array = array(); addToList('\interface\addons\clearfont\clearfont.toc2', $array); addToList('\interface\addons\clearfont\clearfont.toc3', $array); addToList('\interface\addons\clearfont\clearfont.toc4', $array); addToList('\interface\addons\clearfont\clearfont.toc5', $array); addToList('\interface\addons\clearfont\subdir\something.toc', $array); function addToList($path){ $parts = explode('\\', $path); $result = array(); $parts = array_reverse($parts); foreach($parts as $part){ //something with array_splice here... $result = array_splice(array($result), $part); //??? } } -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] PHP4 to PHP5 issue
Your problem is the $db is NOT an Object. $q is fine as-is. Figure out why $db isn't getting be an object -- Probably because the username/password and/or permissions to connect to the DB aren't set up correctly. Or you didn't copy over the DB tables PostNuke and dotProject need. On Mon, February 5, 2007 11:58 am, Skip Evans wrote: Hey all, I installed a new FreeBSD 6.0 server here in the office with PHP5. I moved over several sites we developed under PHP4, and all of those seem to be functioning perfectly, but I am getting an error on to sites, on PostNuke based and our dotProject system. Both errors are the same, and here is the one from dotProject: Fatal error: Call to a member function Execute() on a non-object in /usr/home/dotproject/public_html/classes/query.class.php on line 589 And the code: $this-_query_id = $db-Execute($q); Where $q is a pretty typical SQL statement. What I'm wondering if there is an easy way to convert $q to an object type rather than a string to satisfy Execute? Or some other straightforward fix? Thanks! Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 http://bigskypenguin.com =-=-=-=-=-=-=-=-=-= -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] Server Stall
On Mon, February 5, 2007 11:42 am, Sancar Saran wrote: Hi, One of my scripts are using wget to get external xml data $fp = popen (wget -O - '.$dst.' | cat,r); Some time $dst host responds very slowly. And that time if I open another connection to same server the second request waits to complete wget operation. I'm very noobie about this file operations. Is there any suggestion about this situation ? If you are trying to open multiple streams in a single PHP script in parallel, you want http://php.net/stream_select If you are just testing it with another script, and they are both taking a long time, that just means that $dst is slow right now. I would also suggest that you pull out the wget part and put it into a cron job, and then let PHP use the most recent download from wget that's available. That way, your script isn't sitting around waiting for a slow download. It just runs at max speed on the local file which is the most recent download available. It sounds bassackwards, but ends up being a much easier solution, as well as a better user experience, and more maintainable, as you've pulled the whole wget mess out of the PHP script and modularized it. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] Encoding problem
The document IS UTF-8. The character does not seem to be. It comes from a mySQL database. However, also the database settings are also UTF-8. The field was entered into the database with phpMyAdmin. I tried it now local on my test-system and remote, so the database itself does not seem to be the problem. Could it be phpMyAdmin? Jon Anderson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Guus Ellenkamp wrote: I have a string with an n with a tilde. mb_detect_encoding says it's UTF-8. I set the http encoding to UTF-8 and also the internal encoding. However, I cannot produce proper output with echo $varwithtilde. echo $returnArray[$i]-address1.' has '.mb_detect_encoding($returnArray[$i]-address1) does NOT produce correct output in a browser or with the W3C validator, although it says the encoding of the var is UTF-8. What's wrong? Character set issues can be very complex, but I'm going to take a guess If you're outputting something that is actually UTF-8, you'll need to make sure that you've done these: header('Content-Type: text/html; charset=utf-8'); I believe that IE6 requires this one as well within your html head. meta http-equiv=Content-Type content=text/html; charset=utf-8 / If that doesn't work, then it could be that your character isn't actually UTF-8 encoded. jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Encoding problem
Found it. Have to use: mysql_query(SET CHARACTER SET 'utf8', $link); Guus Ellenkamp [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] The document IS UTF-8. The character does not seem to be. It comes from a mySQL database. However, also the database settings are also UTF-8. The field was entered into the database with phpMyAdmin. I tried it now local on my test-system and remote, so the database itself does not seem to be the problem. Could it be phpMyAdmin? Jon Anderson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Guus Ellenkamp wrote: I have a string with an n with a tilde. mb_detect_encoding says it's UTF-8. I set the http encoding to UTF-8 and also the internal encoding. However, I cannot produce proper output with echo $varwithtilde. echo $returnArray[$i]-address1.' has '.mb_detect_encoding($returnArray[$i]-address1) does NOT produce correct output in a browser or with the W3C validator, although it says the encoding of the var is UTF-8. What's wrong? Character set issues can be very complex, but I'm going to take a guess If you're outputting something that is actually UTF-8, you'll need to make sure that you've done these: header('Content-Type: text/html; charset=utf-8'); I believe that IE6 requires this one as well within your html head. meta http-equiv=Content-Type content=text/html; charset=utf-8 / If that doesn't work, then it could be that your character isn't actually UTF-8 encoded. jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] _GET('name') truncates
On Mon, February 5, 2007 2:36 pm, Oscar Gosdinski wrote: When you send GET all the parameters are sent in the HTTP header and this header has a limited length. If you want to send large parameters in a form you have to use POST which send this data on the HTTP body and it has no limit. Last time I read the HTTP spec (some years ago, and outdated...) Web server vendors were encouraged to accept as much POST data as practical. To be compliant, they had to accept at least 4K??? This only applies to raw POST, not, say file upload with the ENCTYPE set. If you are certain that it is truly unlimited by RFC Spec, I'd love a reference... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] Calculate string width using some font.
On Mon, February 5, 2007 11:22 am, Juan Felipe Alvarez Saldarriaga wrote: 1. Create a dummy image. 2. Set the text there using font X and the font size Y (it seems that when I create the image it renders it at 72dpi so I need to reduce it at 300dpi) When I did a 300-dpi PDF thingie, I defined a variable $resolution which was 304.8, and multiplied it by the inches I wanted to get 300 dpi out... I don't know *how* I got the 304.8 number... I'm not sure what the imagettftext() function returns, are those values measured in pixels ? I believe those are in raw pixels, yes. I read in some page that the proportion to reduce the image at 300dpi is reduce the size to 24% of its original size. You'd want to make it 300/72 times as large as you would think? Only I obviously didn't do that, so I dunno... http://www.printingforless.com/resolution.html That's the code: *** // Create dummy image. $rsc_image = imagecreate( 1, 1 ); // Set image. $arr_ftx = imagettftext( $rsc_image, $int_font_size, 0, 0, 0, -1, ./fonts/{$str_font_file}, $str_variable_value ); // Destroy dummy image. imagedestroy( $rsc_image ); // Set structure of widths. // TODO: Magik numbers. $arr_variable_pixels[$str_variable_index] = ( ( $arr_ftx[2] * 24 ) / 100 ); I think you've got the percentage backwards here, as it's 24% to go from 300 to 72... You want to force a 72 DPI thing to end up being scalable down by 24% to end up at 300. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] Calculate string width using some font.
On Mon, February 5, 2007 12:04 pm, Jochem Maas wrote: there is no dpi - your screen printer has a certain dpi and that determine how big the image displays on either. This is true, but ultimately, if you want the dang thing to print out at 300 DPI, then you want enough pixels to make that look pretty, and you want to multiply everything by the right number to get that many pixels so when it doesn't print, it doesn't suck. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] Calculate string width using some font.
On Mon, February 5, 2007 1:54 pm, Juan Felipe Alvarez Saldarriaga wrote: setcookie wrote: pdf_stringwidth() may help you regards fra* Yea I saw that too but you know, pdflib is not free. Depends on your usage and if you need the PDI part or not... PDI == Smush two PDF together. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] is there socket.so file?
On Mon, February 5, 2007 10:30 am, Craige Leeder wrote: On Linux, it is necessary to compile php with the --enable-sockets flag to be able to use php's socket functions. Unless it's PHP 4, and it's already in, or PHP 5 and it's in PECL or... It's just not that simple. Sorry. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] PHP5 Commercial Development
On Mon, February 5, 2007 10:55 am, Stut wrote: tedd wrote: At 12:06 AM -0500 2/5/07, Craige Leeder wrote: PHP is fine for commercial environments. Many people are just afraid of it due to the fact it is known to break some poorly written PHP 4 scripts, and the fact that many people don't think it's new features are necessary. It is perfectly fine to use it in a commercial environment however. I feel the same way about cars. There are some terrible drivers out there, so we should all take the bus. Won't work. There are some *really* terrible bus drivers out there. Yeah a buddy of mine got hit by a bus, and he ended up INSIDE the wheel well wrapped around the tire before the driver actually stopped. It was pretty ugly... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] PHP book reviewers wanted
On Mon, February 5, 2007 10:09 am, tedd wrote: At 1:05 AM -0200 2/5/07, Manuel Lemos wrote: Demonstrating good English writing skills and having published good book reviews in the past gets me preference. gets me preference ??? Me get any money for this? Hey, go easy on the non-native speakers... I'm betting your Spanish is worse than his English... [This is aside from the ads jabs some are taking, which is easy to solve -- don't use his site.] -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] PHP book reviewers wanted
On Mon, February 5, 2007 10:56 am, Manuel Lemos wrote: Often writing books is also not worth the effort. Many authors that try it, only write one book and then give up because the books do not sell enough and they realize they can make more doing something else like consulting. If writing the book isn't going to get you paying gigs because you're the expert having written the book, then you're almost for sure going to be getting paid less than minimum wage if you account the hours correctly, as I understand it. I can state for certain that being a Tech Reviewer is even worse pay and little odds of it making you any money, really. Though it is a nifty bullet point and gives you something to talk about in a job interview, where it can maybe pay off. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] Writting a simple proxy in PHP
I would like to forward on the server side (also called proxy or server-side redirect) some queries that get to my PHP script. A naive approach is to do: print(implode(, file(http://localhost:8090; . $REQUEST_URI))); Where http://localhost:8090 is the address I want to proxy to. But of course, this only works for simple GET requests. It does not forward headers (like Authentication), and won't work if the request is a POST. Has anyone a suggestion on how I could implement a better proxy? I am not looking for a perfect solution. Something that would forward headers and handle posts would be good enough. Alex -- View this message in context: http://www.nabble.com/Writting-a-simple-proxy-in-PHP-tf3178331.html#a8819622 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] include file identifier
On Mon, February 5, 2007 10:09 am, Craige Leeder wrote: On 2/5/07, Richard Lynch [EMAIL PROTECTED] wrote: If you want to avoid the overhead of include_once, it's a pretty common practice (borrowed from C .h files) to do: Just out of curiosity, how much additional overhead are we talking about? What version of PHP are we talking about? In its early days, it was very expensive, particularly if your code-base grew very large... Later, it was only expensive if your client was doing something whack like dynamically including hundreds of file snippets. (Don't ask.) These days, I would hazard a guess that it's as optimized as it can be, really, but you'd have to test and read source to be sure. Note that in all cases, the performance issue kicked in when you were including LOTS of different files, as the search space for what was already included grew. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] who is online?
If you use http://php.net/session_start, I guess you could declare that your session timeout *IS* the definition of current users... But, really, even at 5 minutes, you may be counting a lot of people who have LEFT your site. There is no real number for this. Do whatever you want. On Mon, February 5, 2007 6:35 am, benifactor wrote: i have built a function to tell me how many users are on my site at any given time... ? //define function function bc_who ($who, $location) { //first we erase any expired entries //entries will expire after 5 mins $whoTime = time(); $whoTime = $whoTime - 300; mysql_query(Delete FROM bc_who where expire $whoTime) or die(mysql_error()); //here we difine the variables needed to preform the check $whoExpire = time(); $whoIp = $_SERVER[REMOTE_ADDR]; //this will be changed as soon as user registration is finished $whoUser= Guest; //do the actual mysql queries mysql_query(Delete FROM bc_who where '$whoIp' = ip); mysql_query(Insert INTO bc_who (id, user, ip, location, expire, status) VALUES (NULL, '$whoUser', '$whoIp', '$location', '$whoExpire', '$whoStatus')); } //end who is function ? this fuction works fine, however, i want to know if what i am about to ask is possible. the problem i have is, this function assumes that after five minutes if the user has not refreshed the page, or gone onto another page the user must be gone. in reality, i have pages users might be on for an hour or so without refreshing. i want my whos online to as acurate as possible so is there a way to do this on the fly? like, forgetting about the expire time and using a server side peice of code to communicate to the database, when there is no more communication the entry is deleted? please tell me there is a way, thank you in advance. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/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] is there socket.so file?
On 2/5/07, Richard Lynch [EMAIL PROTECTED] wrote: Unless it's PHP 4, and it's already in, or PHP 5 and it's in PECL or... It's just not that simple. Sorry. Ah, I didn't realize they stopped bundling it with PHP as of PHP 5.3.0. That sucks. It used to be that simple. - Craige -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP book reviewers wanted
Hello, on 02/06/2007 12:43 AM Richard Lynch said the following: Often writing books is also not worth the effort. Many authors that try it, only write one book and then give up because the books do not sell enough and they realize they can make more doing something else like consulting. If writing the book isn't going to get you paying gigs because you're the expert having written the book, then you're almost for sure going to be getting paid less than minimum wage if you account the hours correctly, as I understand it. Right. Most author write books because they love what they write about. I know very few people that wrote more than one PHP book. Dedicating time writing books is a big sacrifice. It is not the most efficient way to make a living. Anyway, keep in mind that a US minimum wage is a reasonable amount of money for people in other countries. Writing books is not such a bad money if they get published by an US or European publisher. The whole PHP community that buy their books should be thankful because some writers work very hard to make a living. Some authors of books that I reviewed in the PHPClasses site have written me asking if I could review their new books. If that encourages them to keep writing good books, I am pleased to help them. Unfortunately I do not have the time to review all books that I am asked to review. That is why I am encouraging other people with more time than me to work on it. I can state for certain that being a Tech Reviewer is even worse pay and little odds of it making you any money, really. Though it is a nifty bullet point and gives you something to talk about in a job interview, where it can maybe pay off. Right. Anyway, I am not talking about being Tech Reviewer of books that were not yet published. I am talking about published books, so there is not even a money compensation for people that publish reviews in the PHPClasses site. The only compensation is that reviewers will keep the review copies for themselves. -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator http://www.metastorage.net/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP book reviewers wanted
Hello, on 02/06/2007 12:39 AM Richard Lynch said the following: Demonstrating good English writing skills and having published good book reviews in the past gets me preference. gets me preference ??? Me get any money for this? Hey, go easy on the non-native speakers... I'm betting your Spanish is worse than his English... Thanks for helping to clarify the native speakers. Just a minor correction. My Spanish is not better than my English. I am a native Portuguese speaker. ;-) cultural_momentPortuguese is also a latin based language like Spanish, French, Italian and Romanian, but it is a distinct idiom./cultural_moment [This is aside from the ads jabs some are taking, which is easy to solve -- don't use his site.] Right. After all everybody is free to go anywhere you want or not, with or without ads. Anyway, since you brought that up, I would like to clarify that this is often misunderstood issue. Nobody likes ads, including myself. Ads are obviously necessary to keep the site viable. Otherwise it would have been closed a long time ago. Anyway, for those very intolerant to ads, at least there is an option in the user options page that the can check to disable pop under and interstitial ads. This was never a secret, but I am not encouraging anybody to use that option either. The site needs the ad revenue generated by all the advertisiment. That option does not disable all ads, but at least disables probably the most annoying. For those that would like to see no ads at all and benefit from full site loading speed, after almost 5 years of promises, in the next months I will finally launch the package of premium services that among several other interesting benefits, it will provide an ad free site navigation, for a small monthly fee. I know that only those that real care about the site will adhere. But at least there will finally be an option for all those that avoid visiting the site because of the ads. -- Regards, Manuel Lemos Metastorage - Data object relational mapping layer generator http://www.metastorage.net/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular Expression
5 feb 2007 kl. 22.12 skrev H.T: Do you know good regular expression editor or something simialar? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Regex online: www.regextester.com //frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php