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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:34:04+00:00 2026-06-14T21:34:04+00:00

Code: query = http://localhost:8080/working_login.php?name= + name + &password= + pass; console.log(query); $.ajax({ type: GET,

  • 0

Code:

query = "http://localhost:8080/working_login.php?name=" + name + "&password=" + pass;
console.log(query);

   $.ajax({
    type: "GET",
    url: query,
 dataType: "script",
 success: function(data){
            console.log(data);
            console.log("success");
        },
error:function (msg) {
            console.log("error on page");
        }           
    });

I am getting undefined in data and as I am returning ‘valid_user’ from the server side made in php, getting error.

Uncaught ReferenceError: valid_user is not defined
 (anonymous function)

Php server side code:

$sql = "SELECT id FROM users WHERE name ='$name' AND password = '$password';"; 
$result = mysql_query($sql) or die('Can not Register user' . $sql );
$rows = mysql_num_rows($result);
if($rows > 0)
{ 
echo("valid_user");
exit();
}
else
{exit("not valid user");} 
  • 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-14T21:34:05+00:00Added an answer on June 14, 2026 at 9:34 pm

    when using the script dataType in the jquery ajax reqeust, the returned result is interpreted as javascript code, but you return plain text

    simply change dataType: "script" to dataType: "text".

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

Sidebar

Related Questions

I want to rewrite http://website.com/?slug=product_info.php&products_id=32 to http://website.com/product_info/32 and I use this code, add_filter('rewrite_rules_array','wp_insertMyRewriteRules'); add_filter('query_vars','wp_insertMyRewriteQueryVars');
Hi I writed a test code as below. <?php $url = 'http://localhost/events/result/cn_index.php?login'; print_r(parse_url($url)); echo
This is my php code........... $root = http://localhost/; $sql = mysql_query(SELECT * FROM mychat
I tried running the following code: (http://localhost/read.php) <html> <body> <?php $link = mysql_connect('localhost', 'root',
var urlsearch = http://192.168.10.113:8080/collective-intellegence/StoreClicks?userid= + userId + &query= + query; //Inserted data in the
curl -H Content-Type: application/json; charset=UTF-8 -d '{username:admin,password:admin}' http://localhost:2990/jira/rest/auth/1/session I used the above query in
I'm having a solr query http://localhost:8080/solr/select/?q=A.I need to read the parameter q in my
I have this code: var query = _cityRepository.GetAll( u => u.PartitionKey == pk &
I am using php code to query to a database and the results will
I am using the php post request example given on http://code.google.com/apis/chart/docs/post_requests.html for generating chart.

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.