An HTTP POST request is simply an HTTP request that can have any type of data attached to it. You're probably familiar with their use when submitting web forms. This is quite easy...
this is the method syntax we gonna use here:
$(selector).post(URL,data,function(data,status,xhr),dataType)
Here the submit page:
you can use that posted data on submitdatafile.php
You can get more information via jQuery home page.
this is the method syntax we gonna use here:
$(selector).post(URL,data,function(data,status,xhr),dataType)
Here the submit page:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//load jquery file | |
<script src="http://code.jquery.com/jquery-latest.js"></script> | |
//jQuery submit function written here | |
<script type="text/javascript" language="javascript"> | |
function submitIt() { | |
$.post("submitdatafile.php", { pwd: document.getElementById("tbox").value } ); | |
} | |
</script> | |
//HTML code | |
<input type="password" name="tbox" id="tbox"> | |
<input type="button" name="bt" id="bt" value="Submit" onclick="javascript:submitIt()"> |
you can use that posted data on submitdatafile.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// you can use posted data here.. | |
echo $_POST['pwd']; | |
?> |
No comments:
Post a Comment