Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file_exists using URL

Status
Not open for further replies.

jamiejamie

Technical User
May 16, 2005
12
0
0
US
I have two webservers. One webserver checks to see if a file exists on the other webserver. The file does exist, but my code returns a value of false. Why? And, how can I get it to return True?


<?php
$filename2 = '
if (file_exists($filename2)) {
echo "The file $filename2 exists";
} else {
echo "The file $filename2 does not exist";
}
?>

Jamie Aaron
 
This Script Works!

<html>
<body>
<center>
PIRATE<p>
<?php
if (@fclose(@fopen(" "r"))) {
print 'File exists.';
$path1="}
else {
echo 'File does not exist.';
$path1="}
?>
<p>
<img src="<?php echo $path1 ?>" width="150">
</center>
</body>
</html>

Jamie Aaron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top