Total members 11889 |It is currently Sun Apr 14, 2024 9:49 pm Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





html code
<html>
<head>
<title>Send parameters using GET method</title>

<!--
 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
 Note you can download the JQuery package instead of using Google version. --> 
<script src="jquery-1.8.3.js"></script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $.get("JQuery.php",
    {
      name:"Tom Andrson",
      age:"34"
    },function(data,status){
      $("div#div1").html("Data: " + data + "\nStatus: " + status);
    });
  });
});
</script>
</head>
<body>

<button>Send using GET</button>
<div id="div1"></div>
</body>
</html>

JQuery.php:
php code
<?php
   if(isset($_GET['name'])){
   $name=$_GET['name'];
   }
   
    if(isset($_GET['age'])){
   $age=$_GET['age'];
   }
   
     echo "<b>Name=</b> $name, <b>Age=</b>$age <br/>"; 
?>




_________________
M. S. Rakha, Ph.D.
Queen's University
Canada


Author:
Mastermind
User avatar Posts: 2715
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : Send parameters using HTTP GET
 Using java in http connection     -  
 HTTP Server in Java     -  
 http proxy code     -  
 Get value from HTTP POST VARS     -  
 How to open http connection using j2me     -  
 HTTP POST msg connection close problem     -  
 Build distribution applications by remoting(TCP/HTTP)     -  
 Multipart HTTP forms submitter - With Progress Information     -  
 Encoding parameters in URL     -  
 Reference Parameters     -  



Topic Tags

JQuery GET/POST






Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com