ok, ive been to a few php tutorials sites. and all they give me is this:
<?
$HTTP_GET_VARS['tutorials'];
if ($tutorials == "php" || $tutorials == "") {
include("php.php");
}
else if($tutorials == "photoshop") {
include("ps.php");
}
?>
but what do i do??
do i stick it at the top of my page...??? do i make the link go to href="tuts.php=php" or something
if you could give me an easy explanation....it would be greatly appreciated.
thnx
A newbie and Query Strings
Moderator: General Moderators
- Sevengraff
- Forum Contributor
- Posts: 232
- Joined: Thu Apr 25, 2002 9:34 pm
- Location: California USA
- Contact:
the code assumes your using a url something like this:
example.com/script.php?tutorials=php
example.com/script.php?tutorials=photoshop
$HTTP_GET_VARS[] holds variables created in the url.
example.com/script.php?var1=happy&var2=sad&var3=sleepy
notice that after the first variable, you need to use the & to seperate variables.
Yes, you would have to put that code in a php file, and probally have nothing else in that file. make sure that php.php and ps.php are in the same folder as your script.
example.com/script.php?tutorials=php
example.com/script.php?tutorials=photoshop
$HTTP_GET_VARS[] holds variables created in the url.
example.com/script.php?var1=happy&var2=sad&var3=sleepy
notice that after the first variable, you need to use the & to seperate variables.
Yes, you would have to put that code in a php file, and probally have nothing else in that file. make sure that php.php and ps.php are in the same folder as your script.