Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8276439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:22:35+00:00 2026-06-08T08:22:35+00:00

I have a form that after so many seconds automatically saves the form to

  • 0

I have a form that after so many seconds automatically saves the form to a database (well that is my intention)

The script below grabs the values in an jQuery AJAX request and sends this to a controller – but whenever I try to var_dump the values it doesnt seem to work from the serialised array. I can see the parameters are there when I view FireBug in Firefox but cannot seem to print the array – can anyone explain why?

// view logic
var t = setTimeout("autosave()", 10000); 
$.ajax( 
{ 
    type: "GET", 
    url: "/questionnaires/autosave", 
    data: $("form").serialize(), 
    cache: false, 
    success: function(msg) {
        return false;
    }
});

// controller logic
function autosave()
{
    $str = parse_str( $this->input->get_post('form') );
    var_dump($str); // intend to do an insert query here to the db
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:22:36+00:00Added an answer on June 8, 2026 at 8:22 am

    You most likely dont have query_string enabled in your config.php.

    As a result you wont be able to use GET reliably. Your best option is to change type: "GET", to type: "POST",.

    Then use $this->input->post() to access post variables. You can reference this information from the Codeigniter Documentation:

    http://codeigniter.com/user_guide/libraries/input.html

    $this->input->post()

    The first parameter will contain the name of the POST item you are
    looking for:

    $this->input->post('some_data'); The function returns FALSE (boolean)
    

    if the item you are attempting to retrieve does not exist.

    The second optional parameter lets you run the data through the XSS
    filter. It’s enabled by setting the second parameter to boolean TRUE;

    $this->input->post('some_data', TRUE); To return an array of all POST
    

    items call without any parameters.

    To return all POST items and pass them through the XSS filter set the
    first parameter NULL while setting the second parameter to boolean;

    The function returns FALSE (boolean) if there are no items in the
    POST.

    $this->input->post(NULL, TRUE); // returns all POST items with XSS
    $this->input->post(); // returns all POST items without XSS
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form that and after the user fills in this form, I
Hi I have a Sticky form that after successful completion I want to clear
I have a form that is closed unexpectedly immediately after showing it. I hooked
I have a form in an HTM page that, after pressing the submit button,
I have a form that I'm submitting through AJAX. The form includes many fields,
I have a form that has label values that I would like to pass
After many cases of trial and error, I have concluded that the only solution
Let's say I have form A that contains a panel (with many other controls
I have a button in my form that is submitting input into many different
I have a form that allows the user to add as many upload forms

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.