How to post with out refreshing the page

Ajax POST format: request is post to register.php page. All the database insert , update query is written there. connect with jquery library online using– <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js”></script> Method-1: var myemail = $(“#email”).val(); var mypass = $(“#pass”).val(); var datastring = {’email’:myemail, ‘pass’: mypass }; // AJAX METHOS IS CALLED $.ajax({ url:”register.php”, type:”post”, data: datastring, success:function(data){ alert … Read moreHow to post with out refreshing the page

How to post using ajax

Here is the ajax format to post a request without refresh the page. var datastring = {‘name’:name, ’email’:email, ‘phone’:phone }; $.ajax({ url:”register.php”, type:”post”, data: datastring, }) register.php is the target page, where to send post request using ajax.

Submit Register Form without refreshing the page

<!—- index.php page—-> <html> <body> <!——making jquery library’s link —> <script src=”//code.jquery.com/jquery-1.10.2.js”></script> <script> function validate() { //——–value of fields ——— var name = document.getElementById(“name”).value; var email = document.getElementById(“email”).value; var phone = document.getElementById(“phone”).value; //—— error fields are identified first ——– var error_name_id = document.getElementById(“error_name”); var error_email_id = document.getElementById(“error_email”); var error_phone_id = document.getElementById(“error_phone”); var error_msg = document.getElementById(“error_msg”); … Read moreSubmit Register Form without refreshing the page

Registration Form validation With Javascripts

<html> <body> <script> function validate() { var name = document.getElementById(“name”).value; var email = document.getElementById(“email”).value; var phone = document.getElementById(“phone”).value; var error_name_id = document.getElementById(“error_name”); var error_email_id = document.getElementById(“error_email”); var error_phone_id = document.getElementById(“error_phone”); var error_msg = document.getElementById(“error_msg”); var success_msg = document.getElementById(“success_msg”); error_name_id.innerHTML =””; error_email_id.innerHTML =””; error_phone_id.innerHTML =””; if(name == null || name == “” || name == ” … Read moreRegistration Form validation With Javascripts

How to search data from table in php

———both HTML and php code in s1.php file—————- <form method=”post” action=”s1.php?go” id=”searchform”> <input type=”text” name=”name”> <input type=”submit” name=”submit” value=”Search”> </form>   <?php if (isset($_POST[‘submit’])) { //connect to the database $db = mysql_connect(“localhost”, “root”, “”) or die(‘I cannot connect to the database because: ‘ . mysql_error()); //-select the database to use $mydb = mysql_select_db(“database_name”);if (isset($_GET[‘go’])) {if … Read moreHow to search data from table in php