iceblox Posted July 31, 2007 Share Posted July 31, 2007 Guys, THis is a selection of code from by script. This is the only bit ive changed so there must be something wrong this bit.. Can anyone see anything wrong? if($checkurl!=$endurl) { header("HTTP/1.1 301 Moved Permanently"); header("Location: $checkurl"); exit(); } else { header("HTTP/1.1 301 Moved Permanently"); header("Location: Domain.com"); exit(); } Link to comment https://forums.phpfreaks.com/topic/62717-if-and-else/ Share on other sites More sharing options...
Asperon Posted July 31, 2007 Share Posted July 31, 2007 I don't see anything wrong with it, maybe the problem is elsewhere in your code...or maybe I can't see it either... Link to comment https://forums.phpfreaks.com/topic/62717-if-and-else/#findComment-312168 Share on other sites More sharing options...
iceblox Posted July 31, 2007 Author Share Posted July 31, 2007 Hmm ok maybe if i post the whole script. <?php $connection = mysql_connect('localhost','user','pass'); mysql_select_db('databasename'); $query = "SELECT * FROM Makes WHERE MakeID=" . $_GET['MakeID'] . " AND MakeActive = '1'"; $result = mysql_query($query); $page = mysql_fetch_row($result); $make = ereg_replace (" ", "-", $page[1]); $pageurl = "$make-Cars-$page[0].html"; $endurl = $_SERVER['REQUEST_URI']; $checkurl="http://www.domain.com/$pageurl"; //echo"arturl $checkurl<br />endurl $endurl<br />"; $endurl = stripslashes($endurl); $endurl= "http://www.domain.com$endurl"; $endurl=trim($endurl); $checkurl=trim($checkurl); if($checkurl!=$endurl) { header("HTTP/1.1 301 Moved Permanently"); header("Location: $checkurl"); exit(); } else { header("HTTP/1.1 301 Moved Permanently"); header("Location: domain.com"); exit(); } ?> Link to comment https://forums.phpfreaks.com/topic/62717-if-and-else/#findComment-312183 Share on other sites More sharing options...
AV1611 Posted July 31, 2007 Share Posted July 31, 2007 it seems to say MPPT and not HTTP Link to comment https://forums.phpfreaks.com/topic/62717-if-and-else/#findComment-312184 Share on other sites More sharing options...
iceblox Posted July 31, 2007 Author Share Posted July 31, 2007 Am i being blonde or can i not see that? Link to comment https://forums.phpfreaks.com/topic/62717-if-and-else/#findComment-312200 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.