RE: Re: [PHP] file_exists and wildcard/regex

2008-12-10 Thread Boyd, Todd M.
-Original Message- From: Per Jessen [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2008 1:43 AM To: php-general@lists.php.net Subject: Re: [PHP] file_exists and wildcard/regex Ashley Sheridan wrote: If you're on a Linux system, you could look at ls and the regular

RE: Re: [PHP] file_exists and wildcard/regex

2008-12-10 Thread Boyd, Todd M.
-Original Message- From: Boyd, Todd M. [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2008 8:28 AM To: php-general@lists.php.net Subject: RE: Re: [PHP] file_exists and wildcard/regex FWIW, I would probably do the file search like this (UNTESTED): ?php $filereg

Re: [PHP] file_exists and wildcard/regex

2008-12-09 Thread Stut
On 9 Dec 2008, at 22:26, Daniel Kolbo wrote: What is the preferred method with php to test and see if a file [pattern] exists? For example, i only need to search in one directory, that may have any number of files named such as afile1.txt, afile2.txt, afile3.txt, And also,

Re: [PHP] file_exists and wildcard/regex

2008-12-09 Thread Daniel Kolbo
Daniel Kolbo wrote: What is the preferred method with php to test and see if a file [pattern] exists? For example, i only need to search in one directory, that may have any number of files named such as afile1.txt, afile2.txt, afile3.txt, And also, bfile1.txt, bfile2.txt, bfile3.txt,

Re: [PHP] file_exists and wildcard/regex

2008-12-09 Thread Ashley Sheridan
On Tue, 2008-12-09 at 12:54 -1000, Daniel Kolbo wrote: Daniel Kolbo wrote: What is the preferred method with php to test and see if a file [pattern] exists? For example, i only need to search in one directory, that may have any number of files named such as afile1.txt, afile2.txt,

Re: [PHP] file_exists and wildcard/regex

2008-12-09 Thread ceo
I'm not sure how glob works in the guts, but I know it is dog-slow for large numbers of files (or maybe just large numbers of results). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] file_exists and wildcard/regex

2008-12-09 Thread Per Jessen
[EMAIL PROTECTED] wrote: I'm not sure how glob works in the guts, but I know it is dog-slow for large numbers of files (or maybe just large numbers of results). I'm not sure what the context of this was, but the speed of searching a directory with a large number of files, e.g. 100,000s,

Re: [PHP] file_exists and wildcard/regex

2008-12-09 Thread Per Jessen
Ashley Sheridan wrote: If you're on a Linux system, you could look at ls and the regular expressions it lets you use with it. You could exec out and get the returned results. Also, as it's a system call, it should be very speedy. 'ls' is just a plain binary (/bin/ls), not a system call. The

Re: [PHP] file_Exists() and case

2008-11-23 Thread Craige Leeder
Stan wrote: If $basePicture = ../pictures/2008 west coast trip/2008-06-10 first week at Chris'/DSC_0011.jpg and the file actually is ../pictures/2008 west coast trip/2008-06-10 first week at Chris'/DSC_0011.JPG (uppercase extension) the following snippet of code

Re: [PHP] file_Exists() and case

2008-11-23 Thread Ashley Sheridan
On Sun, 2008-11-23 at 12:24 -0500, Craige Leeder wrote: Stan wrote: If $basePicture = ../pictures/2008 west coast trip/2008-06-10 first week at Chris'/DSC_0011.jpg and the file actually is ../pictures/2008 west coast trip/2008-06-10 first week at Chris'/DSC_0011.JPG (uppercase

Re: [PHP] file_Exists() and case

2008-11-23 Thread Nathan Rixham
Stan wrote: The script is running on an UBUNTU v8.04 LAMP server. Case is supposed to matter, isn't it? out of interest try putting clearstatcache() before if(!file_Exists($basePicture)) ps.. sure it should be file_exists all lowercase - perhaps you're choosing to use call the function

Re: [PHP] file_exists() not working correctly?

2008-08-25 Thread Chris
Chris Haensel wrote: Good morning list, I have a _very_ simple function... it is as follows /**/ function getgalimage($fzg) { $folder = bilder; $imgname= $fzg._1.JPG; $checkimg =

Re: [PHP] file_exists() not working correctly?

2008-08-25 Thread Carlos Medina
Chris schrieb: Chris Haensel wrote: Good morning list, I have a _very_ simple function... it is as follows /**/ function getgalimage($fzg) { $folder=bilder; $imgname=$fzg._1.JPG; $checkimg=$folder./.$imgname;

Re: [PHP] file_exists() not working correctly?

2008-08-25 Thread Chris
That worked like a charm. Now, can you tell me why that exact same function works with a relative path on another server and with a full path only on this server? I am glad that it works, but would also like to understand why :o) Could be different document roots for apache, different

RE: [PHP] file_exists() not working correctly?

2008-08-25 Thread Per Jessen
Chris Haensel wrote: That worked like a charm. Now, can you tell me why that exact same function works with a relative path on another server and with a full path only on this server? I am glad that it works, but would also like to understand why Check the working directory as well as the

RE: [PHP] file_exists() not working correctly?

2008-08-25 Thread Chris Haensel
-:- -Original Message- -:- From: Chris [mailto:[EMAIL PROTECTED] -:- Sent: Monday, August 25, 2008 9:25 AM -:- To: Chris Haensel -:- Cc: php-general@lists.php.net -:- Subject: Re: [PHP] file_exists() not working correctly? -:- -:- Chris Haensel wrote: -:- Good morning list

RE: [PHP] file_exists() not working correctly?

2008-08-25 Thread Chris Haensel
-:- -Original Message- -:- From: Chris [mailto:[EMAIL PROTECTED] -:- Sent: Monday, August 25, 2008 9:49 AM -:- To: Chris Haensel -:- Cc: php-general@lists.php.net -:- Subject: Re: [PHP] file_exists() not working correctly? -:- -:- -:- That worked like a charm. Now, can you tell

Re: [PHP] file_exists

2007-11-16 Thread Stut
tedd wrote: At 11:06 PM + 11/15/07, Stut wrote: The realpath function will reduce your definition of $page to /home/evil-user-home-dir/evil-payload.php $expecteddir is set to /home/stut/phpstuff/inc The if takes the first strlen($expecteddir) characters of the reduced $page and compares

Re: [PHP] file_exists

2007-11-16 Thread tedd
At 2:45 PM + 11/16/07, Stut wrote: It also worth noting that what you're doing there is quite inefficient. I have a similar arrangement where I have a directory containing the include files, but I locate it in a different way. Most sites I deal with have an auto-prepended file containing

Re: [PHP] file_exists

2007-11-16 Thread tedd
At 11:06 PM + 11/15/07, Stut wrote: The realpath function will reduce your definition of $page to /home/evil-user-home-dir/evil-payload.php $expecteddir is set to /home/stut/phpstuff/inc The if takes the first strlen($expecteddir) characters of the reduced $page and compares it to

Re: [PHP] file_exists

2007-11-15 Thread Stut
Instruct ICC wrote: Date: Thu, 15 Nov 2007 00:20:52 + From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: php-general@lists.php.net Subject: Re: [PHP] file_exists Philip Thompson wrote: I've run into similar problems where I *thought* I was looking in the correct location... but I wasn't

Re: [PHP] file_exists

2007-11-15 Thread Philip Thompson
On Nov 15, 2007 7:16 AM, Stut [EMAIL PROTECTED] wrote: Instruct ICC wrote: Date: Thu, 15 Nov 2007 00:20:52 + From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: php-general@lists.php.net Subject: Re: [PHP] file_exists Philip Thompson wrote: I've run into similar problems

RE: [PHP] file_exists

2007-11-15 Thread Instruct ICC
Date: Thu, 15 Nov 2007 13:16:46 + From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: php-general@lists.php.net Subject: Re: [PHP] file_exists Instruct ICC wrote: Date: Thu, 15 Nov 2007 00:20:52 + From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: php-general

RE: [PHP] file_exists

2007-11-15 Thread Instruct ICC
No, you've missed the point. $expecteddir is a fixed variable that you, the script author, specify. It does not contain anything coming from external veriables. You then compare the full path you build from the external variables to $expecteddir to verify that the file is in the

Re: [PHP] file_exists

2007-11-15 Thread Stut
Instruct ICC wrote: No, you've missed the point. $expecteddir is a fixed variable that you, the script author, specify. It does not contain anything coming from external veriables. You then compare the full path you build from the external variables to $expecteddir to verify that the file is

Re: [PHP] file_exists

2007-11-15 Thread Stut
Instruct ICC wrote: Date: Thu, 15 Nov 2007 13:16:46 + From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: php-general@lists.php.net Subject: Re: [PHP] file_exists Instruct ICC wrote: Date: Thu, 15 Nov 2007 00:20:52 + From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: php-general

RE: [PHP] file_exists

2007-11-15 Thread Instruct ICC
My server is down right now so I can't do my usual example script. A likely story. Just kidding. Stut, YOU WERE RIGHT, AND I WAS WRONG. Your code is golden. _ Help yourself to FREE treats served up daily at the Messenger Café.

RE: [PHP] file_exists

2007-11-15 Thread Instruct ICC
Something like the following would be much better (untested)... $page = realpath(dirname(__FILE__).'/inc/'.$_GET['page'].'.php'); $expecteddir = realpath(dirname(__FILE__).'/inc'); if (substr($page, 0, strlen($expecteddir)) != $expecteddir) { // Ideally return a 403 status here

Re: [PHP] file_exists

2007-11-15 Thread Stut
Instruct ICC wrote: Something like the following would be much better (untested)... $page = realpath(dirname(__FILE__).'/inc/'.$_GET['page'].'.php'); $expecteddir = realpath(dirname(__FILE__).'/inc'); if (substr($page, 0, strlen($expecteddir)) != $expecteddir) { // Ideally return a 403

Re: [PHP] file_exists

2007-11-14 Thread Ronald Wiplinger
Chris wrote: Ronald Wiplinger wrote: I am having troubles with the function file_exists() I tried the full path like: if (file_exists('/srv/www/../images/pic412.jpg') { echo IMG SRC='images/pic412.jpg'; } else { echo nbsp; //picture is missing! } No

Re: [PHP] file_exists

2007-11-14 Thread Chris
Ronald Wiplinger wrote: Chris wrote: Ronald Wiplinger wrote: I am having troubles with the function file_exists() I tried the full path like: if (file_exists('/srv/www/../images/pic412.jpg') { echo IMG SRC='images/pic412.jpg'; } else { echo nbsp; //picture

Re: [PHP] file_exists

2007-11-14 Thread Philip Thompson
On Nov 14, 2007 5:04 PM, Chris [EMAIL PROTECTED] wrote: Ronald Wiplinger wrote: Chris wrote: Ronald Wiplinger wrote: I am having troubles with the function file_exists() I tried the full path like: if (file_exists('/srv/www/../images/pic412.jpg') { echo IMG

RE: [PHP] file_exists

2007-11-14 Thread Warren Vail
if (file_exists('/srv/www/../images/pic412.jpg') { Two left parens, one right, surprised you don't get a syntax error? Warren Vail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] file_exists

2007-11-14 Thread Stut
Philip Thompson wrote: I've run into similar problems where I *thought* I was looking in the correct location... but I wasn't. Take this for example ?php // index.php?page=hello/hi $page = $_GET['page']; if (file_exists ($page.php)) { include ($page.php); } ? I really hope this is not

RE: [PHP] file_exists

2007-11-14 Thread Instruct ICC
Date: Thu, 15 Nov 2007 00:20:52 + From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: php-general@lists.php.net Subject: Re: [PHP] file_exists Philip Thompson wrote: I've run into similar problems where I *thought* I was looking in the correct location... but I wasn't. Take

Re: [PHP] file_exists

2007-11-14 Thread Ronald Wiplinger
Stut wrote: Philip Thompson wrote: I've run into similar problems where I *thought* I was looking in the correct location... but I wasn't. Take this for example ?php // index.php?page=hello/hi $page = $_GET['page']; if (file_exists ($page.php)) { include ($page.php); } ? I

Re: [PHP] file_exists - this part is of topic

2007-11-14 Thread Ronald Wiplinger
Instruct ICC wrote: Called like this? index.php?page=http://evil-hacker-site.com/evil-payload.php And the browser will probably url_encode for me if needed. _ Climb to the top of the charts! Play Star Shuffle: the word

Re: [PHP] file_exists

2007-11-14 Thread William Betts
Ronald Wiplinger wrote: Stut wrote: Philip Thompson wrote: I've run into similar problems where I *thought* I was looking in the correct location... but I wasn't. Take this for example ?php // index.php?page=hello/hi $page = $_GET['page']; if (file_exists ($page.php)) {

Re: [PHP] file_exists

2007-11-13 Thread Jim Lucas
Ronald Wiplinger wrote: I am having troubles with the function file_exists() I tried the full path like: you are missing a closing parenthesis on your condition if (file_exists('/srv/www/../images/pic412.jpg') ) { if (file_exists('/srv/www/../images/pic412.jpg') { echo IMG

Re: [PHP] file_exists

2007-11-13 Thread Chris
Ronald Wiplinger wrote: I am having troubles with the function file_exists() I tried the full path like: if (file_exists('/srv/www/../images/pic412.jpg') { echo IMG SRC='images/pic412.jpg'; } else { echo nbsp; //picture is missing! } No matter if I use the

Re: [PHP] file_exists, is_readable effective UID/GID

2007-10-25 Thread Manuel Vacelet
On 10/24/07, Jim Lucas [EMAIL PROTECTED] wrote: Daniel Brown wrote: On 10/24/07, Manuel Vacelet [EMAIL PROTECTED] wrote: Hi all, file_exists and is_readable perfom there test with real UID/GID. Is there any functions that tests file existance with effective UID/GID ? Note: stat is

Re: [PHP] file_exists, is_readable effective UID/GID

2007-10-24 Thread Daniel Brown
On 10/24/07, Manuel Vacelet [EMAIL PROTECTED] wrote: Hi all, file_exists and is_readable perfom there test with real UID/GID. Is there any functions that tests file existance with effective UID/GID ? Note: stat is not an option because it raises an E_WARNING if the file is not readable.

Re: [PHP] file_exists, is_readable effective UID/GID

2007-10-24 Thread Jim Lucas
Daniel Brown wrote: On 10/24/07, Manuel Vacelet [EMAIL PROTECTED] wrote: Hi all, file_exists and is_readable perfom there test with real UID/GID. Is there any functions that tests file existance with effective UID/GID ? Note: stat is not an option because it raises an E_WARNING if the file is

Re: [PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Edward Vermillion
On Jun 18, 2007, at 3:30 PM, Myron Turner wrote: I've written a plugin for DokuWiki which uses the following DokuWiki function for reading files: function io_readFile($file,$clean=true){ $ret = ''; if(@file_exists($file)){ if(substr($file,-3) == '.gz'){ $ret =

Re: [PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Myron Turner
Edward Vermillion wrote: On Jun 18, 2007, at 3:30 PM, Myron Turner wrote: I've written a plugin for DokuWiki which uses the following DokuWiki function for reading files: function io_readFile($file,$clean=true){ $ret = ''; if(@file_exists($file)){ if(substr($file,-3) == '.gz'){ $ret =

Re: [PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Jim Lucas
Myron Turner wrote: I've written a plugin for DokuWiki which uses the following DokuWiki function for reading files: function io_readFile($file,$clean=true){ $ret = ''; if(@file_exists($file)){ if(substr($file,-3) == '.gz'){ $ret = join('',gzfile($file));

Re: [PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Daniel Brown
On 6/18/07, Jim Lucas [EMAIL PROTECTED] wrote: First off, don't jack someone else's thread. Am I not getting all of the list messages today? I didn't see where the thread hijacking occurred -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General

Re: [PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Myron Turner
Jim Lucas wrote: First off, don't jack someone else's thread. Secondly, I think it might have something to do with the space in the file name. Try changing all spaces to %20 and see what happens. $string = str_replace(' ', '%20', $string); should do the trick -- Jim Lucas Some men

Re: [PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Jim Lucas
Daniel Brown wrote: On 6/18/07, Jim Lucas [EMAIL PROTECTED] wrote: First off, don't jack someone else's thread. Am I not getting all of the list messages today? I didn't see where the thread hijacking occurred -- Jim Lucas Some men are born to greatness, some achieve

Re: [PHP] file_exists, Windows, and EasyPHP

2007-06-18 Thread Daniel Brown
On 6/18/07, Jim Lucas [EMAIL PROTECTED] wrote: Daniel Brown wrote: On 6/18/07, Jim Lucas [EMAIL PROTECTED] wrote: First off, don't jack someone else's thread. Am I not getting all of the list messages today? I didn't see where the thread hijacking occurred -- Jim Lucas Some

Re: [PHP] file_exists() behind firewall

2006-06-17 Thread Ahmed Saad
On 17/06/06, Richard Lynch [EMAIL PROTECTED] wrote: I dunno if AJAX will let you quit partway through, but you could definitely do this with the lean and mean hand-coded XmlHttpRequest object and sending HEAD to see if the URL is there or not. For security reasons, an XMLHttpRequest objects

Re: [PHP] file_exists() behind firewall

2006-06-16 Thread tedd
At 7:57 AM +0100 6/16/06, George Pitcher wrote: Hi, I have several websites that are using a common set of pages (to reduce maintenance, development and upgrading) and use configuration files to give the customer the feeling that it is their own unique site. The customers are all universities and

Re: [PHP] file_exists() behind firewall

2006-06-16 Thread Richard Lynch
I dunno if AJAX will let you quit partway through, but you could definitely do this with the lean and mean hand-coded XmlHttpRequest object and sending HEAD to see if the URL is there or not. It will fail, of course, if they run this app from home or anything not behind the firewall. On Fri,

RE: [PHP] file_exists() to search for *.xml file with a wild card???

2004-07-20 Thread Jay Blanchard
[snip] I would like to use the file_exists() or something similar to check for the existance of any of the xml files regardless of what filename it use. Like file_exist(*.xml) for example. Anyone know?? [/snip] Nope, no wildcard. You can only check for a specific file. -- PHP General

Re: [PHP] file_exists() to search for *.xml file with a wild card???

2004-07-20 Thread John W. Holmes
Scott Fletcher wrote: I would like to use the file_exists() or something similar to check for the existance of any of the xml files regardless of what filename it use. Like file_exist(*.xml) for example. Anyone know?? Try glob() -- ---John Holmes... Amazon Wishlist:

Re: [PHP] file_exists() to search for *.xml file with a wild card???

2004-07-20 Thread Philip Olson
I would like to use the file_exists() or something similar to check for the existance of any of the xml files regardless of what filename it use. Like file_exist(*.xml) for example. Anyone know?? You may use glob(), http://www.php.net/glob Regards, Philip -- PHP General Mailing

Re: [PHP] file_exists() to search for *.xml file with a wild card???

2004-07-20 Thread Matt M.
I would like to use the file_exists() or something similar to check for the existance of any of the xml files regardless of what filename it use. Like file_exist(*.xml) for example. Anyone know?? http://us3.php.net/readdir ?php if ($handle = opendir('/path/to/files')) { while

Re: [PHP] file_exists() to search for *.xml file with a wild card???

2004-07-20 Thread Scott Fletcher
I like this one, the readdir() function. It look very promising. Thanks! Scott F. Matt M. [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I would like to use the file_exists() or something similar to check for the existance of any of the xml files regardless of what filename it

Re: [PHP] File_exists result cached over a session?

2004-05-16 Thread Marek Kilimajer
Steve Magruder - WebCommons.org wrote: File_exists results (and the results from other file-related functions) are cached (according to the php doc) during the run of a script. For instance, if file_exists returns True for a file once, it won't actually test the file again if file_exists is run

Re: [PHP] File_exists result cached over a session?

2004-05-16 Thread Steve Magruder - WebCommons.org
Marek Kilimajer wrote: Steve Magruder - WebCommons.org wrote: File_exists results (and the results from other file-related functions) are cached (according to the php doc) during the run of a script. For instance, if file_exists returns True for a file once, it won't actually test the file

Re: [PHP] file_exists on different server...

2003-09-30 Thread Jason Wong
On Tuesday 30 September 2003 19:00, [EMAIL PROTECTED] wrote: I'm referencing an image on a different server, and it keeps changing URL's Very odd, but t get round that, I tried... if (file_exists(http://www.othersite.com/image_1.gif;)) {

Re: [PHP] file_exists on different server...

2003-09-30 Thread Tristan . Pretty
RTFM? (Sorry, very newbie question) Jason Wong [EMAIL PROTECTED] 30/09/2003 12:26 Please respond to [EMAIL PROTECTED] To [EMAIL PROTECTED] cc Subject Re: [PHP] file_exists on different server... On Tuesday 30 September 2003 19:00, [EMAIL PROTECTED] wrote: I'm referencing an image

Re: [PHP] file_exists on different server...

2003-09-30 Thread David T-G
Tristan -- ...and then [EMAIL PROTECTED] said... % % RTFM? % (Sorry, very newbie question) Sort of, yes :-) See The Jargon File at http://catb.org/esr/jargon/ or jump straight to How To Ask Questions The Smart Way http://www.catb.org/~esr/faqs/smart-questions.html for not only a

Re: [PHP] file_exists() question

2003-03-08 Thread Jim Lucas
what does $annrow[id] return? I HAVE found that I have to refer to a file when using file_exists() from / so file_exists(/path/to/me/cherpdocs/filename.doc) for it to work right. Jim - Original Message - From: Charles Kline [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, March

Re: [PHP] file_exists() question

2003-03-08 Thread Khalid El-Kary
because you can't directly use the $annrow[id] within single quotes, you should use double quotes to do so. file_exists(cherpdocs/$annrow[id].doc) or file_exists('cherpdocs/'.$annrow[id].'.doc') or file_exists(cherpdocs/.$annrow[id]..doc) Note: i heared it's prefered to always use the .

Re: [PHP] file_exists() question

2003-03-08 Thread Jason Sheets
You will probably need to use file_exists(cherpdocs/{$annrow['id']}.doc) you could also use file_exists('cherpdocs/' . $annrow['id'] . '.doc') You should use single quotes to identify your element in an array, otherwise PHP will try to use it as a constant first. Jason On Sat, 2003-03-08 at

Re: [PHP] file_exists() question

2003-03-08 Thread Ernest E Vogelsinger
At 22:40 08.03.2003, Khalid El-Kary said: [snip] because you can't directly use the $annrow[id] within single quotes, you should use double quotes to do so. file_exists(cherpdocs/$annrow[id].doc) or file_exists('cherpdocs/'.$annrow[id].'.doc') or

Re: [PHP] file_exists() question

2003-03-08 Thread Justin French
on 09/03/03 8:10 AM, Charles Kline ([EMAIL PROTECTED]) wrote: if(file_exists('cherpdocs/$annrow[id].doc')){ echo br /a href=\cherpdocs/$annrow[id].doc\Funding details paper/a; } This is a pretty simple debugging type query, so: First things first, make sure that $annrow[id] is what you

Re: [PHP] file_exists()

2002-06-26 Thread Neil Freeman
You're right - the example is wrong. Neil Anthony Ritter wrote: ** This Message Was Virus Checked With : SAVI 3.58 May 2002 Last Updated 14th June 2002

RE: [PHP] file_exists

2002-05-07 Thread Stuart Dallas
On 6 May 2002 at 20:30, Craig Westerman wrote: File is on another server. Is there a way to check if file exists on another server? I wrote the following function a while ago to do this. It works with http URLs and should also work with https and ftp, but I have only tested http. I hope it's

RE: [PHP] file_exists

2002-05-06 Thread Craig Westerman
I found my problem. From manual: file_exists() will not work on remote files; the file to be examined must be accessible via the server's filesystem. File is on another server. Is there a way to check if file exists on another server? Craig [EMAIL PROTECTED] -Original Message-

Re: [PHP] file_exists

2002-05-06 Thread Austin Marshall
Craig Westerman wrote: I found my problem. Try fopen() if it fails it will return false, otherwise it will return an integer file pointer. You get use it to fetch files via http://, https://, ftp://, and more. From manual: file_exists() will not work on remote files; the file to be

RE: [PHP] file_exists

2002-05-06 Thread Jonathan Rosenberg
Does fopen() actually work for https connections? I thought this implementation was not yet released. -Original Message- From: Austin Marshall [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 9:40 PM To: Craig Westerman Cc: php-general-list Subject: Re: [PHP] file_exists

Re: [PHP] file_exists

2002-05-06 Thread Miguel Cruz
On Mon, 6 May 2002, Craig Westerman wrote: What am I doing wrong? I get parse error between first echo statement and else. ?php $fn = image.gif; if (!file_exists($fn)) { echo img src=noimageexists.gif; else echo img src=$fn; } ? You open the brace for the positive branch of the if

RE: [PHP] file_exists

2002-05-06 Thread Rasmus Lerdorf
Westerman Cc: php-general-list Subject: Re: [PHP] file_exists Craig Westerman wrote: I found my problem. Try fopen() if it fails it will return false, otherwise it will return an integer file pointer. You get use it to fetch files via http://, https://, ftp://, and more

Re: [PHP] file_exists problems

2001-12-01 Thread Prolog
I've since tried that also. It too seems to return the same error. I'm curious if the file_exists can't use relative positionslike it has to be in the same folder or you have to use the whole line like c:\ I'm working on a box that isn't mine of the net...if that's the case I don't

Re: [PHP] file_exists problems

2001-11-30 Thread faeton
Hello Prolog, Hm... And what about: print 'img src=/images/$filename'; instead of readfile? P if(file_exists(/images/$filename)) P { P readfile(/images/$filename); P } P else P { P readfile(images/npat.jpg); P } Ivan 'Faeton aka

Re: [PHP] file_exists bug?

2001-08-06 Thread Rasmus Lerdorf
As documented: http://php.net/clearstatcache -Rasmus On Mon, 6 Aug 2001, Ken Williams wrote: Am I an idiot? (View this message as text) html body ? $bIsFileOne = is_file(/tmp/test.txt); # Will be true cause test.txt will exist sleep (5); # Sleep while you telnet in and remove

Re: [PHP] file_exists with remote file???

2001-04-23 Thread J. Jones
On Tue, Apr 24, 2001 at 12:20:01AM -0300, Paulo - Bruc Internet wrote: Can anyone help me? The sintax of function file_exists is: if(file_exists(t.txt)) { print... } Does anybody knows how can work with remote files? This is not working:

Re: [PHP] File_exists function question.

2001-02-16 Thread Ben Peter
Gerry, the following is your problem: you fetch a row from the query result in each iteration: while ($row = mysql_fetch_array($sql_result)) { and the use the value of $ID. $fn = "/images/$ID.jpg"; you need to fetch the value of the ID column into the ID variable before. Assuming your select

Re: [PHP] File_exists function question.

2001-02-15 Thread Ben Peter
Gerry, could you give us a bit more code, esp. the while or for loop that surrounds the code you have quoted? Cheers, Ben Gerry wrote: Hello everyone: I'm trying to build a table with the last row being a check function for an image, where it checks if the item image exists in the

Re: [PHP] File_exists function question.

2001-02-15 Thread Gerry
Hello again: Ben Peter wrote: Gerry, could you give us a bit more code, esp. the while or for loop that surrounds the code you have quoted? Cheers, Ben Sorry for the confusion, and yes I did mispelled camera in english. Here is more of my sloppy code. I might have an extra }...not

Re: [PHP] file_exists search the include_path?

2001-01-25 Thread John Donagher
It doesn't. Some of the file-related functions have that capability and some don't. This may be what you're looking for: function file_exists_in_path($file) { foreach(split(':', ini_get('include_path')) as $dir) { if ($dir[sizeof($dir)-1] != '/') {