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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:10:00+00:00 2026-06-13T12:10:00+00:00

i need in sert data by ajax , i have two pages, once is

  • 0

i need in sert data by ajax , i have two pages, once is form that have icon that i click on it and send me to other page and insert new data

here the ajax code

<script type="text/javascript">
$(function() {
  $("#dialog1").click(function() {
        $('#welcome').slideToggle('#loginhandle'); 
        $('#loginhandle').show("slow");

      var name = $("input#ausers_ID").val();
      var dataString = 'ausers_ID='+ ausers_ID  ;
        $.ajax({
               type: "POST",
               url: "OpenCashier.php",
               data: dataString,
               success: function(msg) {
                 $('#loginhandle').slideToggle('#msgreturn');
                 $('#msgreturn').show("slow");
                 $('#msgreturn').html(msg)
                .hide()
                .fadeIn(1500, function() {
        });
      }
     });
    return false;
    });


});
</script>

when i click this bottom

<input type="submit" id="dialog1" name="dialog1" value="Insert" />  

we must call this page

<? session_start();
include("sec.php");
include("../include/connect.php");
include("../include/safe.php");

    if($_POST["dialog1"]){

            // Every thing is OK    
            $ausers_ID=$_POST["ausers_ID"];
            $cashiers_CashierOpenDate=date('Y/m/d');
            $query="INSERT INTO `cashiers` ( `cashiers_CashierID` , `cashiers_CashierOpenDate` , `cashiers_User` , `cashiers_Status` , `cashiers_Delete`  ) VALUES ('', '$cashiers_CashierOpenDate', '$ausers_ID', '0','0');";
            mysql_query($query);
            $num=mysql_affected_rows();         
            if($num==1)
                $message="Account was added successfully";
            else                
                $message=$_POST["dialog1"]." Account is already exists in database";
    }
?>

but data cannot insert why !!!

  • 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-13T12:10:01+00:00Added an answer on June 13, 2026 at 12:10 pm

    You missed to include the “dialog1” parameter used in your PHP code.

    I would suggest to change your data to sent to :

    var dataString = {ausers_ID : ausers_ID, dialog1 : true}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

need a little help with this one. I have a form that I am
Need help I am scraping data from this website which has a form that
Need help with a query that I wrote: I have three tables Company id
Need help for that. I have a tabbar with 2 views, A and B
Need to port data in sql table I have a master table with columns
Need your help with my PHP/MYSQL array. I have a php script that selects
Need to have a type-safe bag of items that all implement a generic interface.
Need for two dimensional array of objects that could be something like: myContainer<myObject*> *a
Need to know how to get YQL to return only data that's newer than
Need some regular expressions help. So far I have my code working to allow

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.