Oh, I accidently typed PHP_INFO, but I DID USE PHP_SELF, with and without a dollar sign, and none worked. I tried the same with PATH_INFO.
But I will check out the manual first :) /Gabbah "Luis Moreira" <[EMAIL PROTECTED]> skrev i meddelandet news:[EMAIL PROTECTED] > Gabriel, > > Try reading the manuals at http://www.php.net > They are a good source of info, always, to start with. > > PHP_SELF and PATH_INFO are variables, and as such must have a dollar sign. > Your error messages implies you did not put that sign. > Furthermore, you complain about PHP_SELF and PATH_INFO and the messages > refers to PHP_INFO, wich is a function, therefore needing "()" at the end > > From the manual pages (function EXPLODE splits a string based on a > separator) an example I DID NOT TRY myself : > > if(isset($PATH_INFO)) { > $viewcode = explode('/', $PATH_INFO); > $num = count($viewcode); > if($num % 2 == 0) { > $viewcode[] = ''; > $num++; > } > for($i = 1; $i < $num; $i += 2) { > > $$viewcode[$i] = $viewcode[$i+1]; > > } > } > > Luis > ----- Original Message ----- From: "Gabriel_k" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, July 17, 2003 11:03 PM > Subject: Re: [PHP-WIN] Re: Newbie Q > > > > Hey man, I tried using PHP_SELF and PATH_INFO, but they both got this > error > > message: > > > > Notice: Use of undefined constant PHP_INFO - assumed 'PHP_INFO' in > > C:\Fedde\Share\Bilder- Resa\Tyskland-Alemania\Tisdag-Martes\Index.php on > > line 46 > > > > > > I found path_info when using phpinfo(), but not php_info. > > What am I doing wrong? > > > > /Gabbah > > > > "H Marc Bower" <[EMAIL PROTECTED]> skrev i meddelandet > > news:[EMAIL PROTECTED] > > > Well, if you want the path as far as the website is concerned, use > > > dirname($PHP_SELF). If you want the absolute file system path, use > > > getcwd(). > > > > > > Example: > > > > > > Files located on server at > > > D:\wwwroot\files\uploads\here > > > By website address at: > > > http://yourserver.com/files/uploads/here > > > File being accessed: > > > http://yourserver.com/files/uploads/here/file.php > > > > > > <?php > > > $title = dirname($PHP_SELF); > > > ?> > > > > > > This will set $title to > > > /files/uploads/here > > > > > > <?php > > > $title = getcwd(); > > > ?> > > > > > > This will set $title to > > > D:\wwwroot\files\uploads\here > > > > > > Depends on what value you actually want to use. > > > > > > (V) > > > > > > ----- Original Message ----- > > > From: "Gabriel_k" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Wednesday, July 16, 2003 8:18 AM > > > Subject: Re: [PHP-WIN] Re: Newbie Q > > > > > > > > > > Well, I want my php script to put the TITLE of a html page to the name > > of > > > > the directory the script is in. > > > > > > > > /Gabbah > > > > > > > > "H Marc Bower" <[EMAIL PROTECTED]> skrev i meddelandet > > > > news:[EMAIL PROTECTED] > > > > > Um... the file in which you put that command should be there... :) > > > > > > > > > > What is the purpose for knowing the directory name? Maybe there is > > > > > something else you can tell us that will get you the answer you're > > > looking > > > > > for. > > > > > > > > > > (V) > > > > > > > > > > ----- Original Message ----- > > > > > From: "Gabriel_k" <[EMAIL PROTECTED]> > > > > > > What if there is no file? > > > > > > "Heyz" <[EMAIL PROTECTED]> skrev i meddelandet > > > > > > > It's simple. > > > > > > > > > > > > > > dirname(__FILE__) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > PHP Windows Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php