Derek Posted August 13, 2010 Share 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 Quote Link to comment Share on other sites More sharing options...
Byron Posted August 13, 2010 Share 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); } } ?> Quote Link to comment Share on other sites More sharing options...
Derek Posted August 13, 2010 Author Share 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.