So I'm trying to make the simplest of communications between AJAX and PHP, and send a single variable to my PHP, where it will be stored, but nothing seems to work u_u
This here is my AJAX code
$(document).ready(function() {
$("#ch1").click(function(){
document.getElementById('stf').style.visibility="visible";
document.getElementById('ch2').style.visibility="visible";
document.getElementById('reto1').src="slides/reto1_completo.png";
var counter = 1;
var longform = $("input:text").serialize();
$.ajax({
type: GET,
url: 'counter.php',
data: longform + "counter=<?php echo $counter; ?>",
})
})
})
And this one here is my PHP
session_start();
$db = mysql_connect("localhost","db","pass");
if(!$db) die("Error");
mysql_select_db("db",$db);
$counter = $_GET['counter'];
$insert = mysql_query("UPDATE usuarios SET retos='$counter' WHERE email = '$correo'") or die(mysql_error());
So this is it, I'm sure it's the simplest of mistakes, but I just can't figure it out. Thanks in advance