You are here: how to reference other files? « All PHP « IT news, forums, messages
how to reference other files?

Posted by moriman on 11/25/05 01:36

Hi,

I'm having a problem referring to other files in my public_html directory Ώ

Below is a short script (test.php) to show the problem...

<?php
$filename1 = "c:\\\\xitami-25\\app\\public_html\\title.php";
$filename2 = "http://home/title.php";
$filename3 = "title.php";

echo "\n";
echo $filename1."\n";
if (file_exists($filename1)){echo "found it\n";}
else {echo "not found\n";}

echo $filename2."\n";
if (file_exists($filename2)){echo "found it\n";}
else {echo "not found\n";}

echo $filename3."\n";
if (file_exists($filename3)){echo "found it\n";}
else {echo "not found\n";}
?>

both the above test.php and the file it refers to, title.php are in the same
directory.
Running the above under dos gives the following results...

c:\\xitami-25\app\public_html\title.php
found it
http://home/title.php
not found
title.php
found it

Running it under windows gives this...

c:\\xitami-25\app\public_html\title.php
found it
http://home/title.php
not found
title.php
not found

the url for the test.php is http://home/test.php
how come it doesn't find either filename2 or 3?

under dos I'm running test.php from within it's own directory. It finds
filename1 and 3.

Can someone help me to understand what is happening here?

many thanks in advance,

mori

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация