Hi I have a problem with post
I wrote some codes with php and jquery here is my code
<?php $g= $_POST['g']; ?>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"> </script>
<script>
var g = "<?php echo $g ; ?>" ;
$(document).ready(function(){
if( g == "on" ){
$.post("URL", "ID=4" )
}
if( g == "off" ){
$.get("URL","ID=4");
}
});
</script>
</head>
</html>
if I use another php code like below my jquery codes work(g = on status ) because after clicking it loads above codes and load above page
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<form action="above.php" method="post">
<button type="submit" name="g" value="on">OK
</form>
</body>
</html>
but if I post it with my android app which just posts g and doesn't load the page it doesn't work :(