Click here to Skip to main content
11,928,352 members (57,974 online)
Rate this:
Please Sign up or sign in to vote.
See more: Javascript Ajax
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" lang="en">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-2" />
<title>Example Ajax GET</title>
<script type="text/javascript"><!--
 function showUser()
    var str = document.getElementById('pid').value;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
     document.getElementById("test").innerHTML = xmlhttp.responseText;
<form action="#" method="post">
Enter Text:<input type="text" id="pid"/>
<input type="submit"  value="save" onclick="showUser();"/>
<div id="test"></div>

$con =mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("ebaynew",$con) or die(mysql_error());
$id = $_GET['q'];
$query ="select * from productdetails where ebayId = $id";
$res = mysql_query($query) or die(mysql_error());
$no = mysql_num_rows($res);
if($no > 0)
    //$msg = "Product Already Exist";
    echo "Product Already Exist";
Posted 22-Mar-13 20:43pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.151126.1 | Last Updated 23 Mar 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100