Derek Posted August 13, 2010 Posted August 13, 2010 Yeah, I seem to be overlooking something really simple again today, but I can't figure it out. (Yeah I sent this as a PM but I thought I should put it here instead.) Source: <?php $filename = $_GET['file']; $location = $_GET['where']; if ($filename) { if ($location = "main") { print($filename . ' - ' . $location); } else if ($location = "home") { print($filename . ' - ' . $location); } else if ($location = "scoizzle") { print($filename . ' - ' . $location); } } ?> No matter what I put for "where", I get $location printed as "main". So if I go to http://unorthodox.co.cc/download.php?where...p;file=test.txt http://unorthodox.co.cc/download.php?file=test.txt http://unorthodox.co.cc/download.php?where...p;file=test.txt , they both print "test.txt - main". Thanks, ~Derek
Byron Posted August 13, 2010 Posted August 13, 2010 Should be == instead of =. if ($location == "main") <?php $filename = $_GET['file']; $location = $_GET['where']; if ($filename) { if ($location == "main") { print($filename . ' - ' . $location); } else if ($location == "home") { print($filename . ' - ' . $location); } else if ($location == "scoizzle") { print($filename . ' - ' . $location); } } ?>
Derek Posted August 13, 2010 Author Posted August 13, 2010 Should be == instead of =. omg I swear I tried that already (because Java uses "==" too), but I must have forgotten to FTP or something >.> Thanks--again. P.S.: Yeah, I'm updating my Profile and signature, etc. I figure it's about 2 years overdue. :S
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now