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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:13:22+00:00 2026-05-18T10:13:22+00:00

I have a form that uses ajax to submit data to a mysql database,

  • 0

I have a form that uses ajax to submit data to a mysql database, then sends the form on to PayPal.

However, after submitting, if I click the back button on my browser, change some fields, and then submit the form again, the mysql data isn’t updated, nor is a new entry created.

Here’s my Jquery:

$j(".submit").click(function() {
        var hasError = false;
        var order_id = $j('input[name="custom"]').val();
        var order_amount = $j('input[name="amount"]').val();
        var service_type = $j('input[name="item_name"]').val();
        var order_to = $j('input[name="to"]').val();
        var order_from = $j('input[name="from"]').val();
        var order_message = $j('textarea#message').val();
        if(hasError == false) {
            var dataString = 'order_id='+ order_id + '&order_amount=' + order_amount + '&service_type=' + service_type + '&order_to=' + order_to + '&order_from=' + order_from + '&order_message=' + order_message;
            $j.ajax({ type: "GET", cache: false, url: "/gc_process.php", data: dataString, success: function() { } });

        } else {

            return false;

        }
    });

Here’s what my PHP script looks like:

<?php

// Make a MySQL Connection
include('dbconnect.php');

// Get data
$order_id = $_GET['order_id'];
$amount = $_GET['order_amount'];
$type = $_GET['service_type'];
$to = $_GET['order_to'];
$from = $_GET['order_from'];
$message = $_GET['order_message'];

// Insert a row of information into the table
mysql_query("REPLACE INTO gift_certificates (order_id, order_type, amount, order_to, order_from, order_message) VALUES('$order_id', '$type', '$amount', '$to', '$from', '$message')");

mysql_close();

?>

Any ideas?

  • 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-18T10:13:22+00:00Added an answer on May 18, 2026 at 10:13 am

    Turns out the problem is due to the fact that I am using iframes. I was able to fix the problem by making the page without iframes. Thanks for your help all!

    • 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 uses jQuery to submit an ajax post and it
I have an edit form that uses an ajax form to submit to the
I have a form that uses Ajax for client-side verification. The end of the
I have a form that uses a jQTools overlay and jQuery .ajax submission routine.
The basics: I have a contact form that uses php to validate the forms.
I have a basic CRUD form that uses PageMethods to update the user details,
I have a windows form application that uses a Shared class to house all
I have a web report that uses a Django form (new forms) for fields
I have a form that uses a JQuery Json post. I have 10+ textboxes
I have a pretty standard contact form that uses a cfc for processing now.

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.