Knowing me, I've probably done something wrong, but I was having a look at how parsing data from Javascript to PHP looked like using ajax and it looked fine but it doesn't want to send the data through and update it in my Database.
All that happens is a dialogue box shows up with nothing inside.
AJAX:
$.ajax({
url: 'updateCredits.php',
type: 'GET',
data: {
credits: totalcash
},
success: function(data){
alert(data);
}
});
PHP:
<?php
require 'steamauth/steamauth.php';
include ('steamauth/userInfo.php');
include('mysql/config.php');
if(isset($_SESSION['steamid'], $_GET["credits"])) {
$credits = $_GET['credits'];
mysqli_query($db,"UPDATE set credits = credits + '".$credits."' WHERE steamid = '".$steamprofile['steamid']."'");
} else {
echo 'An Error has occurred, this is either due to you not being logged in or something went wrong!';
}
?>