I have a little problem, I need to send an ajax request to a file. Here is my HTML File (index.html)
<a id="like" href="./?act=like&id=24" title="Nobody likes this post!">Like</a> · <a id="dislike" href="./?act=dislike&id=24" title="Nobody dislikes this post!">Dislike</a>
And my like.php file:
<?php
if(!is_logged()) {
header("Location: ./?act=Home");
die();
}
$uid = $user['id'];
$id = $_GET['id'];
if(isset($id)) {
$query = mysql_query("INSERT INTO ld (auth_id,post_id,val)
VALUES ('".$uid."','".$id."','1')");
if($query) {
header("Location: ".$_SERVER['HTTP_REFERER']);
} else {
echo "Contatta l'amministratore riportando l'errore 101";
}
} else {
header("Location: ./?act=Home");
}
?>
And my "ld" table:
== Struttura della tabella ld
|------
|Campo |Tipo |Null|Predefinito
|------
|//**id**//|int(5) |No |
|auth_id |varchar(5)|No |
|post_id |varchar(5)|No |
|val |varchar(1)|No |
== Dump dei dati per la tabella ld
|5|4|1|1
|6|4|1|1
|7|4|1|1
|8|4|1|1
|9|4|1|1
|10|4|1|1
|12|4|1|1
|13|4|1|1
|14|4|1|2
|20|4|15|1
|23|5|17|1
|29|4|17|1
|30|4|18|1
== Struttura della tabella ld
|------
|Campo |Tipo |Null|Predefinito
|------
|//**id**//|int(5) |No |
|auth_id |varchar(5)|No |
|post_id |varchar(5)|No |
|val |varchar(1)|No |
I really don't know how to send an ajax request, and I have also tried to learn ajax but no way, I can't understand it.