Search
 
SCRIPT & CODE EXAMPLE
 

PHP

PHP Example - AJAX Poll

<html>
<head>
<script>
function getVote(int) {
  var xmlhttp=new XMLHttpRequest();
  xmlhttp.onreadystatechange=function() {
    if (this.readyState==4 && this.status==200) {
      document.getElementById("poll").innerHTML=this.responseText;
    }
  }
  xmlhttp.open("GET","poll_vote.php?vote="+int,true);
  xmlhttp.send();
}
</script>
</head>
<body>

<div id="poll">
<h3>Do you like PHP and AJAX so far?</h3>
<form>
Yes: <input type="radio" name="vote" value="0" onclick="getVote(this.value)"><br>
No: <input type="radio" name="vote" value="1" onclick="getVote(this.value)">
</form>
</div>

</body>
</html>
Comment

PREVIOUS NEXT
Code Example
Php :: add reviews from code site reviews wp 
Php :: auto complete order paid1 
Php :: php how to split square bracket and normal sting in a word or sentence 
Php :: laravel like 
Php :: how to concatenate folder name with image in php 
Php :: Undefined array key after unset() 
Php :: get session token in wp_login hook 
Php :: schema key issue laravel 
Php :: Laravel A row must be an array or a TableSeparator instance. 
Php :: how to get file name in upload images in php 
Php :: php check if weekends 
Php :: how to import csv file in laravel 8 
Php :: get_html_translation_table (PHP 4, PHP 5, PHP 7, PHP 8) get_html_translation_table — Returns the translation table 
Php :: cakephp Not Found error handle in pagination 
Php :: 500 Internal Server Error mamp rest api PDO 
Php :: Read the index and hashid of the last block in the blockchain 
Php :: dynamic base url 
Php :: after i migrate wordpress website to new domain I cant login to wordpress admin 
Php :: laravel jobs cache file picking old job file 
Php :: itop cron.php 
Php :: laravel command Retrieve a specific option 
Php :: php code for adding dara 
Php :: mail php send 
Php :: laravel check if pagination is empty 
Php :: amazon linux 2 php.ini changes not working 
Php :: alphabet, link, range 
Php :: laravel class is not recognized in tinker 
Php :: PHP nl2br — Inserts HTML line breaks before all newlines in a string 
Php :: import csv laravel 8 
Php :: conect_from_db_datalayer 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =