0

In a form,
I am displaying a select box value , based on that select box value i show two more select boxes using ajax in div id.
And I don not know about session, I want to save that in session using ajax . How to do?

3
Contributors
5
Replies
17
Views
2 Years
Discussion Span
Last Post by lps
0

You will have to be a bit more clear on your goal.

When you say session, are you talking about a PHP session? A cookie? The current "browser session"?

Perhaps detail your idea, and we can help give you direction on how to accomplish it. :)

0

Trigger an ajax to post to a process.php with the code
process.php

if(isset($_POST['myVal']){
    session_start();
    $_SESSION['myRef'] = $_POST['myVal'];
}
0

ajax:

$.ajax({
    url:"process.php",
    type: 'POST',
    data: {"myVal":"The data I wish to be store into session"}
});

myVal will be the key of posting that contain the things you wish to store.
myRef will be the key of the session variable that you wish to access it later.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.