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

  • Home
  • SEARCH
  • 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 8094505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:48:54+00:00 2026-06-05T20:48:54+00:00

I have the following code when a user clicks in the ‘generate’ element the

  • 0

I have the following code when a user clicks in the ‘generate’ element the data within the form ‘serializeData’ is serialized in js. This string is passed to the loadTemplate function which in turn POST’s that string with other variables to a php script for processing.

What I’m looking for is a way to unserialize the js string in PHP or best practice for getting at the data, here is an example output of the serilized data as seen in PHP as a string: –

input1=meeting&input2=select+date&input3=enter+text&input4=NUMBER+MISSING

The serialized form data is passed to PHP in the loadTemplate function in the userData variable.

Functions: –

$("#generate").click(function () {
    if (eCheck == true) {

        var templateData = $("#serializeData").serialize();
        var templateID = $("#serializeData").attr("name");  

            loadTemplate(this, templateID, 3, templateData)         
    }
    return false;
});


function loadTemplate(obj, cat, call, userData) {
userData = typeof userData !== "undefined" ? userData : null; // Set userData to null if undefined.
var onSuccess = "#right";

if (call == 1) {
    onSuccess = "#left";
        switchButton(obj);
            $("#content").hide();
            $("#right-content").text("");
} 

 $("#loading").show();

$.ajax({
    type: "POST",
    url: "./scripts/load.php",
    data: { id : cat, call: call, userData: userData },
    cache: false,
      success: function(html){
        $(onSuccess + "-content").html(html);

        if (onSuccess == "#left") {
          $("#content").fadeIn(500);
        } 
            $("#loading").fadeOut(500);
            resizeAll();
    }
});

}

Any thoughts?

  • 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-05T20:48:55+00:00Added an answer on June 5, 2026 at 8:48 pm

    You can use parse_str:

    $values = array();
    parse_str($_POST['userData'], $values);
    echo $values['input1']; //Outputs 'meeting'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have the following code in a form . When the user clicks
If we have the following code, then when user clicks an Edit button, page
I have the following code running when the user clicks the Save button: -
I have a form, when the user clicks on the submit button this javascript
I have following code class User attr_accessor :name end u = User.new u.name =
I have following code for updating user's column public void UpdateLastModifiedDate(string username) { using
If use MongoRepository, You can have following code: @Repository public interface UserRepo extends MongoRepository<User,
I have the following code to ensure that if the user selects the same
I have the following code that sets a background if user has uploaded to
I have the following code that loads a user's Active Directory DirectoryEntry object from

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.