Jump to content

Recommended Posts

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?

 

Link to comment
https://forums.phpfreaks.com/topic/233158-input-_get-into-a-query/
Share on other sites

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.

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.

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">

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'])){

...
?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.