Page 1 of 1

Using ?fjkdf instead of ?var=djkdf

Posted: Fri Sep 27, 2002 9:13 pm
by phice
Is there a way? I saw perl/cgi doing it... :/

Posted: Fri Sep 27, 2002 9:49 pm
by mydimension
yep, i do it all the time. given this URL: .../page.php?some_value
put this code at the top of page.php

Code: Select all

<?php
$variable = $_SERVERї'argv']ї0];
?>
$variable would now equal "some_value"

Posted: Fri Sep 27, 2002 10:07 pm
by hob_goblin
NICE!

Posted: Sat Sep 28, 2002 12:31 pm
by Takuma
That's how some website do it :D

Posted: Sat Sep 28, 2002 6:49 pm
by phice
Amazing! :D:D

Posted: Sat Sep 28, 2002 7:10 pm
by mydimension
im actually kinda stunned that you guys never thought of this. not to be down on you cause im glad to show you new ways of doing things. i just thought it was a common thing but people preferred not to use it.

Posted: Sat Sep 28, 2002 7:13 pm
by phice
I plan on using it... but where can I get more information on _SERVER[""] stuff? I searched on php, and couldnt find anything. :/

Posted: Sat Sep 28, 2002 7:17 pm
by mydimension
here is a listing of possible $_SERVER[''] values (and all the other $_ variables:
http://www.php.net/manual/en/printwn/re ... iables.php

Posted: Sun Sep 29, 2002 3:32 am
by twigletmac
To find out what's accessible to you in the $_SERVER array on your own machine just do:

Code: Select all

<?php
echo '<pre>';
print_r($_SERVER);
echo '</pre>';
?>
'cause it tends to be slightly different for everyone.

Mac