dadamssg Posted March 28, 2009 Share Posted March 28, 2009 im developing a forum...and i have a page that displays a certain topic and im trying to create the reply page and script. i have a template page that grabs the id number out of the url and displays the topic info based on that...works fine now im tryin to make a reply button that will send them to the reply form with that same id number in the url...and ill use that id number to put in the db. heres what i have for the topic page..just the top..grabbing the number, making sure its a number, then making sure its in the db, if not send to homepage...works perfect in the initial page session_start(); $postid = $_GET["id"]; if (! ctype_digit($postid)) { header("Location: http://www.mysite.com"); } include("caneck.inc"); $postid = $_GET["id"]; $cxn = mysqli_connect($host,$user,$passwd,$dbname) or die ("Couldn't connect"); $quer = "SELECT * FROM test WHERE eventid = $postid"; $rsult = mysqli_query($cxn,$quer) or die ("Couldn't execute"); $found = mysqli_num_rows($rsult); //check if postid exist, if not send to homepage if ($found > 0) {} else {header("Location: http://www.mysite.com");} and heres how i create the reply button with the id in the url echo "<form action='reply_form.php?rid={$postid}' method='POST'> <input type='submit' name='do' value='Reply'> </form>"; it works...sends me to reply_form with the same number but when i try to copy and paste the above checking the $postid into reply_form.php it doesn't work...i can type in any number or letters in the url, click enter and it will pull up a blank page. anybody have any suggestions? Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted March 28, 2009 Share Posted March 28, 2009 turn on error reporting ini_set("display_errors","1"); ERROR_REPORTING(E_ALL); blank page usually means an error that isn't being displayed. Quote Link to comment Share on other sites More sharing options...
dadamssg Posted March 28, 2009 Author Share Posted March 28, 2009 hey thanks, i figured it out...sorta. i copied and pasted it again and it works...wierd 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.