Re: [PHP-WIN] $PHP_SELF

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hey,

i use the var $PHP_SELF in a news board i have just finished. What i use it for is some people rename it from news.php to something like latest_news.php or anything else they want so in a form i use it like this
<FORM METHOD="Post" ACTION="<?Php echo $PHP_SELF; ?>?area=submit">
that will then print the following into the page code
<FORM METHOD="Post" ACTION="news.php?area=submit">


The $PHP_SELF is just a shortcut instead of writting the name into the script it will get the full url of the script and the name an put it in for you.

If i move a script from one dir on my computer say http://127.0.0.1/news/ to http://127.0.0.1/new_news/ the $PHP_SELF will change from /news/ to /new_news/ every time the script is called.

If you need help on any php var download a copy of the Php Man located on the PHP.net site it comes in handy for things like this.



Dean "The Insane Guy" Hayes
Mystical Web Designs
http://www.mystical-sector.com

<-- I design and i redesign but still i never designed true beauty like you -->





From: "Mark Harrington" <elite_electronics@ntlworld.com>
To: php-windows@lists.php.net
Subject: [PHP-WIN] $PHP_SELF
Date: Wed, 3 Sep 2003 18:39:19 +0100

Sorry about this question "Im a novice at this "

Ok read all the info on this special variable but i still havent got a clue
what they are on about "Duh" yeah i know but if someone can put this into
plain english for me it would be helpfull
1: What does it do i see this included in forms for submission of values
acording to one tut it does the following but im still perplexed by this

As follows

Also note the use of the variable $PHP_SELF. This variable, which stores the
script's name and location, is passed along with every PHP page. It's
helpful here because we just want this file to call itself. Using $PHP_SELF,
we can be sure that will happen, even if the file is moved to another
directory - or even another machine.

2: Where would i use this and why would I use this.  Whats its purpose can
any one give me an explained example  " may be an algorithm or something "
From what I understand is that if you use this on one php script then
calling another script with the variable $PHP_SELF contained within will
remember the previous script " <<< Now im really confused !!

Manythanks Mark
 mark@harrington.force9.co.uk

"Having to teach myself due to cost of university fees in the UK " Excuse
mysarcasm "Chucle chuckle " I know its a bit dry

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

_________________________________________________________________
Protect your inbox from harmful viruses with new ninemsn Premium. Click here http://ninemsn.com.au/premium/landing.asp


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux