ted_chou12 Posted October 6, 2009 Share Posted October 6, 2009 Hi, i have a page, the link looks like this: http://domain.com/page.php?var=val#anchor, but the anchor seems to be included into the var varaible, so it reads like val#anchor altogether, the page looks like: $user = $_GET['user']; $user = strtolower($user); require("../mysqlconnection.php"); $read = mysql_query("SELECT displayname FROM usercus WHERE username='$user'"); $r = mysql_fetch_array($read); $dname = $r['displayname']; if ($dname == "") {$invalid = true; $title = "ErrorDocument 404";} else {$status = file("storage/$user.txt", FILE_IGNORE_NEW_LINES); list($lastmoddate, $title1, $banner, $bgcolor, $bgimage, $bgwatermark, $font, $textcolor, $datecolor, $order, $header, $footer, $authority) = explode(";seDp#", $status[0]); $title = "$dname's Blog";}?> <title><?php echo $title;?></title> There are some redundant codes, (can be ignored) Thanks, Ted Link to comment https://forums.phpfreaks.com/topic/176639-anchor-includes-into-the-_get-variable/ Share on other sites More sharing options...
mrdamien Posted October 6, 2009 Share Posted October 6, 2009 If you have multiple number-signs in the url, then all but the last segment following the number sign, would be part of the GET variables ( I think ). As far as I know, that is controlled by the web-server (i.e. apache). But I've never heard of apache having this problem... What web server are you using ? Link to comment https://forums.phpfreaks.com/topic/176639-anchor-includes-into-the-_get-variable/#findComment-931345 Share on other sites More sharing options...
cags Posted October 6, 2009 Share Posted October 6, 2009 So you are saying that in your code example... $user = $_GET['user']; ...with a url of http://domain.com/page.php?user=val#anchor, that $user contains val#anchor? Link to comment https://forums.phpfreaks.com/topic/176639-anchor-includes-into-the-_get-variable/#findComment-931374 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.