Search through AJAX PHP

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Search through AJAX PHP



I am implementing search through AJAX. I have a table in which there is record from database.I also have a search bar which search record through that table. The div in which the table is located is reloading after equal interval of time through AJAX call I also want to search through that record with the help of AJAX call without reloading the page can anybody help me.


<?php
include("includes/header.php");
include("../connections/db.php");
?>

<script>
(function(i, s, o, g, r, a, m) function() , i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
)(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-105705952-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<style>
input[type=text],
select,
textarea
width: 18%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
margin-top: 6px;
margin-bottom: 16px;
resize: vertical;

</style>
<body class="home page-template-default page page-id-1557">
<header id="topbar" class="navbar navbar-fixed-top affix-top">
<div class="container">
<div class="navbar-header">
<a href="index.php" class="logo">
<img class="logo-white" src="../images/p3-logo-small.png" alt="" width="89">
<img class="logo-img" src="../images/p3-logo.png" alt="" width="89"> </a>
<div class="mobile-menu-spacer">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
<i class="fa fa-bars"></i>
<i class="fa fa-close"></i>
</button>
</div>
</div>
<div class="collapse navbar-collapse" id="navbar-collapse">
<div id="primary-menu" class="main-menu">
<ul id="menu-hauptmenu" class="nav navbar-nav navbar-right">
<li id="menu-item-2998" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-home current-menu-item page_item page-item-1557 current_page_item menu-item-2998"><a href="../index.php">HOME</a></li>
<li id="menu-item-2996" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2996"><a href="../how-it-works.php">HOW IT WORKS</a></li>
<li id="menu-item-2911" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-2911"><a href="../technology.php">TECHNOLOGY</a>
</li>
<li id="menu-item-2911" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-2911"><a href="../p3-scenarios.php">P3 SCENARIOS</a>
</li>..
<li id="menu-item-2911" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-2911"><a href="../partners.php">PARTNERS</a></li>
<li id="menu-item-2996" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-2996"><a href="../meet-with-us.php">CONTACT US</a></li>
</ul>
</div>
</div>
</div>
</header>
<div class="headers" id="home">
<main class="header section-overlay">
<div class="header-content">
<div class="container">
<div class="col-md-12">
<div class="row masonry-blog">
<a href="pdfDownload.php"><button class="btn btn-default" style="float:right;" id="DownloadPdf">Download Pdf</button></a>
<a href="subscribe.php"><button class="btn btn-default" style="float:right;" id="Subscribers">Subscribers</button></a>
<a href="index.php"><button class="btn btn-default" style="float:right;" id="AddNew">News</button></a>
<br><br><br><br>
<td><a style="float:right;" href="SendMailToAll.php" target="_blank" style="color:black;" class="sendMail" data-role=<?php echo $id; ?> ><button class="btn">Send Mail To All</button></a><br>
<td><input type="text" name="search" style="border-radius:100px;" placeholder="search by email" id="searchTextbox" /><button type="submit" name="submit" class="btn" id="searchbutton">Search</button></td>
<div id="loadData"></div>
<br>
<br>
<br>
</div>
</div>
</div>
</main>
<section class="sec wp-content-section padding-90" id="wp-content_6">
<div class="container">
<article id="post-1557">
<div class="page-content p-full">
<header class="page-header">
<h2>home</h2>
</header>
</div>
</article>
</div>
</section>
<section class="footer-sidebar">
<div class="container">
<div class="row">
<div class="col-md-3">
<aside id="text-2" class="widget-footer widget_text">
<div class="textwidget"><img src="../images/p3-logo-small-black-footer.png" width="89px"></div>
</aside>
</div>
<div class="col-md-3">
<aside id="smallbusiness_cd_social_widget-2" class="widget-footer widget_smallbusiness_cd_social_widget">
<div class="widget-title">Social </div>
<div class="social-widget">
<a href="#" class="fa fa-facebook" target="_blank"></a>
<a href="#" class="fa fa-google-plus" target="_blank"></a>
<a href="#" class="fa fa-twitter" target="_blank"></a>
</div>
</aside> -->
</div>
<div class="col-md-3">
<aside id="linkcat-22" class="widget-footer widget_links">
<div class="widget-title">sitemap</div>
<ul class="xoxo blogroll">
<li><a href="index.php">Home</a></li>
<li><a href="../p3-scenarios.php">P3 scenarios</a></li>
<li><a href="../partners.php">Partners</a></li>
</ul>
</aside>
</div>
<div class="col-md-3">
<aside id="text-3" class="widget-footer widget_text">
<div class="widget-title">Contact</div>
<div class="textwidget">Maarintie 6, 02150, Espoo, FINLAND <br>Tel. +358407400974</div>
</aside>
</div>
</div>
</div>
</section>
</div>
<!-- content end -->
<footer id="footer" class="footer text-center no-profiles">
<div class="container">
<div class="copyright" itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
<!-- <div itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
<img itemprop="url" src="http://taladinvoice.com/wp-content/uploads/2017/01/15886logo02.png" alt="" width="200" />
</div> -->
© 2017 - P3 BY CLOUDASSET
<span itemprop="name">P3 </span>
</div>
</div>
</footer>
<div class="scrolltop"></div>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/wow.min.js"></script>
<script src="../js/jquery.magnific-popup.min.js"></script>
<script src="../js/owl.carousel.min.js"></script>
<script src="../js/main.js"></script>
<script src="../js/custom-js.js"></script>
<script src="../js/wp-embed.min.js"></script>
</body>
</html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
var isset = 0;
$("#PdfDownloads").click(function()
window.location.assign("pdfDownload.php");
);

$("#searchbutton").click(function()
var isset = 1;
var search = $("#searchTextbox").val();
$.ajax(
url: 'search.php',
data:
search: search
,
type: 'post',
success: function(output)
var html = output;
$("#loadData").html(html);

);
);

$(".delete").click(function()
var del_id = $(this).attr('id');
$.ajax(
url: 'deleteEmail.php',
data:
del_id1: del_id
,
type: 'post',
success: function(output)
alert(output);

);
);
</script>
<script>
if (isset != 1)
setInterval(function()
$("#loadData").load('tableData.php');
, 500);

</script>





Your question is far too broad. Tell us about a specific issue you have with the code, and give details about what is not working.
– Rory McCrossan
Aug 10 at 7:22





I want to search through ajax call in the table which is reloading after equal interval of time
– owais latif
Aug 10 at 7:25









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

make 2 or more post in bootsrap

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3

Firebase Auth - with Email and Password - Check user already registered