Reply to Re: Problem with $PHP_SELF?

Your name:

Reply:


Posted by Schraalhans Keukenmeester on 03/29/07 22:54

strawberry wrote:
> On Mar 29, 7:30 pm, Schraalhans Keukenmeester <bitbuc...@invalid.spam>
> wrote:
>> strawberry wrote:
>>> On Mar 29, 6:44 pm, "strawberry" <zac.ca...@gmail.com> wrote:
>>>> On Mar 29, 5:01 pm, "J.O. Aho" <u...@example.net> wrote:
>>>>> strawberry wrote:
>>>>>> I recently moved a mysql database and its associated php scripts from
>>>>>> one machine to another.
>>>>>> Now, however, although no errors are displayed, some aspects of the
>>>>>> php interface no longer work properly.
>>>>>> I suspect the problem is connected with my use of $PHP_SELF within
>>>>>> some of the pages.
>>>>>> I replaced "$PHP_SELF" with "$_SERVER['PHP_SELF']" which (I think) is
>>>>>> more widely supported but the problem still persists. Is there some
>>>>>> aspect of my php configuration that I should look at with respect to
>>>>>> this kind of problem?
>>>>> If you are using CGI, then $_SERVER[] won't work, if you use ISS you may note
>>>>> have full functionality in $_SERVER[].
>>>>> As you don't tell anything about the web server, we can't be sure on what goes
>>>>> wrong.
>>>>> --
>>>>> //Aho
>>>> It's just a recent xampp installation on a windows xp machine - so an
>>>> apache web server.- Hide quoted text -
>>>> - Show quoted text -
>> Apart from your odd choice of quoting characters and lines, it could
>> help if you ran a test script with the get_defined_vars() function to
>> see what is or isn't available in your particular setup.
>>
>> See the php manual pages for details if you need more directions. If the
>> output makes no sense to you, you could post it here.
>>
>> Rgds
>> Sh.- Hide quoted text -
>>
>> - Show quoted text -
>
> Thanks for the response. get_defined_vars didn't seem to do anything.
> Perhaps I implemented it incorrectly. Anyway phpinfo() gives this.
> I've masked some of the information:
>
>
> PHP Variables
> _SERVER["PATH"] C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS
> \System32\Wbem;C:\Program Files\Symantec\pcAnywhere\;C:\Program Files
> \Microsoft SQL Server\80\Tools\Binn\
> _SERVER["System#####"] C:\WINDOWS
> _SERVER["COMSPEC"] C:\WINDOWS\system32\cmd.exe
> _SERVER["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
> _SERVER["WINDIR"] C:\WINDOWS
> _SERVER["SERVER_SIGNATURE"] <address>Apache/2.2.4 (Win32) DAV/2
> mod_ssl/2.2.4 OpenSSL/0.9.8d mod_autoindex_color PHP/5.2.1 Server at
> ##### Port 80</address>
> _SERVER["SERVER_SOFTWARE"] Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4
> OpenSSL/0.9.8d mod_autoindex_color PHP/5.2.1
> _SERVER["SERVER_NAME"] #####
> _SERVER["SERVER_ADDR"]#####
> _SERVER["SERVER_PORT"] #####
> _SERVER["REMOTE_ADDR"] #####
> _SERVER["DOCUMENT_#####"] C:/Program Files/xampp/htdocs
> _SERVER["SERVER_ADMIN"] ####@#####
> _SERVER["SCRIPT_FILENAME"] C:/Program Files/xampp/htdocs/phpinfo.php
> _SERVER["REMOTE_PORT"] 4892
> _SERVER["GATEWAY_INTERFACE"] CGI/1.1
> _SERVER["SERVER_PROTOCOL"] HTTP/1.1
> _SERVER["REQUEST_METHOD"] GET
> _SERVER["QUERY_STRING"] no value
> _SERVER["REQUEST_URI"] /phpinfo.php
> _SERVER["SCRIPT_NAME"] /phpinfo.php
> _SERVER["PHP_SELF"] /phpinfo.php
> [snap]
Well, $_SERVER['PHP_SELF'] appears to be populated, so that's a clue.
AFAIK on windows not every variable is available (compared to *nix).

You can use var_dump($var) to dump any variable's output.
var_dump($_SERVER) should tell you which server vars are available in
your script. (Lok up var_dump in the manual, and/or it's sibling
print_r() for details.

get_defined_vars() returns an array, so you could
var_dump(get_defined_vars()) and that should work, unless your PHP
version doesn't support the function, in which case it should throw an
error (unless error_reporting is switched off in php.ini). If you get
error messages when you make a simple typo, you should get one here as
well, if the func is unsupported.

But your PHP5.2.1 should definitely support all these functions.

[Back to original 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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация