<?php
include('app_conn.php');
$rawdata1 = file_get_contents("php://input"); // user=X&action=Y
parse_str($rawdata1,$myarray); //user=x; action=y
$user2 = mysqli_real_escape_string($link,$myarray['user']); //secure it
$action = $myarray['action'];
$giorno= date("Y-m-d"); //today
header("HTTP/1.1 500 Internal Server Error");
echo ' rawdata: '.$rawdata1;
print_r($myarray);
echo ' action:'.$action;
echo ' user: '.$user2;
echo ' giorno: '.$giorno; //everything ok up until this point
if ($user2 = "1")
{$giorno = "2013-12-10";} //use specific date for user=1
echo ' user: '.$user2; //wrong user!! user = 2 becomes user = 1 ????
echo ' giorno: '.$giorno;
exit;
...