Re: Re: Newbie Q
| From: | Gabriel_k | Date: | Sat, 19 Jul 2003 11:53:33 +0000 |
| Subject: | Re: Re: Newbie Q | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-20836@lists.php.net to get a copy of this message | ||
Yeah that worked fine :)
Thank you all!
/Gabbah
"Mike Jenck" <mp@jenck.net> skrev i meddelandet
news:20030718175136.67034.qmail@pb1.pair.com...
> try
> $_SERVER["PHP_SELF"]
>
>
>
> Mike
>
> "Gabriel_k" <gabriel_k@bredband.net> wrote in message
> news:20030718082734.96365.qmail@pb1.pair.com...
> > 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" <lamoreira@bes.pt> skrev i meddelandet
> > news:06ab01c34d05$04d37cd0$5a655080@D11342...
> > > 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"
<gabriel_k@bredband.net>
> > > To: <php-windows@lists.php.net>
> > > 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" <hmbower@cogeco.ca> skrev i meddelandet
> > > > news:000e01c34ba1$3b4596a0$0b01a8c0@canetix...
> > > > > 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" <gabriel_k@bredband.net>
> > > > > To: <php-windows@lists.php.net>
> > > > > 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" <hmbower@cogeco.ca> skrev i meddelandet
> > > > > >
> > > > > > news:002301c34b8e$51ca2f70$0a01a8c0@Zabadoo...
> > > > > > > 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" <gabriel_k@bredband.net>
> > > > > > > > What if there is no file?
> > > > > > > > "Heyz" <heyzinsh@hotmail.com> 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
> > > >
> > >
> >
> >
>
>