Noskiw Posted December 20, 2008 Share Posted December 20, 2008 PROBLEM <?php ini_set('display_errors', 'On'); error_reporting(E_ALL | E_STRICT); if(!$_POST['submit']){ echo "Invalid Usage of file!\n"; }else{ $tid = mss($_GET['id']); $msg = mss($_POST['reply']); if(!$tid){ echo "You did not supply a topic to reply to!\n"; }else{ $sql = "SELECT * FROM forum_topics WHERE id='$tid'"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) == 0){ echo "This topic does not exist!\n"; }else{ $row = mysql_fetch_assoc($res); $sql2 = "SELECT admin FROM forum_sub_cats WHERE id='{$row['cid']}'"; $res2 = mysql_query($sql2) or die(mysql_error()); $row2 = mysql_fetch_assoc($res2); if($row2['admin'] == 1 && $admin_user_level == 0){ echo "You cannot post here, this is because you are not an admin!\n"; }else{ if(!$msg){ echo "You did not supply a message for the reply!\n"; }else{ if(strlen($msg) < 10 || strlen($msg) > 500){ echo "Your reply must be between 10 and 500 characters!\n"; }else{ $sessionuid = $_SESSION['uid']; $date = date("m-d-y") . " at " . date("h:i:s"); $time = time(); $sql3 = "INSERT INTO `forum_replies` (`tid`,`uid`,`message`,`date`,`time`) VALUES('".$tid."','".$_SESSION['uid']."','".$msg."','".$date."','".$time."')"; $res3 = mysql_query($sql3) or die(mysql_error()); $sql4 = "UPDATE `forum_topics` SET `time`='".time()."' WHERE `id`='".$tid."'"; $res4 = mysql_query($sql4) or die(mysql_error()); header("Location: forum-index.php?act=topic&id=".$tid); } } } } } } ?> i want it to go back to the topic but it doesn't. anything wrong here? Link to comment https://forums.phpfreaks.com/topic/137820-little-problem-should-take-5-mins-to-solve/ Share on other sites More sharing options...
bdmovies Posted December 20, 2008 Share Posted December 20, 2008 Not positive, but shouldn't <?php header("Location: forum-index.php?act=topic&id=".$tid); ?> Be: <?php header("Location: forum-index.php?act=topic&id=$tid"); ?> I moved the $tid inside of the ", not sure though. Link to comment https://forums.phpfreaks.com/topic/137820-little-problem-should-take-5-mins-to-solve/#findComment-720401 Share on other sites More sharing options...
PC Nerd Posted December 20, 2008 Share Posted December 20, 2008 if it "doesnt" go back to the topic, then what "does" it do instead? An error? if so what one?, if not then what is displayed? Thanks Link to comment https://forums.phpfreaks.com/topic/137820-little-problem-should-take-5-mins-to-solve/#findComment-720447 Share on other sites More sharing options...
shlumph Posted December 20, 2008 Share Posted December 20, 2008 You need the whole domain name, including the http:// infront, I think. Let me know if that fricken works. Link to comment https://forums.phpfreaks.com/topic/137820-little-problem-should-take-5-mins-to-solve/#findComment-720454 Share on other sites More sharing options...
bdmovies Posted January 9, 2009 Share Posted January 9, 2009 You need the whole domain name, including the http:// infront, I think. Let me know if that fricken works. you don't need the http:// if you are redirecting to a local page. Link to comment https://forums.phpfreaks.com/topic/137820-little-problem-should-take-5-mins-to-solve/#findComment-733704 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.