Possible Duplicate:
How come some site urls do not include a file extension?
Hi there,
I was wondering how I can pass a variable to my PHP script using the following syntax:
http://example.com/script?variable=value
It seems I have to include .php after the script name or it won’t work, but YouTube for example doesn’t have the extension:
http://www.youtube.com/watch?v=ql7jGchLAWE
How do I do this?
Thanks in advance!
Youtube doesn’t use PHP.
The way you could do this is by making a directory called
script, then calling your scriptindex.php. Then you could do:Alternatively, you could use
.htaccessto rewrite your URLs to remove the .php extension.