Re: File Handing Windows / Linux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Steve Vernon wrote:

Hiya!

I am trying to make some code which gets a handle to a directory, but has
different code for my localhost (Windows) and for online (Linux server).


Basically, I want either of the below lines. Say if the first fails, it must
be on Linux and then it uses the line below.


The two example lines are:

  @ $handle =
opendir("c:/websites/mywebsite/extra/photos/".$_GET['page']."/");
  @ $handle =
opendir("/home/mywebsite/public_html/extra/photos/".$_GET['page']."/");

Had a search on google, but not really sure what to look for!

Love,

Steve
XxX

if(false === ($handle = opendir("c:/websites/mywebsite/extra/photos/".$_GET['page']."/"))) {
$handle = opendir("/home/mywebsite/public_html/extra/photos/".$_GET['page']."/");
}


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux