phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


PHP - AJAX: Passing GET Parameter

Tag: AJAX, XMLHttpRequest, parameter, GET   Category:
post: 17 Mar 2008 read: 128


PHP AJAX Step By Step Tutorial - part 3: In this post, we will learn using parameters at AJAX. First, We use http parameter: GET. It is so simple, look following code:

  var param1 = document.getElementById("param1").value;
  var param2 = document.getElementById("param2").value;
  
  var params = "param1=" + param1 + "¶m2=" + param2";
	  
  xmlHttp.open("Get","calculation.php?" + params, true);
  xmlHttp.onreadystatechange = handleRequestStateChange;
  xmlHttp.send(null);

Line 1 & 2, we send two parameter: param1 and param2.

Then, line 4, we create a line for finishing the url.

Ok, next post, we will see simple implementation of this.




| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
CAPTCHA - part 3 : "Are you human or ....?" (Build Your CAPTCHA)

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


615
posting