PHP.exe error (3)
|
May 25, 2005
|
If you have problems running some PHP scripts, don't give up hope. I've been having some problems with some things, and I just recently figured out the solution. If the script references itself, it may be doing it incorrectly. For example, in the webadmin.php script, there's a variable called $self , and there's a little piece of code that defines it:if (!empty($_SERVER['SCRIPT_NAME'])) { $self = html(basename($_SERVER['SCRIPT_NAME'])); } elseif (!empty($_SERVER['PHP_SELF'])) { $self = html(basename($_SERVER['PHP_SELF'])); } else { $self = ''; }
The problem occurs when I click on a link in the file and it calls .../php.exe?action=... . I'm not sure why this happens, but either way, you can fix it by defining $self = $_SERVER['PHP_SELF']; . That way, each time the code calls itself, it calls the right thing (its file name), not some sort of php.exe thing. I've seen this in a few other scripts, and the same fix has worked each time. #technology
|
Comments:
2007-12-26 23:42:15
what bugs me most about PHP (among other things, and unrelated to what you are saying.. sorry about that) is that PHP is a recursive initialism for PHP: Hypertext Preprocessor. All these years, and it still bugs me.
2007-12-28 12:50:35
I always figure it means Pre-Hypertext Processor. Lying to myself helps me get through the day.
2007-12-28 17:57:31
I hate abbreviations like that.. gets your faith off of the meaning of life. Some things should always be the same.. don't you think?
Btw.. merry christmas and happy new year to you guys! Did anything fun?
|