faqts : Computers : Programming : Languages : PHP : Common Problems : Forms and User Input : URLs and Post or Get Methods

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

5 of 11 people (45%) answered Yes
Recently 3 of 8 people (38%) answered Yes

Entry

Why do I get a "Not Found" error when my php script contains a <? echo $PHP_SELF ?>. This happens on my hosting service but not locally.

Apr 23rd, 2002 17:49
Paul Stevens, Guillermo Sobalvarro,


File extensions for your scripst were .html.  Your hosting service
requires they be .php and .phtml for them to work.  Since you can't edit
the hosting services' Apache httpd.conf file, rename your scripts to the
above.

NEW ANSWER:
The above answer may work, however something critical that I noticed
about your script of <? echo $PHP_SELF ?> is the ";" that should be at
the end of the statement. It should read <? echo $PHP_SELF; ?>.  The
semicolon; needs to be at the end of each of your statements. Now as far
as the statement goes, If that is the only code that you have in your
page, there really is no "$PHP_SELF" page to echo. Typically the use for
the $PHP_SELF variable is when posting a form. <form value="<?php
$PHP_SELF; ?> action="POST">. I hope this helps.