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 3236352
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:36:44+00:00 2026-05-17T17:36:44+00:00

i am facing a problem that after i created the jQuery post, i was

  • 0

i am facing a problem that after i created the jQuery post, i was able to receive all the data but as a one peace, so when i began rephrasing them i succeed until the final part which was the inserting into the database, where inside the for loop and if loop i am getting the value but when i wanted to start inserting them into the database i am getting null values, below is the for loop and if loop

if ($action == "insert")
{
    $fields = explode("&",$data);

    foreach($fields as $field)
    {
        $field_key_value = explode("=",$field);
        $key = urldecode($field_key_value[0]);
        $value = urldecode($field_key_value[1]);

        $id = $row['id'];

        $date1 = date("d/n/Y");

        foreach ($cart->get_contents() as $item)
        {
            $item_id    = $item['id'];
            $item_name  = $item['name'];
            $item_price = $item['price'];
            $item_qty   = $item['qty'];
            $item_ids       = explode("-",$item_id);

            for($i = 0; $i < count($item_ids); $i++)
            {
                $item_idn = join("",$item_ids);
            }

            if($key == $item_id."id")
            {
                $ids = $value;
                echo $ids."\r\n";
            }
            elseif($key == "Small".$item_idn)
            {
                $small= $value;
                echo $small."\r\n";
            }
            elseif($key == "large".$item_idn)
            {
                $large= $value;
                echo $large."\r\n";
            }
            elseif($key == "medium".$item_idn)
            {
                $medium= $value;
                echo $medium."\r\n";
            }
            elseif($key == "xlarge".$item_idn)
            {
                $xlarge= $value;
                echo $xlarge."\r\n";
            }
            elseif($key == "qty".$item_idn)
            {
                $qty = $value;
                echo $qty."\r\n";
            }
            elseif($key == "Total".$item_idn)
            {
                $subtotal = $value;
                echo $subtotal."\r\n";
            }
            elseif($key == "finaltotal")
            {
                $finaltotal = $value.",";
                $final = explode(",",$finaltotal);

                for($i = 0; $i < count($final); $i++)
                {
                    $totalf = $final[$i];
                    break 3;
                }
            }
        }
    }
}
  • 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-05-17T17:36:44+00:00Added an answer on May 17, 2026 at 5:36 pm

    From jQuery docs:

    The .serialize() method creates a text string in standard URL-encoded notation

    So on the PHP side you’ll get a similar string like this:

    a=1&b=2&c=3&d=4&e=5

    There’s no need to explode &‘s (or any other hocus-pocus) you can easily access your submitted variables like:

    $a = $_POST['a']; //1

    Of course when you submit your data via $_GET, you need to use $_GET.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm facing a problem while unit testing my forms. The problem is that data
I'm facing a problem that seems to have no straighforward solution. I'm using java.util.Map
I am facing the problem that I cannot properly map my foreign key table
I'm working with Eclipse and ClearCase and we're facing the problem that there's no
That was helpful kgiannakakis. I'm facing a problem as below: a = ['zbc','2.3'] for
I am new to Python and Numpy, and I am facing a problem, that
I am facing problem with the control flajaxian.FileUploader i.e. after downloading the dll file
I'm currently facing in problem using Core Data. I have two entities A and
I'm facing an odd problem with (re)packaging a Vagrant box and hope that maybe
I am facing an interesting problem right now. I know it is not that

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.