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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:04:09+00:00 2026-05-22T17:04:09+00:00

Hey guys, I’m having an issue which I hope is easy to resolve. Currently

  • 0

Hey guys, I’m having an issue which I hope is easy to resolve. Currently I’m using this code to send variables from a form to PHP. It works as long as I have less than 10 variables, but as soon as I have 10+, I get an error in my PHP script. Here is my .post() code:

$.ajax({
            type: "POST",
            url: "ajax.php",
            data: "&email="+ email + "&fname="+ fname + "&lname="+ lname + "&password="+ password + "&groupname="+ groupname + "&productkey="+ productkey + "&company="+ company + "&position="+ position + "&sector="+ sector, 

                success: function(){
                    $('form#submit').hide();
                    //$('form#submit :input').val("");
                     $('div.success').fadeIn();
                }
    });

It seems somewhat inefficient to me, which could be why it’s breaking as soon as I add the tenth variable. I’m at a bit of a loss. Any thoughts? If needed, I can provide a zip of the form with all of the files.

Cheers.

Here is the main content of the ajax.php file:

  $fname        = htmlspecialchars(trim($_POST['fname']));  
$lname        = htmlspecialchars(trim($_POST['lname']));  
$email        = htmlspecialchars(trim($_POST['email']));  
$password     = md5(trim($_POST['password']));  
$groupname    = htmlspecialchars(trim($_POST['groupname']));  
$productkey   = htmlspecialchars(trim($_POST['productkey']));   
$company      = htmlspecialchars(trim($_POST['company']));   
$position     = htmlspecialchars(trim($_POST['position']));   
$sector       = htmlspecialchars(trim($_POST['sector']));  


$addClient  = "INSERT INTO tbl_user (fname,lname,email,password,groupname,productkey,company,position,sector) VALUES ('$fname','$lname','$email','$password','$groupname','$productkey','$company','$position','$sector')";  
mysql_query($addClient) or die(mysql_error());  

Upon further troubleshooting, I’m still not 100% confident where the problem was, however I do believe that the way of passing data in the accepted solution is better than the way I was trying to do it before. There may have also been an issue in my mySQL database where I needed to delete a column and re-create it before it operated correctly. Thanks everyone – hope I didn’t waste your time

  • 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-22T17:04:09+00:00Added an answer on May 22, 2026 at 5:04 pm

    try just passing your data as a simple object:

    var data = {"email": email, "fname": fname, ....}
    $.ajax({
      type: "POST",
      url:  "ajax.php",
      data: data,
      ...
    })
    

    maybe that will help :/

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

Sidebar

Related Questions

hey guys having this really simple problem but cant seem to figure out have
Hey guys (and gals) I'm having a problem using Assembly GetExportedTypes() in .NET 4.0.
hey guys I have the follow code in js: $(document).ready(function(){ $(.replyLink).click(function(){ $(#form-to-+this.id).html(htmlForm()).toggle(500); return false;
Hey guys I'm running this code in Android: public ServiceServer(String serverName) { this.serverName =
Hey guys, I'm using GWT for a data-driven web application, and I'm having issues
Hey guys am having a bit of problems with my jQuery, I have all
Hey guys got an issue with Cakephp validation.. I want to know why is
Hey guys I've written this MS SQL script with my awesome MS SQL skills,
Hey guys I am making a terminal application using Swing and Apache Commons. I
Hey Guys I've been struggling with this for the last hour and pouring over

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.