AW: [PHP] php 4 php 5

2005-03-04 Thread Mario Micklisch
 [snip]
 Is there a way to install two version of php on the same machine, and
 use them for two different users?
 [/snip]
 
 No.

Yes!

Having that in my LiteSpeed-Servers configuration with 3 different PHP
Versions. No problem if you use CGI or fastCgi's. On Apache also possible
via the VHost-Settings to assign a version to any selected VirtualHosts.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



AW: [PHP] pulling content from a URL

2005-03-04 Thread Mario Micklisch
[..]
 into a variable.  I need to include some sort of error checking that 
 will kill this request if for some reason the URL request hangs for 
 more then 15 seconds.  In researching this, I think the correct 
 function to use is fsockopen, but I can't seem to get it to work.  Can 
 someone verify if fsockopen is the best way to grab an external URL, 
 but kill the request if it hangs for a certain amount of time ... and 
 if so, show me some sample code on how to place this URL's contents 
 into a variable that I can then parse.  The URL will be hard coded into 
[..]

stream_set_timeout should be what you're looking for.

might look like this:

?php
$fp = fsockopen(www.example.com, 80);
if (!$fp) {
   echo Unable to open\n;
} else {

   fwrite($fp, GET / HTTP/1.0\r\n\r\n);
   stream_set_timeout($fp, 2);
   $res = fread($fp, 2000);

   $info = stream_get_meta_data($fp);
   fclose($fp);

   if ($info['timed_out']) {
   echo 'Connection timed out!';
   } else {
   echo $res;
   }

}
?
-- from the manual:
http://us4.php.net/manual/en/function.stream-set-timeout.php

$res will hold the first 2,000 bytes of the result. 

socket blocking would be another way, but the above one looks like exactly
what you're looking for

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



AW: [PHP] checking multiple URL parameters

2004-09-16 Thread Mario Micklisch
 I know you could write a short script that would do it, but I 
 think I saw a built-in function that did it as well.

I think parse_str is what you're looking for:

http://www.php.net/manual/en/function.parse-str.php

i.e. parse_str(getenv('QUERY_STRING'))

--
Mario



 -Ursprüngliche Nachricht-
 Von: Gryffyn, Trevor [mailto:[EMAIL PROTECTED] 
 Gesendet: Thursday, September 16, 2004 20:47 PM
 An: PHP
 Cc: [EMAIL PROTECTED]; Andrew Kreps
 Betreff: RE: [PHP] checking multiple URL parameters
 
 
 You're right though, $_GET and $_POST and such are already an 
 associative array.  I actually think I was thinking of a 
 function that parsed a URL itself, regardless of whether it 
 was submitted or not.  I'm all kinds of mixed up today, so I 
 apologize for being kind of scrambled in the brain.
 
 Is there a function that'll take 
 http://www.server.com/scriptname.php?someparam=somedatasomep
 aram2=some
 data2 and produce:
 
 $someparam == somedata
 $someparam2 == somedata2
 
 ??
 
 You understand I'm talking about parsing the URL, not 
 juggling $_GET data, right?
 
 I know you could write a short script that would do it, but I 
 think I saw a built-in function that did it as well.
 
 -TG
 
  -Original Message-
  From: Chris Shiflett [mailto:[EMAIL PROTECTED]
  Sent: Thursday, September 16, 2004 2:19 PM
  To: Andrew Kreps; PHP
  Subject: Re: [PHP] checking multiple URL parameters
  
  
  --- Andrew Kreps [EMAIL PROTECTED] wrote:
   --- Trevor Gryffyn [EMAIL PROTECTED] wrote:
I could have sworn that there was a function that 
 dropped ALL GET 
values into an associative array. Kind of the inverse of 
http_build_query.
   
   I believe you're thinking of import_request_variables
  
  That imports variables into the global scope individually.
  He's probably
  just thinking about $_GET, which is already an associative 
 array that
  contains all GET data. No function is necessary.
  
  Chris
  
  =
  Chris Shiflett - http://shiflett.org/
  
  PHP Security - O'Reilly
   Coming December 2004
  HTTP Developer's Handbook - Sams
   http://httphandbook.org/
  PHP Community Site
   http://phpcommunity.org/
  
  --
  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] downloading files

2004-08-19 Thread Mario Micklisch
Hi Aaron,
[..]
The download files are in a directory protected by htaccess which it  
is my understanding that PHP can go underneath htaccess to get access  
to the files.  My problem is where do I put this directory?  I was  
already told to put it outside the web root directory,
[..]
Both are good methods to protect your files. And yes, you can access
your files because PHP is working on the servers side and doesnt need
to obey the .htaccess restrictions you defined for user/clients.
With .htaccess protection you can access them by yourself later using  
login/password combination.

Outside your DocumentRoot you won't have the possibility and without  
any help of serverside processes you will not be able to access them.
That way you also dont need to worry about any .htaccess settings :-)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php