Re: [PHP] cookie question
David R wrote: Hello, I have a cookie question. I have the following code is a file called tc.php ? global $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $settings, $sql ; $val=123; setcookie (auth, $val , time() + 3600); $cookie = $HTTP_COOKIE_VARS['auth']; echo cookie is: $cookie; ? I have no problem retrieving the value cookie value ( 123 ) on my local machine but when I post to the internet I can't get the cookie value. Any ideas why? Did you set the cookie for the production server domain? Cookies for your local machine won't still be there once you upload, you know. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Red Hat 9, Apache 2, and PHP
Does anyone have any idea or could give me an idea why php apache 2.0 is not 'good' together? Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -Original Message- From: Mark Charette [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 9:02 AM To: [EMAIL PROTECTED]; Shena Delian O'Brien Subject: Re: [PHP] Re: Red Hat 9, Apache 2, and PHP Apache 2.x.x IS a production quality server, just not with PHP. Works great with Tomcat, mod_jk2, Struts, etc. - Original Message - From: Shena Delian O'Brien [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 03, 2003 8:04 PM Subject: Re: [PHP] Re: Red Hat 9, Apache 2, and PHP Does anyone know why Red Hat would switch to Apache 2.x.x when it is well known that 2.x.x is NOT a production version? Brad Pauly wrote: Just thought I would share my experience with RH9. I have been running Apache 1.3.27 and PHP 4.3.2 on RH9 for a couple weeks (since 4.3.2 came out anyway, and 4.3.1 prior to that) on a test server. All are compiled from source. The only problem I have had was a bug with the version of mogrify that is bundled with RH9. That was fixed by 'upgrading' to an older version. Other than that it has been fine. Brad -- 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] Using TTF within an image
Can someone please show me how to change the display font to a TTF in this code? I looked at the online manual under imageloadfont(), but I did not understand it enough. I have the MS TTFs installed on my server and they are working correctly. Thanks Chris ?php header (Content-type: image/png); $string = Text message goes here; $font = 2; $width = ImageFontWidth($font) * strlen($string); $height = ImageFontHeight($font); $im = @imagecreate ($width,$height); $background_color = imagecolorallocate ($im, 255, 255, 255); //white background $text_color = imagecolorallocate ($im, 0, 0,0);//black text imagestring ($im, $font, 0, 0, $string, $text_color); imagepng ($im); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question
I have never read anything about a production server domain. How do I set the cookie for it? Thanks. David R Leif K-Brooks [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] David R wrote: Hello, I have a cookie question. I have the following code is a file called tc.php ? global $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $settings, $sql ; $val=123; setcookie (auth, $val , time() + 3600); $cookie = $HTTP_COOKIE_VARS['auth']; echo cookie is: $cookie; ? I have no problem retrieving the value cookie value ( 123 ) on my local machine but when I post to the internet I can't get the cookie value. Any ideas why? Did you set the cookie for the production server domain? Cookies for your local machine won't still be there once you upload, you know. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Red Hat 9, Apache 2, and PHP
Apache2 has a number of different modes it can work in. These modes are called MPM's. The default MPM is called Worker which is a multithreaded model. PHP, mod_perl, mod_python, and any other similar technology which links directly into the httpd processes will need to be perfectly threadsafe and reentrant to work effectively with a threaded Apache2 mpm. This is doable for the core of PHP, but there are literally hundreds of 3rd party libraries that can be linked into PHP and nobody whether or not these libraries are threadsafe. And figuring out if a specific library is threadsafe or not is non-trivial and it can very from one platform to another. And just to make it even harder, this stuff will appear to work fine until you put it under load or hit very specific race conditions which makes it nearly impossible to debug. So, since we can't tell you for sure that a threaded Apache2 mpm + PHP will work we do not suggest you use it for a production server. And since we can't know for sure, none of the main PHP developers use this combination for our own servers which compounds the problem because it is not receiving anywhere near the amount of realworld testing required to work out all the little issues above and beyond this threading unknown. There is an Apache2 mpm, called prefork, which isn't threaded and basically makes Apache2 look like Apache1. But hey, we have a very good server already that looks like Apache1. In the end I don't see Apache2+PHP ever becoming a production platform with the current architecture. The only way I see it ever working is to pull PHP out of Apache and use a fastcgi approach. Or, with time, perhaps we will learn how to make sure a library is perfectly threadsafe and safe to use in a multithreaded Apache2. For now, I really see no reason not to simply use Apache1 if you want a robust, fast and stable web server. -Rasmus On Fri, 4 Jul 2003, Ow Mun Heng wrote: Does anyone have any idea or could give me an idea why php apache 2.0 is not 'good' together? Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -Original Message- From: Mark Charette [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 9:02 AM To: [EMAIL PROTECTED]; Shena Delian O'Brien Subject: Re: [PHP] Re: Red Hat 9, Apache 2, and PHP Apache 2.x.x IS a production quality server, just not with PHP. Works great with Tomcat, mod_jk2, Struts, etc. - Original Message - From: Shena Delian O'Brien [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 03, 2003 8:04 PM Subject: Re: [PHP] Re: Red Hat 9, Apache 2, and PHP Does anyone know why Red Hat would switch to Apache 2.x.x when it is well known that 2.x.x is NOT a production version? Brad Pauly wrote: Just thought I would share my experience with RH9. I have been running Apache 1.3.27 and PHP 4.3.2 on RH9 for a couple weeks (since 4.3.2 came out anyway, and 4.3.1 prior to that) on a test server. All are compiled from source. The only problem I have had was a bug with the version of mogrify that is bundled with RH9. That was fixed by 'upgrading' to an older version. Other than that it has been fine. Brad -- 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] Re: Red Hat 9, Apache 2, and PHP
Thanks for the Explanation. I guess I need to take another look at apache or try to get apache 1 installed for my server. I'm currently trying to get linux+apache+mysql+php up. (If i can ever figure out how to properly design my database) Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 2:48 PM To: Ow Mun Heng Cc: Mark Charette; [EMAIL PROTECTED]; Shena Delian O'Brien Subject: RE: [PHP] Re: Red Hat 9, Apache 2, and PHP Apache2 has a number of different modes it can work in. These modes are called MPM's. The default MPM is called Worker which is a multithreaded model. PHP, mod_perl, mod_python, and any other similar technology which links directly into the httpd processes will need to be perfectly threadsafe and reentrant to work effectively with a threaded Apache2 mpm. This is doable for the core of PHP, but there are literally hundreds of 3rd party libraries that can be linked into PHP and nobody whether or not these libraries are threadsafe. And figuring out if a specific library is threadsafe or not is non-trivial and it can very from one platform to another. And just to make it even harder, this stuff will appear to work fine until you put it under load or hit very specific race conditions which makes it nearly impossible to debug. So, since we can't tell you for sure that a threaded Apache2 mpm + PHP will work we do not suggest you use it for a production server. And since we can't know for sure, none of the main PHP developers use this combination for our own servers which compounds the problem because it is not receiving anywhere near the amount of realworld testing required to work out all the little issues above and beyond this threading unknown. There is an Apache2 mpm, called prefork, which isn't threaded and basically makes Apache2 look like Apache1. But hey, we have a very good server already that looks like Apache1. In the end I don't see Apache2+PHP ever becoming a production platform with the current architecture. The only way I see it ever working is to pull PHP out of Apache and use a fastcgi approach. Or, with time, perhaps we will learn how to make sure a library is perfectly threadsafe and safe to use in a multithreaded Apache2. For now, I really see no reason not to simply use Apache1 if you want a robust, fast and stable web server. -Rasmus On Fri, 4 Jul 2003, Ow Mun Heng wrote: Does anyone have any idea or could give me an idea why php apache 2.0 is not 'good' together? Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -Original Message- From: Mark Charette [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 9:02 AM To: [EMAIL PROTECTED]; Shena Delian O'Brien Subject: Re: [PHP] Re: Red Hat 9, Apache 2, and PHP Apache 2.x.x IS a production quality server, just not with PHP. Works great with Tomcat, mod_jk2, Struts, etc. - Original Message - From: Shena Delian O'Brien [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 03, 2003 8:04 PM Subject: Re: [PHP] Re: Red Hat 9, Apache 2, and PHP Does anyone know why Red Hat would switch to Apache 2.x.x when it is well known that 2.x.x is NOT a production version? Brad Pauly wrote: Just thought I would share my experience with RH9. I have been running Apache 1.3.27 and PHP 4.3.2 on RH9 for a couple weeks (since 4.3.2 came out anyway, and 4.3.1 prior to that) on a test server. All are compiled from source. The only problem I have had was a bug with the version of mogrify that is bundled with RH9. That was fixed by 'upgrading' to an older version. Other than that it has been fine. Brad -- 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] Break, Exit, Die, Kill, Maime and Stab
I have added returns to where I had originally added breaks and it works perfectly. The included code is executed till return is called and then the included script is no longer executed. Jonathan So...why not write the entire included file as a function and then call that function instead of using include? I'd be interested, though, to hear if the return broke out of the include. -- Jeff Moser Web Developer ihigh Inc. / Host Interactive 859.232.8282 -- -Original Message- From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2003 5:10 AM To: 'Jim Lucas'; Jonathan Pitcher; [EMAIL PROTECTED] Subject: RE: [PHP] Break, Exit, Die, Kill, Maime and Stab -Original Message- From: Jim Lucas [mailto:[EMAIL PROTECTED] Sent: 02 July 2003 22:47 Technically you are not outside of a function. you need to use one of the include or require functions to include the file right? include and require are not functions -- they are language constructs. (Proof: include 'file.inc'; works.) Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] include/require inside of function
Is there anyway to include a file inside of a function and have the included stuff be global? For instance if I defined a class or a function in that include file, I want to be able to use that class outside of the function. On the documentation for include() a poster commented that it did indeed work like this, but my testing indicates it does not. Everything stays local to the function and goes away when the function ends. Is there a way? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Red Hat 9, Apache 2, and PHP
Well said Rasmus, I have also been wondering why PHP with Apache2 wasn't considered a production enviroment, and if I should be heading that way but after readinng your post I feel a lot better, I have always been very happy with Apache1 and PHP if it aint broke then no need to fix I say. Regards, Joseph Blythe -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED] Sent: Friday, 4 July 2003 4:18 PM To: Ow Mun Heng Cc: Mark Charette; [EMAIL PROTECTED]; Shena Delian O'Brien Subject: RE: [PHP] Re: Red Hat 9, Apache 2, and PHP Apache2 has a number of different modes it can work in. These modes are called MPM's. The default MPM is called Worker which is a multithreaded model. PHP, mod_perl, mod_python, and any other similar technology which links directly into the httpd processes will need to be perfectly threadsafe and reentrant to work effectively with a threaded Apache2 mpm. This is doable for the core of PHP, but there are literally hundreds of 3rd party libraries that can be linked into PHP and nobody whether or not these libraries are threadsafe. And figuring out if a specific library is threadsafe or not is non-trivial and it can very from one platform to another. And just to make it even harder, this stuff will appear to work fine until you put it under load or hit very specific race conditions which makes it nearly impossible to debug. So, since we can't tell you for sure that a threaded Apache2 mpm + PHP will work we do not suggest you use it for a production server. And since we can't know for sure, none of the main PHP developers use this combination for our own servers which compounds the problem because it is not receiving anywhere near the amount of realworld testing required to work out all the little issues above and beyond this threading unknown. There is an Apache2 mpm, called prefork, which isn't threaded and basically makes Apache2 look like Apache1. But hey, we have a very good server already that looks like Apache1. In the end I don't see Apache2+PHP ever becoming a production platform with the current architecture. The only way I see it ever working is to pull PHP out of Apache and use a fastcgi approach. Or, with time, perhaps we will learn how to make sure a library is perfectly threadsafe and safe to use in a multithreaded Apache2. For now, I really see no reason not to simply use Apache1 if you want a robust, fast and stable web server. -Rasmus On Fri, 4 Jul 2003, Ow Mun Heng wrote: Does anyone have any idea or could give me an idea why php apache 2.0 is not 'good' together? Cheers, Mun Heng, Ow H/M Engineering Western Digital M'sia DID : 03-7870 5168 -Original Message- From: Mark Charette [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 9:02 AM To: [EMAIL PROTECTED]; Shena Delian O'Brien Subject: Re: [PHP] Re: Red Hat 9, Apache 2, and PHP Apache 2.x.x IS a production quality server, just not with PHP. Works great with Tomcat, mod_jk2, Struts, etc. - Original Message - From: Shena Delian O'Brien [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 03, 2003 8:04 PM Subject: Re: [PHP] Re: Red Hat 9, Apache 2, and PHP Does anyone know why Red Hat would switch to Apache 2.x.x when it is well known that 2.x.x is NOT a production version? Brad Pauly wrote: Just thought I would share my experience with RH9. I have been running Apache 1.3.27 and PHP 4.3.2 on RH9 for a couple weeks (since 4.3.2 came out anyway, and 4.3.1 prior to that) on a test server. All are compiled from source. The only problem I have had was a bug with the version of mogrify that is bundled with RH9. That was fixed by 'upgrading' to an older version. Other than that it has been fine. Brad -- 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] cookie question
Try setcookie(auth,$val,time() + 3600,/,.avenew.com); also look here : http://examples.weberdev.com/get_example.php3?count=67 Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: David R [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 9:44 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] cookie question I have never read anything about a production server domain. How do I set the cookie for it? Thanks. David R Leif K-Brooks [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] David R wrote: Hello, I have a cookie question. I have the following code is a file called tc.php ? global $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $settings, $sql ; $val=123; setcookie (auth, $val , time() + 3600); $cookie = $HTTP_COOKIE_VARS['auth']; echo cookie is: $cookie; ? I have no problem retrieving the value cookie value ( 123 ) on my local machine but when I post to the internet I can't get the cookie value. Any ideas why? Did you set the cookie for the production server domain? Cookies for your local machine won't still be there once you upload, you know. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- 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] cookie question
David R wrote: I have never read anything about a production server domain. How do I set the cookie for it? Same way as for the cookie on your local server, but change the cookie's domain. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] track_vars in apache httpd.conf
hello, I faced a problem with apache httpd.conf. I have a virtual host and i write in httpd.conf that lines : IfModule mod_php4.c php_value track_vars Off /IfModule but not working please advise. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP to Excel Export
On Fri, 4 Jul 2003 [EMAIL PROTECTED] wrote: excel has a char limit of 255 , if you can find a work around for it please do let me know , also , check out the bifwriter , i think the pear packages just outputs csv right ? Spredsheet_Excel_Writer outputs an Excel binary, not csv. -- Mika Tuupola http://www.appelsiini.net/~tuupola/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] include/require inside of function
On Fri, 4 Jul 2003, Aric Caley wrote: Is there anyway to include a file inside of a function and have the included stuff be global? For instance if I defined a class or a function in that include file, I want to be able to use that class outside of the function. On the documentation for include() a poster commented that it did indeed work like this, but my testing indicates it does not. Everything stays local to the function and goes away when the function ends. Is there a way? Functions defined in included files are always global. So I guess it is just the variable you want to put out into the global symbol table. It's a little bit tricky, but you can do it like this: function foo($filename) { extract($GLOBALS, EXTR_REFS); include $filename; $arr = array_diff(get_defined_vars(),$GLOBALS); foreach($arr as $var=$val) $GLOBALS[$var] = $val; } -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Need a function to calculate time difference.
See if this helps you Getting the difference between two time strings. http://examples.weberdev.com/get_example.php3?count=3307 Difference between two dates (i.e. between today and a date in future). The program is based on php-timestamp, but in your browser you see the usual dates(i.e.: dd.mm.) http://examples.weberdev.com/get_example.php3?count=3240 Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Jack Sasportas [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2003 10:17 PM To: php Subject: Re: [PHP] Need a function to calculate time difference. datetime. Thanks Jim Lucas wrote: what type of format does your column take? date time datetime ?? Jim Lucas - Original Message - From: Jack Sasportas [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Wednesday, July 02, 2003 2:11 PM Subject: [PHP] Need a function to calculate time difference. I am trying to find a function or information on how to properly take a start time and an end time from mysql timestamps in order to calculate time taken. So in theory $endtime-$starttime = timespent. It would be great if this understood that 11:55 pm til 12:10am one day apart only equals 15 minutes. Links, example code etc would be great! Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] track_vars in apache httpd.conf
hello Am Fre, 2003-07-04 um 09.27 schrieb Tassos T: hello, I faced a problem with apache httpd.conf. I have a virtual host and i write in httpd.conf that lines : IfModule mod_php4.c php_value track_vars Off /IfModule trie only Off not Off but i don't know if you cann write this line in a ifmodule sektion ? this command only stands in directory/directorysektion BR/Torsten -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Setting Cookie Going Nuts
Did you solve this issue? What does $_SERVER[HTTP_HOST] return? Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Mike Morton [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2003 4:03 PM To: [PHP - GENERAL] Subject: [PHP] Setting Cookie Going Nuts I am trying to issue a cookie, using the set cookie directive, and it is not working for some reason. The code below I have used before with perfect success. The only difference between the other place that I am using it is that the other place has globals on, this server has globals off (tho I turned them on a and it made no difference), and the other server is running 4.3.2 where this one is 4.3.0 I am sure that it is something small that I missed when copying the code over, but I cannot for the life of me see what it is. The only other difference is the other server is using a domain name, while the server this code is on is an IP address only (that should not make a difference tho) Why is the cookie not being isseued? I am going nuts trying to figure this out! $ADMIN_COOKIE_NAME=scavengeradmin; //name of the issuing cookie $COOKIE_EXPIRY=1800; //time in seconds to expiry function adminCookie() { global $ADMIN_COOKIE_NAME,$COOKIE_EXPIRY; //check to see if a cookie exists already. $cookieid=$_COOKIE[$ADMIN_COOKIE_NAME]; //if there is no cookieid - then we are going to set a cookie. if(strlen($cookieid) 1) { //find a unique value. list($msec,$sec)=explode( ,microtime()); $cookiekey=ereg_replace(\.,,($msec+$sec)); //set expiry - 30 mins from now. $cookieexpiry=time()+$COOKIE_EXPIRY; setcookie($ADMIN_COOKIE_NAME,$cookiekey,$cookieexpiry,/,$_SERVER[HTTP _HOS T],0); $_COOKIE[$ADMIN_COOKIE_NAME]=$cookiekey; unset($cookiekey);unset($msec);unset($sec);unset($cookieexpiry); } else { //if the cookie has been set then we are just going to adjust the expiry date. //set expiry - 30 mins from now. $cookieexpiry=time()+$COOKIE_EXPIRY; setcookie($ADMIN_COOKIE_NAME,$cookieid,$cookieexpiry,/,$_SERVER[HTT P_HO ST],0); unset($cookieexpiry); } unset($cookieid); } adminCookie(); //issue the cookie -- Cheers Mike Morton * * Tel: 905-465-1263 * Email: [EMAIL PROTECTED] * Indeed, it would not be an exaggeration to describe the history of the computer industry for the past decade as a massive effort to keep up with Apple. - Byte Magazine Given infinite time, 100 monkeys could type out the complete works of Shakespeare. Win 98 source code? Eight monkeys, five minutes. -- NullGrey -- 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/require inside of function
Hi, Friday, July 4, 2003, 5:11:18 PM, you wrote: AC Is there anyway to include a file inside of a function and have the included AC stuff be global? For instance if I defined a class or a function in that AC include file, I want to be able to use that class outside of the function. AC On the documentation for include() a poster commented that it did indeed AC work like this, but my testing indicates it does not. Everything stays AC local to the function and goes away when the function ends. AC Is there a way? One trick that works in php-4.X.X is to put your function inside a class, as any sub functions become global (invisible to the rest of the class though :) but that should not matter). Not sure whether it will be the same in php-5. a quick example (ignore my filenames it was just to prove it works) ?php class loadClass { function loadClass(){ //nothing to do yet; } function load($inc){ include($inc); } } $l = new loadClass(); $l-load('templateClass.inc'); $t = new kwikTemplateClass('./'); $variables = array(); echo $t-processFile('layout.htm',$variables); ? This loads the class I need and it is automatically global.. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Setting Cookie Going Nuts
Mike, Just a thought - are you outputting any HTML on the page where you are declaring your cookie? If not, then it won't work. I got stuck a few months back with a filter script where someone logs in and depending on who they were were redirected to various pages. I was decalring their cookies in the redirect script and it didn't work until I started doing in on a 'written' page. Hope this solves your problem. Cheers George in Oxford -Original Message- From: Boaz Yahav [mailto:[EMAIL PROTECTED] Sent: 04 July 2003 10:05 am To: Mike Morton; [PHP - GENERAL] Subject: RE: [PHP] Setting Cookie Going Nuts Did you solve this issue? What does $_SERVER[HTTP_HOST] return? Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: Mike Morton [mailto:[EMAIL PROTECTED] Sent: Thursday, July 03, 2003 4:03 PM To: [PHP - GENERAL] Subject: [PHP] Setting Cookie Going Nuts I am trying to issue a cookie, using the set cookie directive, and it is not working for some reason. The code below I have used before with perfect success. The only difference between the other place that I am using it is that the other place has globals on, this server has globals off (tho I turned them on a and it made no difference), and the other server is running 4.3.2 where this one is 4.3.0 I am sure that it is something small that I missed when copying the code over, but I cannot for the life of me see what it is. The only other difference is the other server is using a domain name, while the server this code is on is an IP address only (that should not make a difference tho) Why is the cookie not being isseued? I am going nuts trying to figure this out! $ADMIN_COOKIE_NAME=scavengeradmin; //name of the issuing cookie $COOKIE_EXPIRY=1800; //time in seconds to expiry function adminCookie() { global $ADMIN_COOKIE_NAME,$COOKIE_EXPIRY; //check to see if a cookie exists already. $cookieid=$_COOKIE[$ADMIN_COOKIE_NAME]; //if there is no cookieid - then we are going to set a cookie. if(strlen($cookieid) 1) { //find a unique value. list($msec,$sec)=explode( ,microtime()); $cookiekey=ereg_replace(\.,,($msec+$sec)); //set expiry - 30 mins from now. $cookieexpiry=time()+$COOKIE_EXPIRY; setcookie($ADMIN_COOKIE_NAME,$cookiekey,$cookieexpiry,/,$_SERVER[HTTP _HOS T],0); $_COOKIE[$ADMIN_COOKIE_NAME]=$cookiekey; unset($cookiekey);unset($msec);unset($sec);unset($cookieexpiry); } else { //if the cookie has been set then we are just going to adjust the expiry date. //set expiry - 30 mins from now. $cookieexpiry=time()+$COOKIE_EXPIRY; setcookie($ADMIN_COOKIE_NAME,$cookieid,$cookieexpiry,/,$_SERVER[HTT P_HO ST],0); unset($cookieexpiry); } unset($cookieid); } adminCookie(); //issue the cookie -- Cheers Mike Morton * * Tel: 905-465-1263 * Email: [EMAIL PROTECTED] * Indeed, it would not be an exaggeration to describe the history of the computer industry for the past decade as a massive effort to keep up with Apple. - Byte Magazine Given infinite time, 100 monkeys could type out the complete works of Shakespeare. Win 98 source code? Eight monkeys, five minutes. -- NullGrey -- 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] track_vars in apache httpd.conf
Hi, Friday, July 4, 2003, 5:27:53 PM, you wrote: TT hello, TT I faced a problem with apache httpd.conf. TT I have a virtual host and i write in httpd.conf that lines : TT IfModule mod_php4.c TT php_value track_vars Off TT /IfModule TT but not working TT please advise. TT Thanks try php_flag instead of php_value (flags are on or off, values usually contain things like numbers or paths) -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookie question
I tried it that way, and variations on it. I still have had no luck. Any other ideas? Thanks again David R Thanks for you he Boaz Yahav [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Try setcookie(auth,$val,time() + 3600,/,.avenew.com); also look here : http://examples.weberdev.com/get_example.php3?count=67 Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: David R [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 9:44 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] cookie question I have never read anything about a production server domain. How do I set the cookie for it? Thanks. David R Leif K-Brooks [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] David R wrote: Hello, I have a cookie question. I have the following code is a file called tc.php ? global $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $settings, $sql ; $val=123; setcookie (auth, $val , time() + 3600); $cookie = $HTTP_COOKIE_VARS['auth']; echo cookie is: $cookie; ? I have no problem retrieving the value cookie value ( 123 ) on my local machine but when I post to the internet I can't get the cookie value. Any ideas why? Did you set the cookie for the production server domain? Cookies for your local machine won't still be there once you upload, you know. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- 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] cookie question
Go to your browsers setting and ask the browser to prompt before setting cookies. in IE go to : tools - Internet Options - Privacy -- Advanced -- Override automatic cookie handling. See if your page tries to set the cookie at all. If not, try to add : error_reporting(2039); maybe you are sending the headers before you set the cookie. Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: David R [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 11:25 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] cookie question I tried it that way, and variations on it. I still have had no luck. Any other ideas? Thanks again David R Thanks for you he Boaz Yahav [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Try setcookie(auth,$val,time() + 3600,/,.avenew.com); also look here : http://examples.weberdev.com/get_example.php3?count=67 Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: David R [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 9:44 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] cookie question I have never read anything about a production server domain. How do I set the cookie for it? Thanks. David R Leif K-Brooks [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] David R wrote: Hello, I have a cookie question. I have the following code is a file called tc.php ? global $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $settings, $sql ; $val=123; setcookie (auth, $val , time() + 3600); $cookie = $HTTP_COOKIE_VARS['auth']; echo cookie is: $cookie; ? I have no problem retrieving the value cookie value ( 123 ) on my local machine but when I post to the internet I can't get the cookie value. Any ideas why? Did you set the cookie for the production server domain? Cookies for your local machine won't still be there once you upload, you know. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- 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] Web Services
Hi there, hope someone ini this list can help me out.. I had made a web services using Keith Devens library It's already run and OK... Now I try to make a client using ASP .NET to connect to my web services Did anyone know how to pull out the classes/function in my web services with kd_xmlrpc ?? like the google if we try to used the web services server we can see all the available function/class Thanks in Advance yamin - Original Message - From: Boaz Yahav [EMAIL PROTECTED] To: David R [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, July 04, 2003 4:39 PM Subject: RE: [PHP] cookie question Go to your browsers setting and ask the browser to prompt before setting cookies. in IE go to : tools - Internet Options - Privacy -- Advanced -- Override automatic cookie handling. See if your page tries to set the cookie at all. If not, try to add : error_reporting(2039); maybe you are sending the headers before you set the cookie. Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: David R [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 11:25 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] cookie question I tried it that way, and variations on it. I still have had no luck. Any other ideas? Thanks again David R Thanks for you he Boaz Yahav [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Try setcookie(auth,$val,time() + 3600,/,.avenew.com); also look here : http://examples.weberdev.com/get_example.php3?count=67 Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: David R [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 9:44 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] cookie question I have never read anything about a production server domain. How do I set the cookie for it? Thanks. David R Leif K-Brooks [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] David R wrote: Hello, I have a cookie question. I have the following code is a file called tc.php ? global $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $settings, $sql ; $val=123; setcookie (auth, $val , time() + 3600); $cookie = $HTTP_COOKIE_VARS['auth']; echo cookie is: $cookie; ? I have no problem retrieving the value cookie value ( 123 ) on my local machine but when I post to the internet I can't get the cookie value. Any ideas why? Did you set the cookie for the production server domain? Cookies for your local machine won't still be there once you upload, you know. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- 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: Weird Problem
In article [EMAIL PROTECTED], [EMAIL PROTECTED] sketchbook.org says... Hey, I've got a script which disables a banner image when it's time is up, the script also sends an e-mail to both me and the banners owner when the time is up I've got a problem which is really weird.. Everything else works, but when the query is sent to the MySQL database, nothing happens... This is the query being sent: UPDATE st_banners SET Disabled='Y' WHERE BannerID='$bannerid' But when the script is run, it reports no errors, yet when i do SELECT Disabled FROM st_banners they are all enabled. I then echoed the query and the result it said it sent the query and it all worked, but the database was never updated.. If it works, why doesn't it work?? You can use mysql_affected_rows to test whether an update changed any records. You might also try echo-ing the query and feeding it into phpMyAdmin or the command line sql to see what happens. Any thoughts or suggestions? Or should i be looking for a MySQL list? Suggestion: set Outlook to wrap lines at around 74 characters :-) -- Quod subigo farinam $email =~ s/oz$/au/o; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Optional form variables (IDEA?)
In article [EMAIL PROTECTED] manila-usia.gov, [EMAIL PROTECTED] says... Hello, im doing a form that when you pass it will generate a preview report. My problem is some fields are optional the optional fields are 5. And for those fields I need to make it fit when it generate what idea or codes can you suggest? Ex, a businesscard preview form. When it generates it will show you a businesscard template. But how about those un-filled fields. Can this be done thru if and else statement? If I correctly understand your problem, you need to test if a variable has been set, and if so echo its value? if(isset($value)) {echo $value;} You may need to substitute $value with $_POST{'value'} or $_GET{'value} depending on whether you have register_globals set off and whether you are using GET or POST to pass the value. -- Quod subigo farinam $email =~ s/oz$/au/o; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Communication between PHP Server code and HTML/JavaScript client without refreshing the page
Hello, How do I communicate betwen an HTML page having JavaScript and a PHP server code without having to refresh the HTML page. I was originally thinking of having an invisible applet communicating to the server, but I am not sure how this is done. I am also considering XML and SOAP, but I am not sure about the following: 1. Where does the SOAP client reside - on the browser/html or on the server? 2. How do I communicate from my HTML page to the SOAP client? Regards, Sharat * Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Communication between PHP Server code and HTML/JavaScript client without refreshing the page
Hi Sharat, How do I communicate betwen an HTML page having JavaScript and a PHP server code without having to refresh the HTML page. I don't think this is possible: once PHP has run (and sent your Javascript to the browser), it's finished - you can't use it again until the next time the page loads. If you want to do this sort of thing you're looking at a Java applet or something along those lines. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Web Services
You will need to write a script in PHP to output XML data from the data you currently have in your db/files. Hope this helps - Sid - Original Message - From: Yamin Prabudy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 04, 2003 1:48 AM Subject: [PHP] Web Services Hi there, hope someone ini this list can help me out.. I had made a web services using Keith Devens library It's already run and OK... Now I try to make a client using ASP .NET to connect to my web services Did anyone know how to pull out the classes/function in my web services with kd_xmlrpc ?? like the google if we try to used the web services server we can see all the available function/class Thanks in Advance yamin - Original Message - From: Boaz Yahav [EMAIL PROTECTED] To: David R [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, July 04, 2003 4:39 PM Subject: RE: [PHP] cookie question Go to your browsers setting and ask the browser to prompt before setting cookies. in IE go to : tools - Internet Options - Privacy -- Advanced -- Override automatic cookie handling. See if your page tries to set the cookie at all. If not, try to add : error_reporting(2039); maybe you are sending the headers before you set the cookie. Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: David R [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 11:25 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] cookie question I tried it that way, and variations on it. I still have had no luck. Any other ideas? Thanks again David R Thanks for you he Boaz Yahav [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Try setcookie(auth,$val,time() + 3600,/,.avenew.com); also look here : http://examples.weberdev.com/get_example.php3?count=67 Sincerely berber Visit http://www.weberdev.com/ Today!!! To see where PHP might take you tomorrow. -Original Message- From: David R [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 9:44 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] cookie question I have never read anything about a production server domain. How do I set the cookie for it? Thanks. David R Leif K-Brooks [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] David R wrote: Hello, I have a cookie question. I have the following code is a file called tc.php ? global $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $settings, $sql ; $val=123; setcookie (auth, $val , time() + 3600); $cookie = $HTTP_COOKIE_VARS['auth']; echo cookie is: $cookie; ? I have no problem retrieving the value cookie value ( 123 ) on my local machine but when I post to the internet I can't get the cookie value. Any ideas why? Did you set the cookie for the production server domain? Cookies for your local machine won't still be there once you upload, you know. -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- 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] SSL certificates question
Hi all... I've written a secure socket based server in Java which has a keyStore and a trustStore generated with the keytool command in Linux. Now, I have a Java client which can connect to the server only by having signed certificates (which I also made with keytool). That all works fine Now I'm using a PHP client to connect to my Java server and it works if I don't use the secure socket version (that is it works if I use normal sockets). But I want to open my socket connection in php with secure sockets, using .. fsockopen(ssl://ip-number) ... but I need my PHP client to use the certificates like my Java client (in Java, the keyStore and trustStore are imported as Java properties at startup) Does anyone know if there are openssl routines to do this in PHP and maybe if I have to use a different approach (perhpas keytool is limited to Java?) Thanks in advance, Bergsteinn Einarsson Reykjavik, Iceland [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Communication between PHP Server code and HTML/JavaScript client without refreshing the page
Hi, It is RPC software. I have used it. It work for me. - Konstantin === Frn: Jon Smirl [SMTP:[EMAIL PROTECTED] Skickat: den 12 mars 1999 05:21 Till: [EMAIL PROTECTED] Angende: [PHP3] RPC for PHP from the browser This is a port of Microsoft's remote scripting that supports PHP as the processing system instead of ASP. The Script directory is an exact copy of the download available from http://www.microsoft.com/scripting but is has been extracted out of the windows exe to allow access from Unix. Remote scripting allows RPC calls to PHP objects located at the server. These calls can be synchronous or asynchronous. You can build some really cool pages by combining DHTML and RPC. In the simple case this lets you change part of a page without causing a reload. Remote scripting is supposed to work in MSIE and Netscape, but I haven't checked it in Netscape. The MS client components are unchanged, you use RSPROXY.CLASS and RS.HTM exactly as you would for the ASP engine. The only thing to watch for is that PHP method names are not case sensitive and Javascript names are. The result is that you need to always use lower case method names from your HTML file. RS.INC replaces RS.ASP on the server. They should function exactly the same, if they don't let me know. RSPROXY.JAVA source code is available by buying MS Visual Interdev. They distribute the compiled class for free. RSPROXY uses http GET to call remote methods which limits the amount of parameters that can be passed. At some point I'll recode it to use PUT and allow unlimited parameters. Simphp.htm -- client test program Simple.php3 -- server object being remoted rs.inc -- server support for remote scripting in php3 Jon Smirl [EMAIL PROTECTED] === Jon Haworth wrote: Hi Sharat, How do I communicate betwen an HTML page having JavaScript and a PHP server code without having to refresh the HTML page. I don't think this is possible: once PHP has run (and sent your Javascript to the browser), it's finished - you can't use it again until the next time the page loads. If you want to do this sort of thing you're looking at a Java applet or something along those lines. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php simple.php3 Description: application/unknown-content-type-php3_auto_file simphp.phtml Description: application/unknown-content-type-phtml_auto_file RSProxy.class Description: application/unknown-content-type-javaclassfile rs.js Description: JavaScript source -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Uploading files time out every so often
Well I have built a script that is responsible for upload 20Mb of files at a time. The possible probs are 1) A short disconnetion in the net connection can cause the upload to stall 2) Sometimes when I visit / post data on the same domain, the upload stalls where as if I just leave that upload be and continue surfing on other sites, it generally runs ok to the end. 3) Free space - wierd things happen when PHP is unable to write files on the server (like your disk quota gets used up) 4) Check ifyour server has enough bandwidth to manage so many uploads at once. Make sure the server does not get disconnected (This is unlikely, but never the less check) Hope it helps. All the best. - Sid - Original Message - From: Ivo Pletikosic [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 03, 2003 11:29 AM Subject: [PHP] Uploading files time out every so often Hello, I am currently involved in a site where users frequently need to upload text files of various sizes. Every so often users will experience problems where the uploads will start timing-out and need to be reinitiated. The timeout problem comes and goes, so far I've been unable to find the root cause. It happens with files of all sizes, from 10k to several MB, eventually they all get uploaded, tho sometimes it can take days re-trying. Another issue is experienced when the above symptom is happening which makes me think they're related. An additional tool on the site writes out files with information provided by a user thru a form. A user submits a form with some text and php writes out a file with the received info and notifies the user the task was done. Every so often the browser will timeout with no file written out by php or notification. This symptom can go on for days. The info being written to a file is never longer than a dozen lines of text so it's quite small. Initially we thought that the server just did not have the resources to service simultaneous uploads but monitoring tools show the cpu appears to be near idle when this is experienced. I've experienced the file writing problem when I was the only user on the server with all unnecessary services disabled. The browser will just time out, then one days voila! it works until the next problem day. This is on a Linux box with Apache 1.3, php 4.2.2 experienced across multiple browsers. All the scripts have set_time_limit(0). File system has the proper permissions and with plenty of free space. We've been collecting quite a lot of info from the server to try to capture it's state at the time of the problem but nothing raises any flags. Has anyone experienced this issue or a similar issue? Any pointers and help is greatly appreciated. Ivo -- 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: Please Help.. cgi.force_redirect does not work
what is the cgi error message ? Scott Fletcher wrote: Hi! To make the long story short, we use IIS 5.0 with PHP 4.0.6 for a while. Then we builted a new database server, SQL-2000 and point the website to the new server. Then we notice the problem with the CGI error. So, we last week downloaded the PHP 4.3.3 and update the IIS with the newer PHP version and set the cgi.force_redirect to zero in php.ini. See example below --snip-- ; cgi.force_redirect is necessary to provide security running PHP as a CGI under ; most web servers. Left undefined, PHP turns this on by default. You can ; turn it off here AT YOUR OWN RISK ; **You CAN safely turn this off for IIS, in fact, you MUST.** cgi.force_redirect = 0 --snip-- We still have problem with CGI error. The use of php function, header() is what cause the error. Yes, the IIS and the website are reading the php.ini correctly. I checked that out and it is verified. So, what is the workaround to the CGI error?? Thanks, Scott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Communication between PHP Server code and HTML/JavaScriptclient without refreshing the page
There are several ways: 1. XML - many browsers don't support this 2. Load a form into a hidden iframe, then you can read variables from the form 3. Load javascript into a hidden iframe. Sharat Hegde wrote: Hello, How do I communicate betwen an HTML page having JavaScript and a PHP server code without having to refresh the HTML page. I was originally thinking of having an invisible applet communicating to the server, but I am not sure how this is done. I am also considering XML and SOAP, but I am not sure about the following: 1. Where does the SOAP client reside - on the browser/html or on the server? 2. How do I communicate from my HTML page to the SOAP client? Regards, Sharat * Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. * -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] touch( ) behaving oddly
Hi folks, I am trying to use touch( ) on a Linux server. When I touch the file, it is setting the modification time to 1st March 2004! I tried setting the mtime parameter of touch explictly to time( ), but this didn't help. The server clock is properly set, and touch works as expected from the shell. Can anyone explain what is happening here?? -- Geoff Caplan Advantae Ltd -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Communication between PHP Server code and HTML/JavaScript client without refreshing the page
Hi, Excuse, skip one file. It is full set of RPC files. - Konstantin. Konstantin S. Kurilov wrote: Hi, It is RPC software. I have used it. It work for me. - Konstantin === Frn: Jon Smirl [SMTP:[EMAIL PROTECTED] Skickat: den 12 mars 1999 05:21 Till: [EMAIL PROTECTED] Angende: [PHP3] RPC for PHP from the browser This is a port of Microsoft's remote scripting that supports PHP as the processing system instead of ASP. The Script directory is an exact copy of the download available from http://www.microsoft.com/scripting but is has been extracted out of the windows exe to allow access from Unix. Remote scripting allows RPC calls to PHP objects located at the server. These calls can be synchronous or asynchronous. You can build some really cool pages by combining DHTML and RPC. In the simple case this lets you change part of a page without causing a reload. Remote scripting is supposed to work in MSIE and Netscape, but I haven't checked it in Netscape. The MS client components are unchanged, you use RSPROXY.CLASS and RS.HTM exactly as you would for the ASP engine. The only thing to watch for is that PHP method names are not case sensitive and Javascript names are. The result is that you need to always use lower case method names from your HTML file. RS.INC replaces RS.ASP on the server. They should function exactly the same, if they don't let me know. RSPROXY.JAVA source code is available by buying MS Visual Interdev. They distribute the compiled class for free. RSPROXY uses http GET to call remote methods which limits the amount of parameters that can be passed. At some point I'll recode it to use PUT and allow unlimited parameters. Simphp.htm -- client test program Simple.php3 -- server object being remoted rs.inc -- server support for remote scripting in php3 Jon Smirl [EMAIL PROTECTED] === Jon Haworth wrote: Hi Sharat, How do I communicate betwen an HTML page having JavaScript and a PHP server code without having to refresh the HTML page. I don't think this is possible: once PHP has run (and sent your Javascript to the browser), it's finished - you can't use it again until the next time the page loads. If you want to do this sort of thing you're looking at a Java applet or something along those lines. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Name: simple.php3 simple.php3Type: PHP3 (application/x-unknown-content-type-php3_auto_file) Encoding: base64 Name: simphp.phtml simphp.phtmlType: PHTML (application/x-unknown-content-type-phtml_auto_file) Encoding: base64 Name: RSProxy.class RSProxy.classType: Java Class File (application/x-unknown-content-type-javaclassfile) Encoding: base64 Name: rs.js rs.jsType: JavaScript Program (application/x-javascript) Encoding: 7bit RSProxy.class Description: application/unknown-content-type-javaclassfile rs.js Description: JavaScript source simple.php3 Description: application/unknown-content-type-php3_auto_file simphp.phtml Description: application/unknown-content-type-phtml_auto_file rs_php4.inc Description: application/unknown-content-type-inc_auto_file -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Red Hat 9, Apache 2, and PHP
I know that no software is without bugs, it is the first thing you learn in Computer Engineering. What I really meant was I don't update the date after a new version comes out. I wait until I don't see any more major bug reports. Until I feel the new version is stable enough. Thus that is why I am still using Apache 1.3.27. Just my two cents. Mark. Greg Donald [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I usually don't like to use the new of anything until it have been out for sometime and I don't see any see bug reports. And just when would this rare event occur, if ever? Every version of Apache, PHP, or Linux distro ever released has had bugs or exploits of some form. If you're waiting for a perfect version of any of those, it'll still be a long while. The best thing to do is just pick a distro that releases patches quickly, and keep up to date on patches. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Incrementing counter from an HTML page.
Glory! The problem I am facing is that my Index page can be an HTML page only.. not PHP. I cant use framesets, redirects etcetera. I want to build my own Counter using PHP mySQL Database.. with the Users Online and Total Hits feature. How can I increment the counter or affect a PHP code using HTML.. is there someway I can achieve this? To be able to show the php counter on my HTML page.. ? Thanks, PHPSpooky __ If God had wanted me otherwise, He would have created me otherwise. - Johann Wolfgang von Goethe
Re: [PHP] Re: Red Hat 9, Apache 2, and PHP
Brad Pauly wrote: Todd Cary wrote: Linux is quite new for me, so please forgive me if my questions are rather basic. I have RH 9 installed and I want to add the Interbase extensions to PHP and then recompile Apache. Conceptually I understand what has to be done, but I do not know the steps or syntax. Is there documentation available for doing this? Just to be sure I understand, by "add" do you mean recompiling with support for InterBase? If so you will need to add --with-interbase when you run configure. http://www.php.net/manual/en/ref.ibase.php Have you already compiled apache? If so you can probably just tell configure where apxs is. --with-apxs=/path/to/apache/bin/apxs http://www.php.net/manual/en/install.apache.php Brad do you mean recompiling with support for InterBase? Yes. Where do I insert " To enable InterBase support configure PHP --with-interbase[=DIR], where DIR is the InterBase base"? Are there some docs on the syntax for re-compiling PHP, since I have not compiled anything on a Linux box? Todd -- image/gif
RE: [PHP] Incrementing counter from an HTML page.
Glory! I'm not sure about the compatibility of iFrames.. on various browsers and platforms.. it would perhaps only complicate and be the only drawback in an otherwise very simple structured page.. PHPSpooky __ If God had wanted me otherwise, He would have created me otherwise. - Johann Wolfgang von Goethe -Original Message- From: Sichta Daniel [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 6:50 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] Incrementing counter from an HTML page. Hi, try to use iframe with php code inside !! DS -Original Message- From: PHPSpooky [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 3:14 PM To: [EMAIL PROTECTED] Subject: [PHP] Incrementing counter from an HTML page. Glory! The problem I am facing is that my Index page can be an HTML page only.. not PHP. I cant use framesets, redirects etcetera. I want to build my own Counter using PHP mySQL Database.. with the Users Online and Total Hits feature. How can I increment the counter or affect a PHP code using HTML.. is there someway I can achieve this? To be able to show the php counter on my HTML page.. ? Thanks, PHPSpooky __ If God had wanted me otherwise, He would have created me otherwise. - Johann Wolfgang von Goethe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Incrementing counter from an HTML page.
Suggestions: 1. use a picture for the counter (with the image - handling library) 2. use a javascript script :) script language=JavaScript src=script.php this script will return the hit-counter in a variable that you can use. Question: why no redirects ? P Glory! P The problem I am facing is that my Index page can be an HTML page only.. P not PHP. I cant use framesets, redirects etcetera. P I want to build my own Counter using PHP mySQL Database.. with the P Users Online and Total Hits feature. P How can I increment the counter or affect a PHP code using HTML.. is P there someway I can achieve this? To be able to show the php counter on P my HTML page.. ? -- Ciprian Confucius Says: Man with hand in pocket is having a ball. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Incrementing counter from an HTML page.
Sounds cool.. Can you send in an example script or something? I've never worked with this before.. PHPSpooky __ If God had wanted me otherwise, He would have created me otherwise. - Johann Wolfgang von Goethe -Original Message- From: Ciprian Trofin [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 7:31 PM To: PHPSpooky Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Incrementing counter from an HTML page. Suggestions: 1. use a picture for the counter (with the image - handling library) 2. use a javascript script :) script language=JavaScript src=script.php this script will return the hit-counter in a variable that you can use. Question: why no redirects ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Snarl, hiss, growl (frustration)
Why does this not work? It is just a simple hit counter (hence the snarls, hissing, and growling). It logs the ips address but does not increment $current or log it. I do have counter.txt and ips.txt chmod'd to 777. Ips.txt starts blank and counter.txt starts with just a 0 in it. ?php $counter = fopen('counter.txt', 'r'); $current = fread($counter, filesize('counter.txt')); fclose($counter); $ip = getenv('REMOTE_ADDR'); $ipCheck = file('ips.txt'); if (!in_array($ip, $ipCheck)) { $ipAdd = fopen('ips.txt', 'a'); fwrite($ipAdd, \n$ip); fclose($ipAdd); $current++; $counter = fopen('counter.txt', 'w'); fwrite($counter, $current); fclose($counter); } print $current; ? -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Snarl, hiss, growl (frustration)
Hi, Saturday, July 5, 2003, 12:33:25 AM, you wrote: KB Why does this not work? It is just a simple hit counter (hence the KB snarls, hissing, and growling). It logs the ips address but does not KB increment $current or log it. I do have counter.txt and ips.txt chmod'd KB to 777. Ips.txt starts blank and counter.txt starts with just a 0 in it. KB ?php $counter = fopen('counter.txt', 'r'); KB $current = fread($counter, filesize('counter.txt')); KB fclose($counter); KB $ip = getenv('REMOTE_ADDR'); KB $ipCheck = file('ips.txt'); KB if (!in_array($ip, $ipCheck)) { KB $ipAdd = fopen('ips.txt', 'a'); KB fwrite($ipAdd, \n$ip); KB fclose($ipAdd); KB $current++; KB $counter = fopen('counter.txt', 'w'); KB fwrite($counter, $current); KB fclose($counter); KB } print $current; ? KB -- KB Kyle maybe you need to end the if() statement before incrementing the counter. $ip = getenv('REMOTE_ADDR'); $ipCheck = file('ips.txt'); if (!in_array($ip, $ipCheck)) { $ipAdd = fopen('ips.txt', 'a'); fwrite($ipAdd, \n$ip); fclose($ipAdd); } $current++; $counter = fopen('counter.txt', 'w'); fwrite($counter, $current); fclose($counter); print $current; ? -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 4.3.0/4.3.2 - Strange problem with exec / move_uploaded_file
Hi, I am faciing a strange problem. I have some php script to receive images (via file upload). The script is failling to work because it can't move/copy the file. I've added a sleep(x) in order to make the temporary file stick around. 20 -rw---1 apache apache 19402 Jul 4 10:49 /tmp/phpFj6Irk I've added apache to an upload group upload:x:1098:apache And changed the owner of the directory. ls -sla /home/httpd/html/foo.com/img/news/ total 24 4 drwxrwxr-x6 webmaste upload 4096 Jul 4 10:11 . 4 drwxrwxr-x5 webmaste webmaste 4096 Jun 10 15:55 .. 4 drwxrwxr-x2 webmaste upload 4096 Jun 4 09:41 1 4 drwxrwxr-x2 webmaste upload 4096 Jul 4 10:48 10 4 drwxrwxr-x2 webmaste upload 4096 Jul 4 09:54 2 And the both commands below fail. move_uploaded_file($tmpfile,$destination) exec(/bin/cp $tmpfile $destination,$array) The var_dump in array shows array(0) { } The $destination var has (checked with echo) /home/httpd/html/foo.com/img/news/10/xxx.jpg Any ideias ? __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Refresh in PHP
Hi Everyone, My user has reported a problem when he loads a page. The page grabs data from MSSQL and displays this on the screen. However, it is not updated. Is there any way in getting the page to automatically refresh itself once when it is loaded? Many thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GD problem
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi there... I'm having huge problem with PHP 4.3.2 on FreeBSD 5.1 platform with GD functions. check out the following code: $str = some text; $img = imagecreatefrompng(images/template.png); $color = imagecolorallocate($img, $red, $blue, $green); imagestring($img, 5, 0, 0, $str, $color); header(Content-Type: image/png); imagepng($img); imagedestroy($img); This code works okay. $str = some text; $font_file = /some/dir/times.ttf; # TT font from microsoft windows $img = imagecreatefrompng(images/template.png); $color = imagecolorallocate($img, $red, $blue, $green); imagettftext($img, 20, -40, 40, 40, $color, $font_file, $str); header(Content-Type: image/png); imagepng($img); imagedestroy($img); This code sometimes prints picture in a browser, but many times crash entire apache child process (sig 11). If using bundled GD library, crashes are not so often, but string on image is not correct. Can anyone help me? Brane -BEGIN PGP SIGNATURE- iD8DBQE/BZshfiC/E+t8hPcRAlGHAJ0X1bsVoVNKXXKTXej6UWSZIhPeTQCbBHYw XANp8xHJEnxfW2TTEgNEPjs= =fymB -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] More on file upload
First of all, thanks to all that have helped so far. I am trying to get a file upload script to work using php v4.0.3 (no option here) Everything seems to be working except the move_uploaded_file() function (the most critical part) I have checked all variables they seem to be correct. my php.ini settings are: file_uploads 1 doc_root no value post_max_size 8m upload_max_file size 2m upload_tmp_dir no value Anthing else to check? Is there a way to get a more descriptive error msg? Thanks. Mark Roberts, Roberts Computing Systems Webmaster Services $29.50/mo mailto:[EMAIL PROTECTED]
Re: [PHP] PHP 4.3.0/4.3.2 - Strange problem with exec / move_uploaded_file
OK. What I've started doing is use PHP's ftp functions to login and PUT the file in the right place. This allows me to move files and put em where I want, with teh right permissions. Check the manual for more info. Andrew Hi, But it's already there. And the file is uploaded (since I can see it under /tmp) --- Andrew McCombe [EMAIL PROTECTED] wrote: Put enctype=multipart/form-data in your form tag; - Original Message - From: Robert Mena [EMAIL PROTECTED] To: php mailing list [EMAIL PROTECTED] Sent: Friday, July 04, 2003 4:00 PM Subject: [PHP] PHP 4.3.0/4.3.2 - Strange problem with exec / move_uploaded_file Hi, I am faciing a strange problem. I have some php script to receive images (via file upload). The script is failling to work because it can't move/copy the file. I've added a sleep(x) in order to make the temporary file stick around. 20 -rw---1 apache apache 19402 Jul 4 10:49 /tmp/phpFj6Irk I've added apache to an upload group upload:x:1098:apache And changed the owner of the directory. ls -sla /home/httpd/html/foo.com/img/news/ total 24 4 drwxrwxr-x6 webmaste upload 4096 Jul 4 10:11 . 4 drwxrwxr-x5 webmaste webmaste 4096 Jun 10 15:55 .. 4 drwxrwxr-x2 webmaste upload 4096 Jun 4 09:41 1 4 drwxrwxr-x2 webmaste upload 4096 Jul 4 10:48 10 4 drwxrwxr-x2 webmaste upload 4096 Jul 4 09:54 2 And the both commands below fail. move_uploaded_file($tmpfile,$destination) exec(/bin/cp $tmpfile $destination,$array) The var_dump in array shows array(0) { } The $destination var has (checked with echo) /home/httpd/html/foo.com/img/news/10/xxx.jpg Any ideias ? __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() function and timestamps
On Jul 3, 2003, Garrick Linn claimed that: |Hello all, | |I seem to be running into a problem where the date() function appears not |to differentiate properly between unix timestamps. | |For example, the code: | |?php | |$seconds = 1054278483; |echo $secondsbr; |echo date(d-m-Y H:m:s, $seconds); |echo brbr; | |$seconds = ($seconds - 60); |echo $secondsbr; |echo date(d-m-Y H:m:s, $seconds); |echo brbr; | |? | |outputs | |1054278483 |30-05-2003 02:05:03 | |1054278423 |30-05-2003 02:05:03 | |I would expect the second date() to output 30-05-2003 02:04:03 as the |second timestamp is exactly 60 seconds behind the first, but I might be |missing something. I see the same behavior on two redhat linux machines |running Apache 2.0.40 + PHP 4.2.2 and Apache 1.3.26 + PHP 4.3.2 |respectively. Any ideas? | |Thanks, | |Garrick Linn | As has been pointed out before, you expect incorrectly. The value of 'm' won't change depending on what's around it. The correct formats are listed at http://www.php.net/manual/en/function.date.php Jeff -- Registered Linux user #304026. lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED Responses to this message should conform to RFC 1855. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More on file upload
What is the message now? Is the file being uploaded and move_uploaded_file() does not move the file? Then check the directory permissions. Webmaster wrote: First of all, thanks to all that have helped so far. I am trying to get a file upload script to work using php v4.0.3 (no option here) Everything seems to be working except the move_uploaded_file() function (the most critical part) Anthing else to check? Is there a way to get a more descriptive error msg? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] More on file upload
Directory permissions are set to 0777 Right now I am just using if ( move_uploaded_file(source,dest)) { echo file moved; } else { echo could not move file; } } Have not yet been able to figure out how to get a more descriptive error. I know there has to be a better way to get exact message, but just haven't figured it out yet. Mark Roberts, Roberts Computing Systems eCommerce, yeah, we do that! Graphics, Scripting, Databases, shopping carts mailto:[EMAIL PROTECTED] -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 10:57 AM To: Webmaster Cc: [EMAIL PROTECTED] Subject: Re: [PHP] More on file upload What is the message now? Is the file being uploaded and move_uploaded_file() does not move the file? Then check the directory permissions. Webmaster wrote: First of all, thanks to all that have helped so far. I am trying to get a file upload script to work using php v4.0.3 (no option here) Everything seems to be working except the move_uploaded_file() function (the most critical part) Anthing else to check? Is there a way to get a more descriptive error msg? -- 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] More on file upload
Try copy() instead of move_uploaded_file and see what you get. Andrew - Original Message - From: Webmaster [EMAIL PROTECTED] To: Marek Kilimajer [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, July 04, 2003 5:12 PM Subject: RE: [PHP] More on file upload Directory permissions are set to 0777 Right now I am just using if ( move_uploaded_file(source,dest)) { echo file moved; } else { echo could not move file; } } Have not yet been able to figure out how to get a more descriptive error. I know there has to be a better way to get exact message, but just haven't figured it out yet. Mark Roberts, Roberts Computing Systems eCommerce, yeah, we do that! Graphics, Scripting, Databases, shopping carts mailto:[EMAIL PROTECTED] -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 10:57 AM To: Webmaster Cc: [EMAIL PROTECTED] Subject: Re: [PHP] More on file upload What is the message now? Is the file being uploaded and move_uploaded_file() does not move the file? Then check the directory permissions. Webmaster wrote: First of all, thanks to all that have helped so far. I am trying to get a file upload script to work using php v4.0.3 (no option here) Everything seems to be working except the move_uploaded_file() function (the most critical part) Anthing else to check? Is there a way to get a more descriptive error msg? -- 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] More on file upload
Same results. I have attached a copy of the code...it is straight from the zend site. Here is the url to the code: https://robertscomputing.securelook.com/bmiphp/uptest.php and a link my phpinfo script for the server php.ini settings: https://robertscomputing.securelook.com/phpinfo.php Thanks for your response. Mark Roberts, Roberts Computing Systems eCommerce, yeah, we do that! Graphics, Scripting, Databases, shopping carts mailto:[EMAIL PROTECTED] -Original Message- From: Andrew McCombe [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 11:16 AM To: Webmaster; Marek Kilimajer Cc: [EMAIL PROTECTED] Subject: Re: [PHP] More on file upload Try copy() instead of move_uploaded_file and see what you get. Andrew - Original Message - From: Webmaster [EMAIL PROTECTED] To: Marek Kilimajer [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, July 04, 2003 5:12 PM Subject: RE: [PHP] More on file upload Directory permissions are set to 0777 Right now I am just using if ( move_uploaded_file(source,dest)) { echo file moved; } else { echo could not move file; } } Have not yet been able to figure out how to get a more descriptive error. I know there has to be a better way to get exact message, but just haven't figured it out yet. Mark Roberts, Roberts Computing Systems eCommerce, yeah, we do that! Graphics, Scripting, Databases, shopping carts mailto:[EMAIL PROTECTED] -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Friday, July 04, 2003 10:57 AM To: Webmaster Cc: [EMAIL PROTECTED] Subject: Re: [PHP] More on file upload What is the message now? Is the file being uploaded and move_uploaded_file() does not move the file? Then check the directory permissions. Webmaster wrote: First of all, thanks to all that have helped so far. I am trying to get a file upload script to work using php v4.0.3 (no option here) Everything seems to be working except the move_uploaded_file() function (the most critical part) Anthing else to check? Is there a way to get a more descriptive error msg? -- 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] Snarl, hiss, growl (frustration)
No, because if i did that the counter would increment no matter what the IP address is. The way I have it the counter will only increment if it is a new ip address to the site. I just fixed it by switching $current++; to $current += 1; Apparently there is some small difference between the two. On Sat, 5 Jul 2003 00:42:59 +1000, Tom Rogers [EMAIL PROTECTED] said: Hi, Saturday, July 5, 2003, 12:33:25 AM, you wrote: KB Why does this not work? It is just a simple hit counter (hence the KB snarls, hissing, and growling). It logs the ips address but does not KB increment $current or log it. I do have counter.txt and ips.txt chmod'd KB to 777. Ips.txt starts blank and counter.txt starts with just a 0 in it. KB ?php $counter = fopen('counter.txt', 'r'); KB $current = fread($counter, filesize('counter.txt')); KB fclose($counter); KB $ip = getenv('REMOTE_ADDR'); KB $ipCheck = file('ips.txt'); KB if (!in_array($ip, $ipCheck)) { KB $ipAdd = fopen('ips.txt', 'a'); KB fwrite($ipAdd, \n$ip); KB fclose($ipAdd); KB $current++; KB $counter = fopen('counter.txt', 'w'); KB fwrite($counter, $current); KB fclose($counter); KB } print $current; ? KB -- KB Kyle maybe you need to end the if() statement before incrementing the counter. $ip = getenv('REMOTE_ADDR'); $ipCheck = file('ips.txt'); if (!in_array($ip, $ipCheck)) { $ipAdd = fopen('ips.txt', 'a'); fwrite($ipAdd, \n$ip); fclose($ipAdd); } $current++; $counter = fopen('counter.txt', 'w'); fwrite($counter, $current); fclose($counter); print $current; ? -- regards, Tom -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] include/require inside of function
Hi, If the file you are including is of your own authorage (I know that isn't a word, but whatever :), just refer to global variables always as an index of the $GLOBALS array. This is good practice anyways for any file that might be included by another user, for exactly this issue. I have a file that could be a global include or not in my project, and making sure every global variable is referenced as $GLOBALS['varname'] fixed it for me without any fancy code (although Rasmus's code is very nice) Regards, Greg -- phpDocumentor http://www.phpdoc.org Rasmus Lerdorf wrote: On Fri, 4 Jul 2003, Aric Caley wrote: Is there anyway to include a file inside of a function and have the included stuff be global? For instance if I defined a class or a function in that include file, I want to be able to use that class outside of the function. On the documentation for include() a poster commented that it did indeed work like this, but my testing indicates it does not. Everything stays local to the function and goes away when the function ends. Is there a way? Functions defined in included files are always global. So I guess it is just the variable you want to put out into the global symbol table. It's a little bit tricky, but you can do it like this: function foo($filename) { extract($GLOBALS, EXTR_REFS); include $filename; $arr = array_diff(get_defined_vars(),$GLOBALS); foreach($arr as $var=$val) $GLOBALS[$var] = $val; } -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Snarl, hiss, growl (frustration)
The difference is that you are getting a string from the file and not casting it to an integer. You could also have fixed it by doing: $counter = (int) fread(...); Note however that you have a nasty race condition in your script. If you get concurrent hits they will all read the same counter value out of your counter file, increment it, and write the same value back. So those hits will not be counted. An easy way to get around this is to only open your file in append mode and add a single char to the file for every hit. filesize() on the file then gives you the count. The advantage here is that an append to a file is guranteed to be atomic and you won't have that race condition between reading and writing the file. The other way around it is to lock your file, but locking files in a web app is a really bad idea. And finally, to really make a robust counter, use a database and an atomic count=count+1 query. -Rasmus On Fri, 4 Jul 2003, Kyle Babich wrote: No, because if i did that the counter would increment no matter what the IP address is. The way I have it the counter will only increment if it is a new ip address to the site. I just fixed it by switching $current++; to $current += 1; Apparently there is some small difference between the two. On Sat, 5 Jul 2003 00:42:59 +1000, Tom Rogers [EMAIL PROTECTED] said: Hi, Saturday, July 5, 2003, 12:33:25 AM, you wrote: KB Why does this not work? It is just a simple hit counter (hence the KB snarls, hissing, and growling). It logs the ips address but does not KB increment $current or log it. I do have counter.txt and ips.txt chmod'd KB to 777. Ips.txt starts blank and counter.txt starts with just a 0 in it. KB ?php $counter = fopen('counter.txt', 'r'); KB $current = fread($counter, filesize('counter.txt')); KB fclose($counter); KB $ip = getenv('REMOTE_ADDR'); KB $ipCheck = file('ips.txt'); KB if (!in_array($ip, $ipCheck)) { KB $ipAdd = fopen('ips.txt', 'a'); KB fwrite($ipAdd, \n$ip); KB fclose($ipAdd); KB $current++; KB $counter = fopen('counter.txt', 'w'); KB fwrite($counter, $current); KB fclose($counter); KB } print $current; ? KB -- KB Kyle maybe you need to end the if() statement before incrementing the counter. $ip = getenv('REMOTE_ADDR'); $ipCheck = file('ips.txt'); if (!in_array($ip, $ipCheck)) { $ipAdd = fopen('ips.txt', 'a'); fwrite($ipAdd, \n$ip); fclose($ipAdd); } $current++; $counter = fopen('counter.txt', 'w'); fwrite($counter, $current); fclose($counter); print $current; ? -- regards, Tom -- Kyle -- 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] Snarl, hiss, growl (frustration)
On Fri, 2003-07-04 at 12:44, Rasmus Lerdorf wrote: The difference is that you are getting a string from the file and not casting it to an integer. You could also have fixed it by doing: $counter = (int) fread(...); The cast isn't necessary, PHP happily transforms it for him when he applies the ++ operator. Cheers, Rob. -- .-. | Worlds of Carnage - http://www.wocmud.org | :-: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul.| `-' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Snarl, hiss, growl (frustration)
On Fri, 4 Jul 2003, Robert Cummings wrote: On Fri, 2003-07-04 at 12:44, Rasmus Lerdorf wrote: The difference is that you are getting a string from the file and not casting it to an integer. You could also have fixed it by doing: $counter = (int) fread(...); The cast isn't necessary, PHP happily transforms it for him when he applies the ++ operator. ;) You are sure about that right? Or else you wouldn't have posted this to 1000's of people. So what do you think this will output? $a = 123\n; $a++; echo $a; Try it. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to :: multi select
Hi guys, This might just be off the topic, but here it goes anyway: How can one multi select check boxes and pass them through in php, without getting mixed up with variables (email multi select style). Thomas
RE: [PHP] Red Hat 9, Apache 2, and PHP
Hi, that sounds really impressive. I'm using Redhat 9 with the stuff from their Edition, that means Apache 2 and php together. Never had any issues (so far.keep my fingers crossed). The server is not under heavy load, but it is indeed a production server. I know it is not recommended, but for this use (mysql apache php on that server in a company intranet, used for keeping a picture library administration issues) is it necessary to change it? Please advise. To my defence I have to say that the data on the server is backed up regularly, though not the OS itself, since if something ever happens it is less hassle to do a complete new install get the database back on. Any hints? Thanks Diana --- Rasmus Lerdorf [EMAIL PROTECTED] schrieb: Apache2 has a number of different modes it can work in. These modes are called MPM's. The default MPM is called Worker which is a multithreaded model. PHP, mod_perl, mod_python, and any other similar technology which links directly into the httpd processes will need to be perfectly threadsafe and reentrant to work effectively with a threaded Apache2 mpm. This is doable for the core of PHP, but there are literally hundreds of 3rd party libraries that can be linked into PHP and nobody whether or not these libraries are threadsafe. And figuring out if a specific library is threadsafe or not is non-trivial and it can very from one platform to another. And just to make it even harder, this stuff will appear to work fine until you put it under load or hit very specific race conditions which makes it nearly impossible to debug. So, since we can't tell you for sure that a threaded Apache2 mpm + PHP will work we do not suggest you use it for a production server. And since we can't know for sure, none of the main PHP developers use this combination for our own servers which compounds the problem because it is not receiving anywhere near the amount of realworld testing required to work out all the little issues above and beyond this threading unknown. There is an Apache2 mpm, called prefork, which isn't threaded and basically makes Apache2 look like Apache1. But hey, we have a very good server already that looks like Apache1. In the end I don't see Apache2+PHP ever becoming a production platform with the current architecture. The only way I see it ever working is to pull PHP out of Apache and use a fastcgi approach. Or, with time, perhaps we will learn how to make sure a library is perfectly threadsafe and safe to use in a multithreaded Apache2. For now, I really see no reason not to simply use Apache1 if you want a robust, fast and stable web server. -Rasmus = WHEN ALL ELSE FAILS, HUG YOUR SNOOPY Those who bring sunshine to the lives of others cannot keep it from themselves. J.M. Barrie (1860-1937) __ Gesendet von Yahoo! Mail - http://mail.yahoo.de Logos und Klingeltöne fürs Handy bei http://sms.yahoo.de -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to :: multi select
Hi Thomas. You need to name each checkbox a different name. alternatively, you can name them with array naming convention. i.e. input type=checkbox name='array1[value1]' value='Y' 1-1 input type=checkbox name='array1[value2]' value='Y' 1-2 input type=checkbox name='array2[value1]' value='Y' 2-1 input type=checkbox name='array2[value2]' value='Y' 2-2 Checking off 1-1 and 2-2 would create the following variables (assuming register_globals is on) in the target php script for the form: $array1=array(value1=Y,value2=); $array2=array(value1=,value2=Y); Hope this helps Matt On Fri, 2003-07-04 at 17:20, Thomas Hochstetter wrote: Hi guys, This might just be off the topic, but here it goes anyway: How can one multi select check boxes and pass them through in php, without getting mixed up with variables (email multi select style). Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Red Hat 9, Apache 2, and PHP
Diana wrote: Hi, that sounds really impressive. I'm using Redhat 9 with the stuff from their Edition, that means Apache 2 and php together. Never had any issues (so far.keep my fingers crossed). The server is not under heavy load, but it is indeed a production server. I know it is not recommended, but for this use (mysql apache php on that server in a company intranet, used for keeping a picture library administration issues) is it necessary to change it? Please advise. To my defence I have to say that the data on the server is backed up regularly, though not the OS itself, since if something ever happens it is less hassle to do a complete new install get the database back on. Any hints? We (at hyperreal.info) used PHP+Apache 2 for a while, but it created so many problems (stability, non working SSL, others) that we have returned to the 1.3.x version...and now everything works like it should :8]. -- Seks, seksi, seksolatki... news:pl.soc.seks.moderowana http://hyperreal.info / ALinkA / bOrk! * WiNoNa ) ( http://szatanowskie-ladacznice.0-700.pl foReVeR( * ) Poznaj jej zwiewne ksztaty... http://www.opera.com 007 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Red Hat 9, Apache 2, and PHP
OK, so Apache 2 is out. Is there any reason not to go with RH 9.0? Any known problems? Jeff - Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month!
[PHP] mail()
Hi, Could someone let me know if it is possible to pass a resultset of a query to a single variable so it can be included as the message part of the mail function? Thanks! Phil Dowson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Failed to Receive in E:\...\mailscript.php on line 25
Hi, I am making a small PHP script for managing a simple mailing list. The PHP script is added in the bottom of this message. This PHP script works great on IIS 5.1 with PHP 4.3.0, witch I have installed locally on my system to test my scripts. But when I transfer the script over to my host server (With IIS and PHP 4.2.1), I get an error message when I'm trying to use it. The error message is like this: Warning: Failed to Receive in E:\inetpub\wwwroot\grimstad.seilforening\Mailinglister\mailscript.php on line 25 Kommandoen er nå sendt. Merk at det kan ta opp til 5 minutter før den trer i kraft.PHP Warning: Failed to Receive in E:\inetpub\wwwroot\grimstad.seilforening\Mailinglister\mailscript.php on line 25 Is there any compatibility problems between 4.2.1 and 4.3.0 for the codes I have used in my script? Regards, Håkon Strandenes Here is the script (It get its inputs from this form: http://grimstad.seilforening.no/Mailinglister/Styreskjema.html): ?php @extract($_POST); $Liste = stripslashes($Liste); $Navn = stripslashes($Navn); $Email = stripslashes($Email); $Kommando = stripslashes($Kommando); if (!$Email) { echo (Du må fylle inn din e-mail adresse.); } else { if (!$Navn) { echo (Du må fylle inn navnet ditt.); } else { $Message = Automatisk generert styringsmail; $Headers = From: $Navn $Email; mail( $Liste, $Kommando, $Message, $Headers ); echo (Kommandoen er nå sendt. Merk at det kan ta opp til 5 minutter før den trer i kraft.); } } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Snarl, hiss, growl (frustration)
On Fri, 2003-07-04 at 13:13, Rasmus Lerdorf wrote: On Fri, 4 Jul 2003, Robert Cummings wrote: On Fri, 2003-07-04 at 12:44, Rasmus Lerdorf wrote: The difference is that you are getting a string from the file and not casting it to an integer. You could also have fixed it by doing: $counter = (int) fread(...); The cast isn't necessary, PHP happily transforms it for him when he applies the ++ operator. ;) You are sure about that right? Or else you wouldn't have posted this to 1000's of people. I am absolutely sure of thus since I cut and pasted the original problem code to a shell script to test. This was before I noticed the answer mentioning the closing if block had already been posted. So what do you think this will output? $a = 123\n; $a++; echo $a; Try it. Undoubtedly the above will work as we both know, the output will be 123; however, if you look at the original code in question, there is no \n tailing the output written to the counter file and thus the increment works fine (unless of course when he created the file to begin he had a newline - something I did not do in my test :) Cheers, Rob. -- .-. | Worlds of Carnage - http://www.wocmud.org | :-: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul.| `-' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Snarl, hiss, growl (frustration)
On Fri, 4 Jul 2003, Robert Cummings wrote: Undoubtedly the above will work as we both know, the output will be 123; however, if you look at the original code in question, there is no \n tailing the output written to the counter file and thus the increment works fine (unless of course when he created the file to begin he had a newline - something I did not do in my test :) which is exactly what it looked like he did since he said that switching to $counter+=1; fixed it for him which would force it to be an integer. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Snarl, hiss, growl (frustration)
FYI there were no newlines involved in my program. (go back to the message and read the code) On Fri, 4 Jul 2003 12:06:46 -0700 (PDT), Rasmus Lerdorf [EMAIL PROTECTED] said: On Fri, 4 Jul 2003, Robert Cummings wrote: Undoubtedly the above will work as we both know, the output will be 123; however, if you look at the original code in question, there is no \n tailing the output written to the counter file and thus the increment works fine (unless of course when he created the file to begin he had a newline - something I did not do in my test :) which is exactly what it looked like he did since he said that switching to $counter+=1; fixed it for him which would force it to be an integer. -Rasmus -- Kyle -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Snarl, hiss, growl (frustration)
On Fri, 4 Jul 2003, Kyle Babich wrote: FYI there were no newlines involved in my program. (go back to the message and read the code) How did you create the file in the first place? Most editors will automatically add a carriage return. Even if you had your code create it, if afterwards you ever edited and saved the file with an editor, you would have gotten one in there. The proof of this is that your code didn't work. If the file really only had a number in it, then $counter++ would have worked. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Red Hat 9, Apache 2, and PHP
On Fri, 4 Jul 2003, Jeff Schwartz wrote: OK, so Apache 2 is out. Is there any reason not to go with RH 9.0? Any known problems? It should be fine. Linux is pretty much Linux. The biggest differences between distros and distro versions are at the GUI level and in the set of applications they provide. If you are going to use it as a web server and you install known good versions of Apache and PHP, then you have taken RH9 out of the loop for your critical components and it should be fine. -Rasmus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] proc_open() and SSH [still unresolved]
Hey folks, Iam trying to call the ssh program and have it connect to a remote host and authenticate, however I havent been able to do it. I used this script but all i get when I run it on port 80 is: command returned 255 At the error log i specified i get: Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,password,keyboard-interactive). Note that it doesnt even ask for a password.. just says denied immediately. ?php $descriptorspec = array( 0 = array(pipe, r), // stdin is a pipe that the child will readfrom 1 = array(pipe, w), // stdout is a pipe that the child will writeto 2 = array(file, tmp/error, a) // stderr is a file to write to ); $process = proc_open(ssh -T -l user server.com, $descriptorspec, $pipes); if (is_resource($process)) { // $pipes now looks like this: // 0 = writeable handle connected to child stdin // 1 = readable handle connected to child stdout // Any error output will be appended to /tmp/error-output.txt //fwrite($pipes[0], password); //I have tried with and without writing anything however its the same. while(!feof($pipes[1])) { echo fgets($pipes[1], 1024); } fclose($pipes[1]); //fclose($pipes[0]); $return_value = proc_close($process); echo command returned $return_value\n; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to :: multi select
On Fri, 4 Jul 2003, Thomas Hochstetter wrote: Hi guys, This might just be off the topic, but here it goes anyway: How can one multi select check boxes and pass them through in php, without getting mixed up with variables (email multi select style). Read these faqs: http://www.php.net/manual/en/faq.html.php#faq.html.arrays http://www.php.net/manual/en/faq.html.php#faq.html.select-multiple Regards, Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] More on file upload
On Saturday 05 July 2003 00:12, Webmaster wrote: Have not yet been able to figure out how to get a more descriptive error. I know there has to be a better way to get exact message, but just haven't figured it out yet. Look in php,ini (and crank up error reporting to full) and/or read the relevant chapter in the manual. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Today is the first day of the rest of your life. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using TTF within an image
On Friday 04 July 2003 14:35, CDitty wrote: Can someone please show me how to change the display font to a TTF in this code? I looked at the online manual under imageloadfont(), but I did not understand it enough. I have the MS TTFs installed on my server and they are working correctly. imagefttext() ? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The one charm of marriage is that it makes a life of deception a neccessity. - Oscar Wilde */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Probs with a form
Hey, I must send datas threw a form, but I dont want to have a submit button.. Is there a way to 'simulate' the click of a submit button? Thnx for your help Laurent -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Builing PHP with Courier-IMAP
Hello, I run courier-imap, but I have problems when trying to build php with imap support. It gives the error message configure: error: Cannot find imap library (libc-client.a). Please check your IMAP installation. Anyone with ideas? -Fisayo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A php-mysql checkbox question
Hello, I have a problem trying to show a checkbox list and have some of the boxes checked and not others. Here are the details: table: features rec_id | fName - 1 | Window - 2 | pool - 3 | fence - 4 | Drive table: com_features rec_id | com_features_id | feature_id -- 1 | 2| 1 -- 2 | 1| 4 -- 3 | 1| 3 -- 4 | 2| 3 -- 5 | 4| 4 -- 6 | 7| 4 -- 7 | 8| 4 -- 8 | 2| 4 what I want is to display a checkbox list that would show all the values from 'features' and have the appropriate boxes checked when 'com_features.com_features.id = 2' ie X Window pool X fence X drive The query I am using now is: $sql =SELECT features.rec_id AS rec_id, features.fName AS fName, com_features.feature_id AS feature_id, com_features.com_rec_id AS com_rec_id FROM features, com_features WHERE com_features.com_rec_id = \2\ AND features.TheTest=\1\; What I get in the return is: X Window pool fence drive Window pool X fence drive Window pool fence X drive TIA for any help, John -- === John T. Beresford, Owner Digital Studio Design Edmond, OK http://www.digitalstudiodesign.com/ 405.760.0794 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OCI_ASSOC returns key with upper case string
Hello, First let me say that I am not sure if this is PHP problem or Oracle. I have a class that contains API for using postgresql, mysql, or oracle database so switching database should be in theory just changing an argument for me. To make this sort, let just say that the return of a SELECT statement is always in associative array, using either : pg_fetch_assoc for pgsql mysql_fetch_assoc for mysql ocifetchinto with OCI_ASSOC flag for Oracle 9 Now, pg_fetch_assoc and mysql_fetch_assoc return the associate array with the key in lower case. But ocifetchinto returns the key in UPPER case. So this discrepancy makes my code not as portable as I would like it. Furthermore, the example here: http://us2.php.net/manual/en/function.ocifetchinto.php doesn't even work, because it uses lower case as the associative array key. Why is this the case? Is this PHP problem or Oracle config problem? Either way, can anyone suggest a solutions? Of course I can do all kind of array manipulation in my API to make the key lower case, but that wouldn't be very elegant and efficient Thanks in advance for any help. RDB -- - /\ ASCII Ribbon Campaign against HTML \ / email and proprietary format X attachments. / \ - Have you been used by Microsoft today? Choose your life. Choose freedom. Choose LINUX. - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: OCI_ASSOC returns key with upper case string
Hello, On 07/04/2003 08:38 PM, Reuben D. Budiardja wrote: First let me say that I am not sure if this is PHP problem or Oracle. I posted this earlier in php-general, but after looking at the available mailing lists again, I thought this forum would be more appropriate. Sorry if someone get double post. I have a class that contains API for using postgresql, mysql, or oracle database so switching database should be in theory just changing an argument for me. To make this sort, let just say that the return of a SELECT statement is always in associative array, using either : pg_fetch_assoc for pgsql mysql_fetch_assoc for mysql ocifetchinto with OCI_ASSOC flag for Oracle 9 Now, pg_fetch_assoc and mysql_fetch_assoc return the associate array with the key in lower case. But ocifetchinto returns the key in UPPER case. So this discrepancy makes my code not as portable as I would like it. Furthermore, the example here: http://us2.php.net/manual/en/function.ocifetchinto.php doesn't even work, because it uses lower case as the associative array key. Why is this the case? Is this PHP problem or Oracle config problem? Either way, can anyone suggest a solutions? Of course I can do all kind of array manipulation in my API to make the key lower case, but that wouldn't be very elegant and efficient No, that is just the way Oracle returns column names. It is not possible to provide a portable solution to return row in associative arrays because not only the column names case may be mapped, removed the table names or even have the column names truncated. That is the reason why Metabase never provided a function to return rows as associative arrays, as Metabase is focused on real database application portability. http://www.phpclasses.org/metabase -- Regards, Manuel Lemos 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
[PHP] security question
Can anyone think of any security caveats with regard to turning output_buffering on? I can't, but it's too hot to think straight these days Tnx. -- Paul Chvostek [EMAIL PROTECTED] it.canadahttp://www.it.ca/ Free PHP web hosting!http://www.it.ca/web/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php