$_POST content disregarded

Questions$_POST content disregarded
rob asked 1 year ago

I must have missed something, trying to use guidance in FAQ>Misc “Q) How to load grid based on $_POST data from other page?”

See example code, using the demo database and stripped to the basics.

https://gist.github.com/rob2009/01ade64ceac311f7b4e6abd256b0ebfb

It’s fine unless you comment out line 16 $SelectedName=”Ana”

3 Answers
Abu Ghufran Staff answered 1 year ago

Try this change on line 12:

if (!empty($_POST[“name”]))
{
$_SESSION[“name”] = $_POST[“name”];
}

$SelectedName = $_SESSION[“name”];

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
rob answered 1 year ago

moving $SelectedName = $_SESSION[“name”]; outside the if statement made no difference

Abu Ghufran Staff answered 1 year ago

Hello,

You need to create grid object before this session code logic to regain php session.

$g = new jqgrid($db_conf);
if (!empty($_POST[“fname”]))
{
    $_SESSION[“fname”] = $_POST[“fname”];
}
$SelectedName = $_SESSION[“fname”];

I have tested it and working fine.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

2 + 12 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?