faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

51 of 80 people (64%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

How and when to use $php_self and $query_string????

Feb 20th, 2008 22:57
dman, Onno Benschop, GamerZ Chan, http://www.ttnr.org


You could create a form that posts to itself:
   echo "<form action=$PHP_SELF>" ;
Or you could generate a URL in a list that points to itself:
   echo "<a href='$PHP_SELF?cmd=view&id=12'>bob</a>" ;
This would set a variable called $cmd, with a value 'view' and a 
variable called $id, with a value 12, which you could use to view the 
details of the record with id 12.
The possibilities are endless.