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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:51:50+00:00 2026-05-24T23:51:50+00:00

I have a php script that takes some user form input and packs some

  • 0

I have a php script that takes some user form input and packs some files into a zip based on that input. The problem is that sometimes the server errors, so all the form data is lost. I was told I could use ajax instead so that the user never even has to change the page. I’ve never used ajax, and looking at http://api.jquery.com/jQuery.ajax/ without any experience in ajax is quite difficult.

The page says that you can accept returns from an ajax call. How do you set up returns in the PHP file for an ajax call? If the server errors with the ajax call, how will I know?

edit: Also, is there a way to send an ajax request with javascript and jquery as if it were a submitted form?

  • 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-24T23:51:51+00:00Added an answer on May 24, 2026 at 11:51 pm

    How do you set up returns in the PHP file

    just echo it in ajax page that will return as response

    Simple Tutorial

    client.php

    $.post('server.php',({parm:"1"}) function(data) {
      $('.result').html(data);
    });
    

    server.php

    <?php
    
    echo $_POST['parm'];
    
    ?>
    

    result will be 1

    edit on OP comments
    Is there a way to use ajax as if you were submitting a form

    Yes, there is

    • You can use plugins like jQuery form
    • Using submit
    • If you using jquery validation plugin, you can use submit handler option

    using sumit

    $('#form').submit(function() {
     //your ajax call
      return false;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script that simply takes some data, separates it into tab
Say I want to have a simple web app that takes some user input,
I have a php script that sends SMS, the problem is that it takes
I have a php pipe script that receives an email, takes an attached *.csv
I have PHP script which takes some file (FLV for example) and returns it
I have a PHP script that takes about 10 minutes to complete. I want
I've written a PHP script that takes in two CSV files, processes them and
I have a small PHP script that takes the values from a dropdown list
I have a form that is submitted to a php script with jquery and
I have a PHP script that's supposed to take in a URL and search

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.