php-general Digest 9 Mar 2006 11:11:31 -0000 Issue 4006
php-general Digest 9 Mar 2006 11:11:31 - Issue 4006 Topics (messages 231695 through 231709): Re: .DAT file with PHP 231695 by: Rory Browne 231696 by: Rory Browne 231700 by: Jabez 231701 by: Paul Novitski 231708 by: Rory Browne Re: php tests failures on windows 231697 by: Chris 231699 by: Manish Marathe Re: test security of code 231698 by: Chris 231706 by: Gregory Machin 231707 by: Björn Bartels Random permission strangeness 231702 by: Paul Scott 231703 by: Chris 231705 by: Paul Scott Re: Make all emails links 231704 by: Rafael Re: Convert all named entities into numeric character references 231709 by: Robin Vickery Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: php-general@lists.php.net -- ---BeginMessage--- On 3/8/06, Paul Novitski [EMAIL PROTECTED] wrote: At 10:27 AM 3/8/2006, Rory Browne wrote: $filename = filename.txt; $file_content = join(\n, array_reverse(file($filename))); echo $file_content; Rory, I think you've got the logic right. Tangentially, however, I recommend that you break it out into separate statements and not throw multiple functions into the same statement -- it's hard to proofread, it's hard to pinpoint where errors occur, and it's next to impossible to insert echo statements to debug the process. Also for ease of debugging maintenance, I recommend indicating the type of each variable with a prefix (a=array, s=string, etc.): Different strokes for different folks. Code presention is something I take very seriously, but I don't consider using the return value of one function as a parameter for another to be a bad thing. Meaningful, or conventional variables are another thing I take seriously. If I wanted to keep track of types I'd use C++ or Java. I don't have a problem with something like: $sFilename = filename.txt; $aFile_content = file($sFilename); $aFile_reverse = array_reverse($aFile_content); $sDisplay_content = join(\n, $aFile_reverse); echo $sDisplay_content; I don't think PHP will care whether it's broken out or not -- internally it's having to create temporary variables on the fly to store incremental values -- but your future self and other folks reading your code will thank you for it. Regards, Paul ---End Message--- ---BeginMessage--- last mail got accidently sent before completion - please reply to that, or the OP and not this. I don't have much of a problem with code that takes a less blatent inspiration of the following: $file = filename.txt; $file = file_get_contents($file); $file = explode(\n, $file); $file = array_reverse($file); $file = join(\n, $file); echo $file; I do however consider $filename - whatever.txt; I perfer to abstract configuration issues $rev_content = join(\n, array_reverse(file($file)))'; echo $rev_contaent; to be cleaner ---End Message--- ---BeginMessage--- I used the following code that Paul suggested, but it didn't reverse my content. The file I would want to have the content reversed is as attached. Chinese characters is in the file so... Suggestions? -Original Message- From: Paul Novitski [mailto:[EMAIL PROTECTED] Sent: Thursday, March 09, 2006 2:58 AM To: php-general@lists.php.net Subject: Re: [PHP] .DAT file with PHP At 10:27 AM 3/8/2006, Rory Browne wrote: $filename = filename.txt; $file_content = join(\n, array_reverse(file($filename))); echo $file_content; Rory, I think you've got the logic right. Tangentially, however, I recommend that you break it out into separate statements and not throw multiple functions into the same statement -- it's hard to proofread, it's hard to pinpoint where errors occur, and it's next to impossible to insert echo statements to debug the process. Also for ease of debugging maintenance, I recommend indicating the type of each variable with a prefix (a=array, s=string, etc.): $sFilename = filename.txt; $aFile_content = file($sFilename); $aFile_reverse = array_reverse($aFile_content); $sDisplay_content = join(\n, $aFile_reverse); echo $sDisplay_content; I don't think PHP will care whether it's broken out or not -- internally it's having to create temporary variables on the fly to store incremental values -- but your future self and other folks reading your code will thank you for it. Regards, Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php net/unsub.php ---End Message--- ---BeginMessage--- At 07:05 PM 3/8/2006, Jabez wrote: I used the following code that Paul suggested, but it didn't reverse my content. The file I would want to have the content reversed
php-general Digest 9 Mar 2006 23:26:46 -0000 Issue 4007
php-general Digest 9 Mar 2006 23:26:46 - Issue 4007 Topics (messages 231710 through 231737): Re: include not working properly? 231710 by: Jochem Maas SVN PHP 231711 by: Jon Morgan 231712 by: Jon Morgan 231713 by: Jens Kleikamp PHP + MMS Live Streaming + Protect URL. 231714 by: Gentil de Bortoli Júnior 231715 by: David Tulloh 231716 by: Gentil de Bortoli Júnior 231717 by: Barry 231718 by: Gentil de Bortoli Júnior X-Mailer and headers when sending mail 231719 by: Angelo Zanetti 231726 by: Paul Scott Re: Zoomable map 231720 by: Lester Caine session handling 231721 by: suresh kumar 231723 by: João Cândido de Souza Neto 231727 by: tedd 231730 by: Gerry Danen the best way to get Apache/PHP to handle *all* requests 231722 by: Nic setting vhost or directory based options to php when using apache with php4-cgi 231724 by: Christoph Anton Mitterer Understanding system multiple steps 231725 by: Mark Steudel Re: Calling Curt Z, Curt Z to the white courtesy phone please 231728 by: Max Schwanekamp php-cgi limitations 231729 by: Max Schwanekamp 231734 by: El Bekko 231735 by: Max Schwanekamp Sockets ot smth like this 231731 by: _-=MealstroM=-_ Re: Building php-pcre extension on windows 231732 by: Manish Marathe What is the effect of --enable-memory-limit 231733 by: Khai Extending a class with a static constructur (like PEAR::DB) 231736 by: weston.leary.csoft.net Re: Random permission strangeness 231737 by: Chris Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: php-general@lists.php.net -- ---BeginMessage--- robert mena wrote: Hi, Thanks. it worked. Since I have a common server where various virtualhosts reside what would you recommend in terms of security? 1. don't let assholes on your box. 2. read http://phpsec.org safemode and openbase_dir are primarily designed to protected legitimate users of a server from screwing around with each others stuff... if you are the only user (or only team/company) putting stuff on the given box then it would be fair to say that setting up security in order to protect yourself from [malicious] yourself is rather silly. i.e. it's attacks from outside (sql injection, XSS, session spoofing/fixation) you should be more worried about. and if your managing lots of paying (hosting) customers - heck buy something like Plesk and save yourself lots of grief. JMO PHP 6.0.0 seems to be at least a year ahead and frankly I would probably only upgrade after a couple of .0.x releases. yeah but you might as well keep your code as forward compatible as possible - saves headaches further down the road. rgds, ---End Message--- ---BeginMessage--- Hi. I'm trying to access SVN from PHP and as there seems to be no direct binding for it yet i've had a look at WebSVN source to try and list directories in a repository with the following code but it just doesn't return anything. It doesn't return anything whether re-directing or not (i..e. using 21). If I use the same method to call svnlook author, etc. it work fine, the only problem is when using the svn command line program. $output = array (); $err = false; $cmd = svn info http://172.16.0.32/svn/java/trunk 21; if ($handle = popen($cmd, r)) { $firstline = true; while(!feof($handle)) { $line = fgets($handle); if($firstline $line == ) { $err = true; } $firstline = false; $output[] = rtrim($line); } pclose($handle); if(!$err) print $output; } Any help would be appreciated. Cheers, J. ---End Message--- ---BeginMessage--- Hi. I'm trying to access SVN from PHP and as there seems to be no direct binding for it yet i've had a look at WebSVN source to try and list directories in a repository with the following code but it just doesn't return anything. It doesn't return anything whether re-directing or not (i..e. using 21). If I use the same method to call svnlook author, etc. it work fine, the only problem is when using the svn command line program. $output = array (); $err = false; $cmd = svn info http://172.16.0.32/svn/java/trunk 21; if ($handle = popen($cmd, r)) { $firstline = true; while(!feof($handle)) { $line = fgets($handle); if($firstline $line == )
Re: [PHP] .DAT file with PHP
I didn't get the file, but If the lines are seperated by br's instead of newlines, then $filename = monkey.html; $file_array = preg_split(/br.*?/, file_get_content($filename)); $rev_array = array_reverse($file_array); $output = join(br /, $rev_array); This could be modded to maintain any arguments inside the br tag, by replacing preg_replacing br.*? with $1\n, and then splitting on \n. On 3/9/06, Paul Novitski [EMAIL PROTECTED] wrote: At 07:05 PM 3/8/2006, Jabez wrote: I used the following code that Paul suggested, but it didn't reverse my content. The file I would want to have the content reversed is as attached. Chinese characters is in the file so... Suggestions? Jabez, The data in your file is all in one text line. You have inserted the string br between what I assume are your data elements, but not PHP linefeed characters. Try using \n (backslash-n) as your line delimiter and try again. By the way, I neglected to tell you earlier that when file() reads a file into an array, it includes the linefeed characters at the end of each array element. These might or might not get in your way if you're outputting your data to an HTML file -- a linefeed will render as a whitespace character. If you'll be writing the data to another text file where linefeeds are crucial, you may wish to massage the array to ensure that every array element (including the last one read from the original file) ends in \n. Regards, Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Convert all named entities into numeric character references
On 06/03/06, Jacob Friis Saxberg [EMAIL PROTECTED] wrote: Does anyone know of a Php funtion that can do this: http://golem.ph.utexas.edu/~distler/blog/NumericEntities.html Hi there! http://se.php.net/manual/en/function.htmlentities.php ? htmlentities converts to named entitites. I want it to numeric entities. This is probably the simplest way of doing it; write a simple function that translates entity names to numbers, then start an output buffer at the beginning of your script using the function as an output callback function. Then everything after that automatically gets converted. In fact it's so simple, I'll do it for you... Code posted to pastebin: http://robinv.pastebin.com/592400 -robin
Re: [PHP] include not working properly?
robert mena wrote: Hi, Thanks. it worked. Since I have a common server where various virtualhosts reside what would you recommend in terms of security? 1. don't let assholes on your box. 2. read http://phpsec.org safemode and openbase_dir are primarily designed to protected legitimate users of a server from screwing around with each others stuff... if you are the only user (or only team/company) putting stuff on the given box then it would be fair to say that setting up security in order to protect yourself from [malicious] yourself is rather silly. i.e. it's attacks from outside (sql injection, XSS, session spoofing/fixation) you should be more worried about. and if your managing lots of paying (hosting) customers - heck buy something like Plesk and save yourself lots of grief. JMO PHP 6.0.0 seems to be at least a year ahead and frankly I would probably only upgrade after a couple of .0.x releases. yeah but you might as well keep your code as forward compatible as possible - saves headaches further down the road. rgds, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SVN PHP
Hi. I'm trying to access SVN from PHP and as there seems to be no direct binding for it yet i've had a look at WebSVN source to try and list directories in a repository with the following code but it just doesn't return anything. It doesn't return anything whether re-directing or not (i..e. using 21). If I use the same method to call svnlook author, etc. it work fine, the only problem is when using the svn command line program. $output = array (); $err = false; $cmd = svn info http://172.16.0.32/svn/java/trunk 21; if ($handle = popen($cmd, r)) { $firstline = true; while(!feof($handle)) { $line = fgets($handle); if($firstline $line == ) { $err = true; } $firstline = false; $output[] = rtrim($line); } pclose($handle); if(!$err) print $output; } Any help would be appreciated. Cheers, J. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SVN PHP
Hi. I'm trying to access SVN from PHP and as there seems to be no direct binding for it yet i've had a look at WebSVN source to try and list directories in a repository with the following code but it just doesn't return anything. It doesn't return anything whether re-directing or not (i..e. using 21). If I use the same method to call svnlook author, etc. it work fine, the only problem is when using the svn command line program. $output = array (); $err = false; $cmd = svn info http://172.16.0.32/svn/java/trunk 21; if ($handle = popen($cmd, r)) { $firstline = true; while(!feof($handle)) { $line = fgets($handle); if($firstline $line == ) { $err = true; } $firstline = false; $output[] = rtrim($line); } pclose($handle); if(!$err) print $output; } Any help would be appreciated. Cheers, J. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: SVN PHP
Jon Morgan wrote: Hi. I'm trying to access SVN from PHP and as there seems to be no direct binding for it yet i've had a look at WebSVN source to try and list directories in a repository with the following code but it just doesn't return anything. It doesn't return anything whether re-directing or not (i..e. using 21). If I use the same method to call svnlook author, etc. it work fine, the only problem is when using the svn command line program. $output = array (); $err = false; $cmd = svn info http://172.16.0.32/svn/java/trunk 21; if ($handle = popen($cmd, r)) { $firstline = true; while(!feof($handle)) { $line = fgets($handle); if($firstline $line == ) { $err = true; } $firstline = false; $output[] = rtrim($line); } pclose($handle); if(!$err) print $output; } Any help would be appreciated. Cheers, J. Maybe the svn pecl extension can help, http://pecl.php.net/package/svn cheers, Jens -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP + MMS Live Streaming + Protect URL.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, guys. I have a little problem here and I would like to know if you have any idea about how to handle it. I have an URL which is streaming a live TV channel and I need to implement, using PHP, some kind of validation to allow that only one person (login) watch it. I mean, multiple logins are not allowed. So far, so good. My problem is that the URL can be copied and pasted. I'm trying to figure it out how to hide and/or protect this URL to permit only logged in people can see the streaming. Do you have any idea? Thanks in advance and excuse me about my English. - -- Gentil de Bortoli Júnior Chave GPG: http://gentil.bortoli.com.br/gpg There Is No Gene For The Human Spirit -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFEEDUDR/xCJbtXupkRAnp8AJsHqC9QKWGEY/UEYf7eexyO719msACdEJJ1 93swUZjs1RZlpgmDpotXh5k= =/Mqa -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP + MMS Live Streaming + Protect URL.
It's a fairly standard authentication problem. I would solve it by using sessions. In the page and video stream start by checking for an authenticated flag in the session array. If the flag is present, display the content. If not, show a login page. When they login, set the authenticated flag and redirect them back to their original page. As you want to have people copy and paste the url, make sure that you set the use_only_cookies flag in the php config. Otherwise the session id may be part of the URL and defeat your authentication. David Gentil de Bortoli Júnior wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello, guys. I have a little problem here and I would like to know if you have any idea about how to handle it. I have an URL which is streaming a live TV channel and I need to implement, using PHP, some kind of validation to allow that only one person (login) watch it. I mean, multiple logins are not allowed. So far, so good. My problem is that the URL can be copied and pasted. I'm trying to figure it out how to hide and/or protect this URL to permit only logged in people can see the streaming. Do you have any idea? Thanks in advance and excuse me about my English. - -- Gentil de Bortoli Júnior Chave GPG: http://gentil.bortoli.com.br/gpg There Is No Gene For The Human Spirit -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFEEDUDR/xCJbtXupkRAnp8AJsHqC9QKWGEY/UEYf7eexyO719msACdEJJ1 93swUZjs1RZlpgmDpotXh5k= =/Mqa -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP + MMS Live Streaming + Protect URL.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 -Original Message- From: Gentil de Bortoli Júnior [mailto:[EMAIL PROTECTED] Sent: 9 March 2006 2:01 pm To: php-general@lists.php.net Subject: [PHP] PHP + MMS Live Streaming + Protect URL. Hello, guys. I have a little problem here and I would like to know if you have any idea about how to handle it. I have an URL which is streaming a live TV channel and I need to implement, using PHP, some kind of validation to allow that only one person (login) watch it. I mean, multiple logins are not allowed. So far, so good. My problem is that the URL can be copied and pasted. I'm trying to figure it out how to hide and/or protect this URL to permit only logged in people can see the streaming. Do you have any idea? Thanks in advance and excuse me about my English. George Pitcher wrote: Hi, I would use a cookie. That cookie is set on an earlier page (during login validation?). On the page that streams the broadcast, check for the contents of the cookie and if not valid, redirect browser to log-in page. I do this for some copyright material on my sites. Thanks, George. But I think I should give you more information about my situation. This URL is being provided by a Windows server. Let's suppose that it is something like mms://my.windows.server/live. So, my job is to avoid this URL can be copied and pasted by someone which is not authorized (logged in). The main problem is that I don't have any kind of control over Windows server or over that URL. Even using cookies or some kind of session control, someone will still be able to see this URL and simply paste it in another browser and starts to watch the streaming. Actually I don't know if what I'm trying to do is possible. That's why I'm asking you. - -- Gentil de Bortoli Júnior Chave GPG: http://gentil.bortoli.com.br/gpg There Is No Gene For The Human Spirit -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFEEDs2R/xCJbtXupkRAvkvAJ0URH8NOKWg7eE/mmJQl8EOVpqSYACfRS5v 3j17iPwHheT6pgOYklI+wGw= =4sUZ -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP + MMS Live Streaming + Protect URL.
Gentil de Bortoli Júnior wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 -Original Message- From: Gentil de Bortoli Júnior [mailto:[EMAIL PROTECTED] Sent: 9 March 2006 2:01 pm To: php-general@lists.php.net Subject: [PHP] PHP + MMS Live Streaming + Protect URL. Hello, guys. I have a little problem here and I would like to know if you have any idea about how to handle it. I have an URL which is streaming a live TV channel and I need to implement, using PHP, some kind of validation to allow that only one person (login) watch it. I mean, multiple logins are not allowed. So far, so good. My problem is that the URL can be copied and pasted. I'm trying to figure it out how to hide and/or protect this URL to permit only logged in people can see the streaming. Do you have any idea? Thanks in advance and excuse me about my English. George Pitcher wrote: Hi, I would use a cookie. That cookie is set on an earlier page (during login validation?). On the page that streams the broadcast, check for the contents of the cookie and if not valid, redirect browser to log-in page. I do this for some copyright material on my sites. Thanks, George. But I think I should give you more information about my situation. This URL is being provided by a Windows server. Let's suppose that it is something like mms://my.windows.server/live. So, my job is to avoid this URL can be copied and pasted by someone which is not authorized (logged in). The main problem is that I don't have any kind of control over Windows server or over that URL. Even using cookies or some kind of session control, someone will still be able to see this URL and simply paste it in another browser and starts to watch the streaming. Actually I don't know if what I'm trying to do is possible. That's why I'm asking you. Use htaccess? -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP + MMS Live Streaming + Protect URL.
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Gentil de Bortoli Júnior wrote: I have a little problem here and I would like to know if you have any idea about how to handle it. I have an URL which is streaming a live TV channel and I need to implement, using PHP, some kind of validation to allow that only one person (login) watch it. I mean, multiple logins are not allowed. So far, so good. My problem is that the URL can be copied and pasted. I'm trying to figure it out how to hide and/or protect this URL to permit only logged in people can see the streaming. Do you have any idea? David Tulloh wrote: It's a fairly standard authentication problem. I would solve it by using sessions. In the page and video stream start by checking for an authenticated flag in the session array. If the flag is present, display the content. If not, show a login page. When they login, set the authenticated flag and redirect them back to their original page. As you want to have people copy and paste the url, make sure that you set the use_only_cookies flag in the php config. Otherwise the session id may be part of the URL and defeat your authentication. David Hi, David. Excuse me. I'll try to explain it better. Let's suppose my URL is mms://my.windows.server/live. I got your point. In fact, if I had control over that URL, it would be nice. But the problem is that once someone starts to watch the streaming, a right click on the video will reveal the original address from which that transmission is being made. I'm trying to find a way to encapsulate this address and show only something like http://my.linux.server/live.php?auth_code=1238478653. I mean, the script live.php should be responsible to deliver the streaming instead of mms://my.windows.server/live. In that way I can easily control everything. - -- Gentil de Bortoli Júnior Chave GPG: http://gentil.bortoli.com.br/gpg There Is No Gene For The Human Spirit -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQFEEEO9R/xCJbtXupkRAohmAJ4jnMOWEuRqp8wTwEEcH0nvWCtB5QCfWcIL Cgm+uCySeBp+QpqqoCMEv4w= =7R/g -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] X-Mailer and headers when sending mail
Hi guys. When adding additional headers to an email that gets sent from the mail function. What purpose does the X-Mailer have? Also are the following linked: -X-Priority -Importance -X-MSMail-Priority Another question is can I omit the Message-ID for the email? or will this result in some mail servers viewing the mail as spam? What criteria do I use to generate the Message-ID? I've seen: $headers .= Message-ID: .date(YmdHis).you@.$_SERVER['SERVER_NAME'].\n; is this ok? Perhaps if someone has a link on the headers for a mail that could help me it would be much appreciated. Thanks in advance -- Angelo Zanetti Z Logic www.zlogic.co.za [c] +27 72 441 3355 [t] +27 21 469 1052 [f] +27 86 681 5885 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Zoomable map
Paul Scott wrote: On Wed, 2006-03-08 at 13:12 -0600, Philip Hallstrom wrote: I have been searching for this, but maybe one of you has seen it before and can save me some time. I need a class that will allow me to create a zoomable map application. I have a map, I just need folks to be able to zoom and scroll,etc. TIA! http://script.aculo.us/ might have what you need... I would also suggest having a look at the UMN Mapserver. http://mapserver.gis.umn.edu/ There is a pretty decent PHP_Mapscript API that is really easy to use to create quite excellent mapping applications. Then again, this may be overkill, and google maps API may be your best bet. Something like http://home.lsces.co.uk/bitweaver/mapper/display_map.php This is built with Mapserver -- Lester Caine - G8HFL - L.S.Caine Electronic Services Treasurer - Firebird Foundation Inc. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session handling
i am having one problem in session handling. I am having 2 files,login page and hame page. when user enterd user name and password in login page .i used session to store the user id .in my second home page.i retrieve the user id.now i want the user id to be availble in my thrid page.plz help me.this is my code. login.php session_start(); $ID=$userid; session_register(ID); homepage.php session_start(): echo $ID //this is working fine thirdpage.php session_start(); echo $ID //not working i am looking reply from u __ Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] the best way to get Apache/PHP to handle *all* requests
Hi I've got apache2/mod_php4 and I want to pass all requests to a vhost through to a single PHP script. I've tried this config: VirtualHost * ServerName yyy DocumentRoot /var/local/yyy LocationMatch .* ForceType application/x-httpd-php /LocationMatch /VirtualHost with a PHP script called store I can get most of the requests to go through the script by asking for: http://yyy/store/something/or/other However, RANGE requests don't go through the PHP handler. Anyone know why? Nic Ferrier -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: session handling
One important question is: You're using register_globals equal on or off? suresh kumar wrote: i am having one problem in session handling. I am having 2 files,login page and hame page. when user enterd user name and password in login page .i used session to store the user id .in my second home page.i retrieve the user id.now i want the user id to be availble in my thrid page.plz help me.this is my code. login.php session_start(); $ID=$userid; session_register(ID); homepage.php session_start(): echo $ID //this is working fine thirdpage.php session_start(); echo $ID //not working i am looking reply from u __ Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] setting vhost or directory based options to php when using apache with php4-cgi
Hi. I'm using Debian sarge with php4-cgi and I'm looking for a way to set php settings like open_basedir or disable_functions at a per virtual_host or directry level from apache. This seems to be possible when using libapache2-mod-php4 using stuff like php_admin_value, but not with my php over cgi setup. Is it possible to achive the same thing with php-cgi, and if so how? Thanks in advance, Chris. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Understanding system multiple steps
So I am using system() to try and access sftp from my php scripts. How do I do multiple steps once I've initiated my command e.g. $file = 'filname.txt'; system( C:\sftp\sftp.exe login flags | put .$file ); Im on a windows box, so I don't know if I can do something like this ... anyway any help would be ppreciated THanks
Re: [PHP] X-Mailer and headers when sending mail
On Thu, 2006-03-09 at 17:27 -0800, Angelo Zanetti wrote: When adding additional headers to an email that gets sent from the mail function. What purpose does the X-Mailer have? It identifies the mail client. So I normally set X-Mailer = MySite Mailer; or something. This directive won't normally cause problems with servers, but the Reply-To header will. Some servers reject mail without a valid return address, mainly because this is a spam trick. Its a reverse lookup of sorts on the mail server side. Also are the following linked: -X-Priority -Importance -X-MSMail-Priority Yes, MSMail-Priority is for Microsoft clients, Importance is for Mac clients (I think) and X-Priority is for the rest of the known universe that adheres to standards. Another question is can I omit the Message-ID for the email? or will this result in some mail servers viewing the mail as spam? What criteria do I use to generate the Message-ID? Message-ID is OK to omit In my experience, but see above for Reply-To I've seen: $headers .= Message-ID: .date(YmdHis).you@.$_SERVER['SERVER_NAME'].\n; is this ok? I would do a date(r) for a nice RFC format date and time, but it should be OK. Perhaps if someone has a link on the headers for a mail that could help me it would be much appreciated. http://za2.php.net/ mail function. --Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session handling
i am having one problem in session handling. I am having 2 files,login page and hame page. when user enterd user name and password in login page .i used session to store the user id .in my second home page.i retrieve the user id.now i want the user id to be availble in my thrid page.plz help me.this is my code. login.php session_start(); $ID=$userid; session_register(ID); homepage.php session_start(): echo $ID //this is working fine thirdpage.php session_start(); echo $ID //not working i am looking reply from u Try: session_register(ID); tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Calling Curt Z, Curt Z to the white courtesy phone please
Curt Zirzow wrote: I'm including the list in this reply in case any wants to give some feedback. http://zirzow.dyndns.org/php-general/NEWBIE http://www.thelinuxconsultancy.co.uk/phpeditors.php is no longer valid. I mean, the list is no longer there, though the URL is still valid. It got pretty out of date anyhow. php-editors.com is a good alternative suggestion. -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php-cgi limitations
Can anyone offer or point me to a summary of differences between running php as an Apache module vs as a cgi executable? Specifically, I'm wanting to upgrade our servers to php 5 but there is one crucial third-party app we're using that still needs php 4, so I'm hoping I can run just that app under php 4 cgi until the vendor updates to support php 5. Google is unusually laconic on this, but perhaps I just offended it with too many daft queries on the subject... :) -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session handling
$ID is not a global, but $_SESSION[ID] would be... Gerry http://groups.yahoo.com/group/php_and_mysql/ On 3/9/06, suresh kumar [EMAIL PROTECTED] wrote: i am having one problem in session handling. I am having 2 files,login page and hame page. when user enterd user name and password in login page .i used session to store the user id .in my second home page.i retrieve the user id.now i want the user id to be availble in my thrid page.plz help me.this is my code. login.php session_start(); $ID=$userid; session_register(ID); homepage.php session_start(): echo $ID //this is working fine thirdpage.php session_start(); echo $ID //not working
[PHP] Re: Building php-pcre extension on windows
On 3/7/06, Manish Marathe [EMAIL PROTECTED] wrote: PHP experts everywhere!! I am building PHP 5.1.2 on windows without pcre-regex extension. I am building building pcre independently and then I am building the extension php_pcre.dll. I build few other extensions too. I keep the extensions in c:\php\extensions which is set in php.ini. I am getting an error that php_pcre.dll extension is invalid or corrupt whenever php call is being invoked. I believe I am not building php_pcre.dll extension properly, although any insights as to what could be the problem. Also is OK to build php --without-pcre-regex extension at all? Any inputs on this ??? -- Manish Marathe SpikeSource, Inc. http://developer.spikesource.com
[PHP] What is the effect of --enable-memory-limit
If I compile php with --enable-memory-limit and set a memory limit in php.ini, what will this do ? Thanks Khai -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php-cgi limitations
Max Schwanekamp wrote: Can anyone offer or point me to a summary of differences between running php as an Apache module vs as a cgi executable? Specifically, I'm wanting to upgrade our servers to php 5 but there is one crucial third-party app we're using that still needs php 4, so I'm hoping I can run just that app under php 4 cgi until the vendor updates to support php 5. Google is unusually laconic on this, but perhaps I just offended it with too many daft queries on the subject... :) Are you sure that app won't work under PHP5? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php-cgi limitations
El Bekko wrote: Max Schwanekamp wrote: Can anyone offer or point me to a summary of differences between running php as an Apache module vs as a cgi executable? Specifically, I'm wanting to upgrade our servers to php 5 but there is one crucial third-party app we're using that still needs php 4, Are you sure that app won't work under PHP5? Thanks for the reply. The app in question is FogBugz, and they state emphatically that it does not yet work under PHP5. I guess there's only one way to find out, really - test test test. -- Max Schwanekamp http://www.neptunewebworks.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Extending a class with a static constructur (like PEAR::DB)
So... I'm trying to extend PEAR::DB. It'd be great to keep everything it offers and just add a few more perhaps unconventional functions. Intuitively, it seemed like this approach might work: ?PHP require_once(DB.php); # Toy Extension of DB Class class DBToyExt extends DB { var $foo = 1; var $bar = 2; function testext($x) { echo \nHEY: $x; } } $dte = DBToyExt::connect(mysql://weston_tssa:[EMAIL PROTECTED]/weston_tssa); $dte-testext('testing'); $dte-testext($dte-moo); $dte-testext($dte-bar); ? However, it doesn't seem to understand that the method testext exists, and gives me a fatal error to that effect, as you can see: http://weston.canncentral.org/web_lab/mlib/DBToyExt.php I'm guessing this is a side effect of the static constructor -- apparently using the extends keyword is enough to help the engine know that the class DBToyExt is supposed to inherit the static function connct, but it's not enough to bless the return value of connect from the class DB to DBToyExt How do I get around this and extend DB? Thanks, Weston -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Random permission strangeness
Paul Scott wrote: On Thu, 2006-03-09 at 16:05 +1100, Chris wrote: What's the whole error message (ie context)? Is it coming from cron or randomly in your scripts? From Xdebug... Its random. I am just thinking though that what it *might* be is that the initial session is timing out between the app launch and the user logging in. I start the session beforehand, and simply add/delete from it as the user moves through the system. Notice: session_start() [function.session-start]: ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13) in /var/www/5ive/app/classes/core/engine_class_inc.php on line 967 snip If you leave your browser open for 20 mins or something and then try to log in, does that replicate it? My first guess is garbage collection.. What are the permissions on that folder? If it's randomly in your scripts, which user is your webserver running as? www-data, permissions are drwx-wx-wt owner root. Would it not be a little unsafe to change those permissions to anything less secure? I certainly wouldn't think it OK to chown to the webserver user...? Should be ok to leave it as it is. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What is the effect of --enable-memory-limit
Khai wrote: If I compile php with --enable-memory-limit and set a memory limit in php.ini, what will this do ? http://www.php.net/manual/en/ini.core.php#ini.memory-limit -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Building php-pcre extension on windows
Manish Marathe wrote: On 3/7/06, Manish Marathe [EMAIL PROTECTED] wrote: PHP experts everywhere!! I am building PHP 5.1.2 on windows without pcre-regex extension. I am building building pcre independently and then I am building the extension php_pcre.dll. I build few other extensions too. I keep the extensions in c:\php\extensions which is set in php.ini. I am getting an error that php_pcre.dll extension is invalid or corrupt whenever php call is being invoked. I believe I am not building php_pcre.dll extension properly, although any insights as to what could be the problem. Also is OK to build php --without-pcre-regex extension at all? If you don't want the perl-regular expressions, then don't build it. If you do want them, then the installs list may be able to help you. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Understanding system multiple steps
Mark Steudel wrote: So I am using system() to try and access sftp from my php scripts. How do I do multiple steps once I've initiated my command e.g. $file = 'filname.txt'; system( C:\sftp\sftp.exe login flags | put .$file ); Im on a windows box, so I don't know if I can do something like this ... anyway any help would be ppreciated THanks Can you run that command from command line? System isn't designed for interactive steps. If you can't run a particular command from command line then you can't run it with system. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extending a class with a static constructur (like PEAR::DB)
[EMAIL PROTECTED] wrote: So... I'm trying to extend PEAR::DB. It'd be great to keep everything it offers and just add a few more perhaps unconventional functions. Intuitively, it seemed like this approach might work: ?PHP require_once(DB.php); # Toy Extension of DB Class class DBToyExt extends DB { var $foo = 1; var $bar = 2; function testext($x) { echo \nHEY: $x; } } $dte = DBToyExt::connect(mysql://weston_tssa:[EMAIL PROTECTED]/weston_tssa); $dte-testext('testing'); $dte-testext($dte-moo); $dte-testext($dte-bar); ? However, it doesn't seem to understand that the method testext exists, and gives me a fatal error to that effect, as you can see: $dte will only have the return value of DBToyExt::connect() - it won't allow you to access other methods in the class. You'll need to: $dbtoy = new DBToyExt(); $dbtoy-connect() $dbtoy-testext('testing'); -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extending a class with a static constructur (like PEAR::DB)
Weston wrote: $dte = DBToyExt::connect(mysql://weston_tssa:[EMAIL PROTECTED]/weston_tssa); $dte-testext('testing'); $dte-testext($dte-moo); $dte-testext($dte-bar); On Fri, Mar 10, 2006 at 10:43:02AM +1100, Chris wrote: $dte will only have the return value of DBToyExt::connect() - it won't allow you to access other methods in the class. You'll need to: $dbtoy = new DBToyExt(); $dbtoy-connect() $dbtoy-testext('testing'); Thanks! Works like a charm: http://weston.canncentral.org/web_lab/mlib/DBToyExt2.php That's interesting. I think I just sortof expected that since the canonical invocation is through a statically called method, calling it by dereferencing a specific object wouldn't work. Does anyone know if that would also work in PHP 5? If not, is there another way to do what I'm trying to do? Thanks, Weston -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extending a class with a static constructur (like PEAR::DB)
[EMAIL PROTECTED] wrote: Weston wrote: $dte = DBToyExt::connect(mysql://weston_tssa:[EMAIL PROTECTED]/weston_tssa); $dte-testext('testing'); $dte-testext($dte-moo); $dte-testext($dte-bar); $dte will only have the return value of DBToyExt::connect() - it won't allow you to access other methods in the class. You'll need to: $dbtoy = new DBToyExt(); $dbtoy-connect() $dbtoy-testext('testing'); Thanks! Works like a charm: http://weston.canncentral.org/web_lab/mlib/DBToyExt2.php That's interesting. I think I just sortof expected that since the canonical invocation is through a statically called method, calling it by dereferencing a specific object wouldn't work. In your example, $dte holds whatever DBToyExt::connect returns (whether that's a connection resource, a boolean, a string - doesn't matter). It's the same as: function connect() { return true; } $x = connect(); $x will only hold what 'connect' returns. If you do: var_dump($dte); It won't be an object, so you can't use that to reference other methods in that (or the parent) class(es). -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extending a class with a static constructur (like PEAR::DB)
So... I'm trying to extend PEAR::DB. It'd be great to keep everything it offers and just add a few more perhaps unconventional functions. $dte = DBToyExt::connect(mysql://weston_tssa:[EMAIL PROTECTED]/weston_tssa); DB::connect() is actually a factory call. So what is returned is an instance of (in your case) a DB_mysql object. Ahhh! I'd kept thinking what connect() returned was a db object, but it does look like it returns varying objects depending on which database you're using. Maybe I'd want to extend DB_common instead of DB_mysql, so that the methods would be inhereted by any object? Thanks, Weston -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] large file transfers
Has anyone seen a script or class that can handle file uploads of large files (greater than 20 meg)? Any direction as to where to look would be appreciated. Chris
Re: [PHP] large file transfers
Christopher Taylor wrote: Has anyone seen a script or class that can handle file uploads of large files (greater than 20 meg)? Any direction as to where to look would be appreciated. PHP can handle it, whether your server will time out with large files like that I don't know. Look at http://www.php.net/manual/en/features.file-upload.php for what you'll need to change to enable uploads of this size. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] large file transfers
Try: http://www.heylove.de/ It walks you through creating your own file upload class and in the end gives an example of how to use that class. Shaunak Kashyap Senior Web Developer WPT Enterprises, Inc. 5700 Wilshire Blvd., Suite 350 Los Angeles, CA 90036 Direct: 323.330.9870 Main: 323.330.9900 www.worldpokertour.com Confidentiality Notice: This e-mail transmission (and/or the attachments accompanying) it may contain confidential information belonging to the sender which is protected. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or taking of any action in reliance on the contents of this information is prohibited. If you have received this transmission in error, please notify the sender by reply e-mail and destroy all copies of this transmission. -Original Message- From: Christopher Taylor [mailto:[EMAIL PROTECTED] Sent: Thursday, March 09, 2006 4:29 PM To: php-general@lists.php.net Subject: [PHP] large file transfers Has anyone seen a script or class that can handle file uploads of large files (greater than 20 meg)? Any direction as to where to look would be appreciated. Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Random permission strangeness
On Fri, 2006-03-10 at 10:26 +1100, Chris wrote: If you leave your browser open for 20 mins or something and then try to log in, does that replicate it? Ah hah! The plot thickens! It seems that I can: 1. Launch the app - thereby starting the initial session 2. Leave the session to time out 3. Log in - adding username and permissions to the *non-existant session*! 4. Log out and voila! error. So it seems that the session is timing out somewhere along the line, and when it is going to be re-established, it can't because a fragment(?) of it still kinda exists - in comes the error regarding cleanup of files. --Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Random permission strangeness
Paul Scott wrote: On Fri, 2006-03-10 at 10:26 +1100, Chris wrote: If you leave your browser open for 20 mins or something and then try to log in, does that replicate it? Ah hah! The plot thickens! It seems that I can: 1. Launch the app - thereby starting the initial session 2. Leave the session to time out 3. Log in - adding username and permissions to the *non-existant session*! 4. Log out and voila! error. So it seems that the session is timing out somewhere along the line, and when it is going to be re-established, it can't because a fragment(?) of it still kinda exists - in comes the error regarding cleanup of files. If you can produce a small test case might be time for a bug report. It shouldn't give you permission denied errors. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Random permission strangeness
On Fri, 2006-03-10 at 16:00 +1100, Chris wrote: If you can produce a small test case might be time for a bug report. It shouldn't give you permission denied errors. Will work on it over the weekend. I am going to try something dead simple with the session stuff and see what I can do with it. If that also fails, will do the bug report, but I want to be dead sure before I start causing trouble for other people! Thanks for your help! --Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php