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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:35:14+00:00 2026-05-22T11:35:14+00:00

I want after Ajax success I can pass data from id=use into div id=app

  • 0

I want after Ajax success I can pass data from id=use into div id=app.
This is my script:

$.ajax({
        type:"post",
        url:"process3.php",
        data:params,
        cache:false,
        async:false,
        success: function(data){
                       switch(data){
                             case 1:
                                     $("#dialog").dialog('close');
                                     $("#segment").show();
                                     $("#appdate").text(today);
                                     $("#app").text($("#use").val());
                                     break;
                              //case 2:
                              }
                           //do next job after success
                        }
                  });

But it seems not work. The data can’t show inside the div.
Could you tell me why it’s happen? How to fix that?


This is the html:

<td class="space">
       <div id="app"></div><br/>
       <div id="appdate"></div>
</td>

<input type="text" id="use" name="use">

server side script:

$sql = "SELECT Privilege FROM admin WHERE user='".$Use."' AND password='".$Pass."'";
echo $sql;
$data=mysql_query($sql) or die(_ERROR26.": ".mysql_error());
if($data){
                $priv = mysql_fetch_assoc($sql);

                /*  will return 1 or 2 depending on the privilage set in you DB where 1 is admin and 2 is user */
                echo $priv['privilege'];  
                }else{
                        echo 0; // If login fails
                        }

whether my server side get different result?

  • 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-22T11:35:15+00:00Added an answer on May 22, 2026 at 11:35 am

    I have changed the server side become:

     $sql = "SELECT Privilege FROM admin WHERE user='".$Use."' AND password='".$Pass."'";
     $data=mysql_query($sql) or die(_ERROR26.": ".mysql_error());
     $dat=mysql_fetch_array($data,MYSQL_NUM);
            if(mysql_affected_rows()>0) {
                            echo $dat[0];
                            }else{
                            echo "No specified data";
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know I can use install-data-hook to do anything I want after my data
i want to show some data from DB. and i'm use ajax to do
I want to display a success msg after finishing an Ajax call. I tried
I want to clear textbox after ajax posting. <div style=padding: 5px; background-color: Silver;> @using
I want to clear textbox after ajax posting. <div style=padding: 5px; background-color: Silver;> @using
I want to select a particular Div after calling a php using $.ajax: my
I want to extract word after first 'from' in the following string- anti-CD24 from
After a merge I want to use git mergetool to resolve the issue but
I want to set timeout after 2 seconds loading data. I am new in
This jquery ui dialog is filled with html and form values from an ajax

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.