|
-
Dec 6th, 2002, 03:28 PM
#1
Thread Starter
Fanatic Member
whats wrong?
whats wrong with the below code? it works fine if $dl='pcgame' but none of the other ones work?
PHP Code:
<?php
$dl = $_GET[dl]
if ($dl ='pcgame') {
header("Location: /pcgame.php");
}elseif($dl='movie'){
header("Location: /pcgame.php");
}elseif($dl='console'){
header("Location: /console.php");
}elseif($dl='albums'){
header("Location: /album.php");
}elseif($dl='applications'){
header("Location: /application.php");
}elseif($dl='ebook'){
header("Location: /ebook.php");
}elseif($dl='adult'){
header("Location: /adult.php");
}else{
echo 'not a valid input';
}
?>
-
Dec 7th, 2002, 03:38 AM
#2
Conquistador
-
Dec 10th, 2002, 03:05 PM
#3
Frenzied Member
uhh you need 2 = in there
also if you are getting them from the url you will need $_GET['dl'] instead. not $_ENV
PHP Code:
if ($dl =='pcgame') {
header("Location: /pcgame.php");
}elseif($dl=='movie'){
header("Location: /pcgame.php");
}elseif($dl=='console'){
header("Location: /console.php");
}elseif($dl=='albums'){
header("Location: /album.php");
}elseif($dl=='applications'){
header("Location: /application.php");
}elseif($dl=='ebook'){
header("Location: /ebook.php");
}elseif($dl=='adult'){
header("Location: /adult.php");
}else{
echo 'not a valid input';
}
-
Dec 12th, 2002, 02:32 PM
#4
Stuck in the 80s
Just adding to what phpman said...
Is used to assign a variable. So if you have:
You are assigning 2 to the variable, which will then return true (or success) and execute that IF statement.
Is the boolean test statement to find out what something equals.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|