file which tries to find itself and can't...



<?
//file test.php
phpinfo();

$filename = "test.php"; //it does not work

$filename =
$_SERVER['DOCUMENT_ROOT']."/home/ke000067/public_html/test.php"; //it
does not work

$filename =
$_SERVER['DOCUMENT_ROOT']."/~ke000067/public_html/test.php"; //it
does not work

$filename = "home/ke000067/public_html/test.php"; //it does not
work

echo 'fila buscada: '.$filename.'<br>';

if (file_exists($filename)) {
echo 'Of course it is.<br>';
}else{
echo 'What?? How can it be???.<br>';
}

?>


these are some values retieved from phpinfo
_ENV["REMOTE_PORT"] 2010
_ENV["SCRIPT_FILENAME"] /home/ke000067/public_html/test.php
_ENV["SCRIPT_URI"] http://200.50.110.233/~ke000067/test.php
_ENV["SCRIPT_URL"] /~ke000067/test.php
_ENV["SERVER_ADDR"] 200.50.110.233
_ENV["SERVER_NAME"] 200.50.110.233
_ENV["SERVER_PORT"] 80
_ENV["SERVER_SIGNATURE"] <ADDRESS>Apache/1.3.33 Server at
200.58.112.233 Port 80</ADDRESS>
_ENV["SERVER_SOFTWARE"] Apache/1.3.33 (Unix) mod_auth_passthrough/1.8
mod_bwlimited/1.4 mod_log_bytes/1.2 mod_ssl/2.8.22 OpenSSL/0.9.7e
FrontPage/5.0.2.2635
_ENV["GATEWAY_INTERFACE"] CGI/1.1
_ENV["SERVER_PROTOCOL"] HTTP/1.1
_ENV["REQUEST_METHOD"] GET
_ENV["REQUEST_URI"] /~ke000067/test.php
_ENV["SCRIPT_NAME"] /~ke000067/test.php
_ENV["PATH_TRANSLATED"] /home/ke000067/public_html/test.php


I'm really confused about paths. Now I think that it is not a good idea
to learn on local server, beacause whenever one changes to a shared
one, all seems to fail....

Any hints?

sdos - jm

.



Relevant Pages

  • Re: problems using awk in a bash program???
    ... > I'm fairly new to shell programming so this is hopefully just a simple ... > syntax error. ... Hints: ...
    (comp.unix.programmer)
  • Re: Code review: timeout in a shell script
    ... hints I came up with: ... It is a lot easier and more robust just to use Expect. ... echo "$2 finished before timeout " ... how can I make expect not to print "spawn whatever"? ...
    (comp.unix.shell)
  • Re: Problem with spaces in filenames in a script
    ... About the hints, I didn't say that I would prefer not to write auxiliary ... temporary files, sorry. ... Also, I already played with the IFS variable, but clearly in the wrong ... | then echo "$i" ...
    (comp.os.linux.misc)
  • Re: substring from string
    ... > Any hints on how I can do this? ... If your shell supports the syntax: ... $ echo $ ...
    (comp.unix.shell)