Preserved Topic: What's the PHP equivelant of DOCUMENT_URI? |
|
---|---|
Author | Thread |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 07-15-2001 06:39
I'm trying to determine the file name of a .php file from within that same php file (determine it's own file name). |
Nervous Wreck (II) Inmate From: Canada |
posted 07-15-2001 07:33
$PHP_SELF |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 07-15-2001 11:26
$PHP_SELF (variable) - The filename of the currently executing script, relative to the document root. If PHP is running as a command-line processor, this variable is not available. |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 07-15-2001 13:29
Oh, I hadn't read about basename() yet. That makes it easier. I was using: |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 07-15-2001 14:22
I don't know how your concept for that web site looks like, but I would suggest you to put all common parts of code as functions in one big library which you will include at the top of each file. Also, you don't need to use so many variables. Here's more compact version of that code: |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 07-16-2001 05:40
Ahhh...ok. I was trying to combine the different commands together, but couldn't quite get it. |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 07-16-2001 20:11 |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 07-16-2001 22:10
Aha! Sooner or later I would have needed to know that. |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 07-16-2001 23:33
Hey Pugzly |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
posted 07-16-2001 23:59
I like this one |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 07-17-2001 05:46
The first one was PHP for the World Wide Web - A Visual Quickstart Guide. It's by Larry Ullman and put out by Peachpit Press. I read most of the 267 pages. |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 07-17-2001 14:46
Thanks Pugzly and Bitdamaged for the book recommendations. There are so many of them on the subject, that I never really know which ones are worth purchasing. I'm much more comfortable buying them after a thumbs up from you guys. |
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 07-17-2001 16:12
Yeah, PHP docs are pretty good. In fact, if you go to http://www.php.net, you can download a Windows Help file version of the PHP manual. I love that. It makes looking up things SO much easier. |