im trying to check two variables in a url, U and TAG. i keep getting whitescreen or no results. i want to check U and the preg replace works and everything, but! i also want to check the variable TAG to make sure it isnt blank, and if it is blank then go to website.com
here is a url
http://www.website.com/hashtag.php?u=frank&tag=#my
here is the code
if(isset($_GET["u"]))
{
$u = preg_replace('#[^a-z0-9]#i', '', $_GET['u']);
} else {
header("location: http://www.website.com");
exit();
}
if (isset($_GET['tag']) && $tag == "")
{
header("location: http://www.website.com");
exit();
}
f (isset($_GET['tag']) && $tag == "")
-> $tag isn't an existing var for now, if you want to call $tag you should previously do :
$tag = $_GET['tag'];