rebuilder Posted September 27, 2010 Report Share Posted September 27, 2010 (edited) Laba diena, šodien saskāros ar tādu dīvainu un neierastu lietu. Ir html forma un pie action norādīts <?php echo $PHP_SELF;?> . Visa lapa tiek includota caur index failu, respektīvi, ja parādās $_GET['pamparam'] tiek includoti attiecīgās sadaļas faili. Uz nano.lv servera vis darbojās lieliski, form action nostrādā, bet uz viena cita, pat nezinu, privāta vai nē, servera ar <?php echo $PHP_SELF;?> pie form action, apskatot source parādās action="index.php"... Mēģināju arī šo variantu <?php echo $_SERVER['PHP_SELF']; ?> bet parādās tas pats action="index.php" un no formas nekas nenonāk datubāzē, varbūt kāds apgaismos, kur vaina? Vienīgā ideja, kas man ir, likt pie form action tiešo lapas adresi, respektīvi apmēram kaut kā šādi: "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; bet nu nezinu cik tas ir racionāli vai nē. Edited September 27, 2010 by rebuilder Quote Link to comment Share on other sites More sharing options...
marrtins Posted September 27, 2010 Report Share Posted September 27, 2010 Viss pareizi, nez, kas tur Tev varēja darboties... Atstāj action tukšu, t.i., action="" Quote Link to comment Share on other sites More sharing options...
Kemito Posted September 27, 2010 Report Share Posted September 27, 2010 Es vienmēr vismaz formā action atstāju tukšu :) Quote Link to comment Share on other sites More sharing options...
briedis Posted September 27, 2010 Report Share Posted September 27, 2010 Es vienmēr vismaz formā action atstāju tukšu :) Protams, ja nav svarīgi padot get mainīgos, kā piemēram: <form action="?sadala=komentari"> Quote Link to comment Share on other sites More sharing options...
Val Posted September 27, 2010 Report Share Posted September 27, 2010 iz php manuāļa komentāriem. Note the manual entry for PHP_SELF states the following: "The filename of the currently executing script, relative to the document root. For instance, $_SERVER['PHP_SELF'] in a script at the address http://example.com/test.php/foo.bar would be /test.php/foo.bar." However I did some vigorous testing on three different machines and this note is not always true. The results are given below: Given a URL of http://www.example.com/Info.php/Page/Home Apache 2.2.4/Win32/PHP 5.2.2/Apache 2.0 Handler ----> PHP_SELF = Info.php/Page/Home Apache 1.3.37/Unix/PHP 5.2.2/CGI ----> PHP_SELF = Info.php Apache 1.3.33/Unix/5.1.4/FastCGI ----> PHP_SELF = Info.php Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.