-
The LEMP software stack is a group of software that can be used to serve dynamic web pages and web applications.
-
A "LAMP" stack is a group of open source software that is typically installed together to enable a server to host dynamic websites and web apps. This term is actually an acronym which represents the Linux operating system, with the Apache web server.ds.
-
Node.js is a JavaScript platform for general-purpose programming that allows users to build network applications quickly. By leveraging JavaScript on both the front- and back-end, development can be more consistent and designed within the same system.
Showing posts with label ajax. Show all posts
Showing posts with label ajax. Show all posts
Sunday, February 23, 2014
Wednesday, February 19, 2014
how to receive data from database using using ajax and php with get method
This Your INDEX.HTML page
<!DOCTYPE html>
<html>
<head>
<script>
function loadXMLDoc()
{
var xmlhttp;
var str=document.search.name.value;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","details.php?name="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>
<form name="search">
<input type="text" name="name">
<button type="button" onclick="loadXMLDoc()">Change Content</button>
</form>
<div id="myDiv"><h2>Let AJAX change this text</h2></div>
</body>
</html>
Create Mysql database with name Details
create table details(name text(10), phone number(12), address text(50));
This Is your server page details.php
<?php
$name=$_GET['name'];
$sql="select * from details where name='$name'";
$r=mysql_query($sql) or die("error".mysql_error);
while($row=mysql_fetch_array($r)){
echo("name".$row['name']."<br>");
echo("phone".$row['phone']."<br>");
echo("address".$row['address']);
}
?>
<!DOCTYPE html>
<html>
<head>
<script>
function loadXMLDoc()
{
var xmlhttp;
var str=document.search.name.value;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","details.php?name="+str,true);
xmlhttp.send();
}
</script>
</head>
<body>
<form name="search">
<input type="text" name="name">
<button type="button" onclick="loadXMLDoc()">Change Content</button>
</form>
<div id="myDiv"><h2>Let AJAX change this text</h2></div>
</body>
</html>
Create Mysql database with name Details
create table details(name text(10), phone number(12), address text(50));
This Is your server page details.php
<?php
$name=$_GET['name'];
$sql="select * from details where name='$name'";
$r=mysql_query($sql) or die("error".mysql_error);
while($row=mysql_fetch_array($r)){
echo("name".$row['name']."<br>");
echo("phone".$row['phone']."<br>");
echo("address".$row['address']);
}
?>
How To recieve a data from other webpage without refresh page
This Your Index Page save As Index.html
<!DOCTYPE html><html>
<head>
<script>
function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","atextfile.txt",true); //atextfile.txt file located on the server ajax send get Response recieve the from it
xmlhttp.send();
}
</script>
</head>
<body>
<div id="myDiv"><h2>Let AJAX change this text</h2></div>
<button type="button" onclick="loadXMLDoc()">Change Content</button>
</body>
</html>
this is your text file and save as atextfile.txt
myname is sandeep soni
What Is Ajax How is work
- AJAX stands for Asynchronous JavaScript and XML. AJAX is a new technique for creating better, faster, and more interactive web applications with the help of XML, HTML, CSS and Java Script.
- Ajax uses XHTML for content and CSS for presentation, as well as the Document Object Model and JavaScript for dynamic content display.
- Conventional web application trasmit information to and from the sever using synchronous requests. This means you fill out a form, hit submit, and get directed to a new page with new information from the server.
- With AJAX when submit is pressed, JavaScript will make a request to the server, interpret the results and update the current screen. In the purest sense, the user would never know that anything was even transmitted to the server.
- XML is commonly used as the format for receiving server data, although any format, including plain text, can be used.
- AJAX is a web browser technology independent of web server software.
- A user can continue to use the application while the client program requests information from the server in the background
- Intuitive and natural user interaction. No clicking required only Mouse movement is a sufficient event trigger.
- Data-driven as opposed to page-driven

Subscribe to:
Posts (Atom)