Commit ec4898bc authored by carboncrafters's avatar carboncrafters

various fixes and changes

parent 77e8a4bd
......@@ -211,9 +211,10 @@ if ($result->num_rows > 0) {
$sql = "UPDATE videos SET views=views + 1 WHERE id='$id' ";
if ($conn->query($sql) === TRUE) {
$return["error"]="true";
$return["type"]="410";
$return["description"]="The content referenced with this id was deleted from our servers! Sorry about that :/";
$return["error"]="false";
$return["type"]="200";
$return["description"]="View count is increased";
$return["views"] = $views;
echo json_encode($return);
header("HTTP/1.0 200 Ok");
} else {
......@@ -224,9 +225,7 @@ $sql = "UPDATE videos SET views=views + 1 WHERE id='$id' ";
echo json_encode($return);
header("HTTP/1.0 500 Internal server error");
}
$return["views"] = $views;
echo json_encode($return);
}else{
$return["error"]="true";
$return["type"]="410";
......
......@@ -22,7 +22,7 @@ xmlhttp.onreadystatechange = function() {
document.getElementById("randompw").innerHTML = myObj.randompw;
document.getElementById("infinite").innerHTML = myObj.infinite;
document.getElementById("search").innerHTML = myObj.search;
document.getElementById("login").innerHTML = myObj.login+"<span class=\"glyphicon glyphicon-log-in\"></span>";
document.getElementById("login").innerHTML = "<span class=\"glyphicon glyphicon-log-in\"></span>"+myObj.login;
//document.getElementById("reg").innerHTML = myObj.reg;
document.getElementById("about").innerHTML = myObj.about;
document.getElementById("lng").innerHTML = myObj.lng;
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment