HarryMW Posted April 9, 2011 Share Posted April 9, 2011 Why exactly is the _get returning just nothing everytime? $seshid = $_GET['finish']; // Little things in here ... ///Add lesson plan if(isset($_POST['addinc'])){ if(!empty($_POST['inc'])){ $inc = addslashes($_POST['inc']); mysql_query("INSERT INTO `group_sessions_lplan` (`group_sessions_lplan_id`, `group_session_id`, `plan`) VALUES ('', '$seshid', '".strip_tags($inc, "<a><b><strong><u><i><span>")."')"); header("Location: ?id=".$seshid."#I"); exit(); } } Not too sure myself, anyone know how I can get it to show its actual value? Quote Link to comment https://forums.phpfreaks.com/topic/233158-input-_get-into-a-query/ Share on other sites More sharing options...
QuickOldCar Posted April 9, 2011 Share Posted April 9, 2011 I'd have to say it may have to do with the way you did your form itself. Could you paste that as well? But to see if your get is passing anything just do like this top your code. $seshid = $_GET['finish']; echo $seshid; Then we can go from there to see what the problem might be. Quote Link to comment https://forums.phpfreaks.com/topic/233158-input-_get-into-a-query/#findComment-1199071 Share on other sites More sharing options...
dcro2 Posted April 9, 2011 Share Posted April 9, 2011 If you're trying to get a $_GET variable, it has to be in the url. So your form would have to be submitting to page.php?finish=123 for example. Quote Link to comment https://forums.phpfreaks.com/topic/233158-input-_get-into-a-query/#findComment-1199081 Share on other sites More sharing options...
HarryMW Posted April 9, 2011 Author Share Posted April 9, 2011 Well I have a history page and basically it loops all of the results etc... then the id of the result is passed through to the next page with: <a href="gcomplete.php?finish=<?php echo $row_h['group_session_id']?>">View</a> And if I put the echo at the top (which I did in the begining to check) is echo's the id. I'm just stumped. Quote Link to comment https://forums.phpfreaks.com/topic/233158-input-_get-into-a-query/#findComment-1199166 Share on other sites More sharing options...
dcro2 Posted April 9, 2011 Share Posted April 9, 2011 Right, BUT, what does your form look like? You're submitting a form to the page or you wouldn't be using $_POST. You would have to pass on that same variable to the form's action page in order for it to work. <form action="gcomplete.php?finish=<?php echo $row_h['group_session_id']?>" method="post"> Quote Link to comment https://forums.phpfreaks.com/topic/233158-input-_get-into-a-query/#findComment-1199231 Share on other sites More sharing options...
cyberRobot Posted April 9, 2011 Share Posted April 9, 2011 As the others have suggested, it would be helpful to see your form. Otherwise we're just guessing. With that said, is your form method GET or POST? You're using both in the code mentioned earlier. <?php ... $seshid = $_GET['finish']; ... if(isset($_POST['addinc'])){ ... ?> Quote Link to comment https://forums.phpfreaks.com/topic/233158-input-_get-into-a-query/#findComment-1199284 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.