FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP Get script name?





wormhole.v2
I need some PHP script to get it's own name Confused ...

I mean like I have a cript called "thing.php" and I need it to retrieve it's own name, i.e. "thing" or even "thing.php"...

Can anyone help me?

Thanks.
wumingsden
wormhole.v2 wrote:
I need some PHP script to get it's own name Confused ...

I mean like I have a cript called "thing.php" and I need it to retrieve it's own name, i.e. "thing" or even "thing.php"...

Can anyone help me?

Thanks.


Could you explain it a little more ? Do you want to re-name a php script ? This is easier, just rename it on your desktop (you can also use DA/ cPanel to rename it too)
wormhole.v2
Ok let me clarify...

Let's say I've made a script called script.php.
What I want is a piece of code that will allow script.php to get it's own filename, in this case it would be 'script' or 'script.php'.

But I want this code to be aplicable to any page I put it in, you see?
So if I put it in index.html, it will return 'index' or 'index.html'.
Traveller
The usual way this would work, especially if you handle a form by having it call the same PHP file it's in, is to use:

$_SERVER['PHP_SELF']
wormhole.v2
Ok that woeks great thanks! Laughing
Related topics
Phoenix free PHP scripts
error in my PHP script
how can i make a php script for enter username and password?
Inserting data to MYSQL with a PHP script
Running a "Hello World" php script
[PHP] Running Cron Jobs Via PHP Script
Simple PHP script not working
PHP Script- How can we install it
I need a VERY simple php script
PHP Script needed
Logging systeem php script
array check box on php script using $_POST
PHP Script Needed for 250 frih$
php script for Changing file permissions & owner
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.