Created
July 23, 2013 15:01
-
-
Save greg606/6063041 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title> | |
</title> | |
</head> | |
<body> | |
<a href="?akcja=sortuj">Sortuj</a> | |
<form action="" method="post"> | |
<input type="hidden" name="akcja" value="sortuj"> | |
<input type="hidden" name="id" value="<?=$user['id'] ?>"> | |
<input type="submit" value="wyslij"> | |
</form> | |
index.php | |
index.php?akcja=usun&id=1 | |
$_GET | |
<a href="<?=$user['id'] ?>">Usun</a> | |
<script> | |
//usuwanie uzytkownika | |
$(function() { | |
$('a').click(function(e){ | |
e.preventDefault(); | |
jQuery.ajax({ | |
url: '/usun', | |
type: 'POST', | |
dataType: 'json', | |
data: {id: $(this).attr('href')} | |
}); | |
}) | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment