Error web
Posted: Sun Jan 28, 2018 10:41 am
2274/5000
Hello, first of all to thank for VestaCP. I discovered it by chance and I'm quite happy with it. I have it installed on all my VPS.
I've only had one problem with some websites that happened to relate to see if anyone can tell me what to do to fix it.
You see, two of my websites use a script to launch the title and artist on those websites that are radio stations.
These websites use this code in a .php file
<?php
//get artist/title info
$artist = $_GET['artist'];
$title = $_GET['title'];
//create a temp file to store values for AJAX script
$r = fopen("temp_title.txt", "w");
fwrite($r, $artist." - ".$title);
fclose($r);
?>
This code is inserted in the index where it calls the cacion and artist
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<b>Here you'll see track title:</b>
<!-- begin update track title code -->
<div id="track_name"></div>
<script type="text/javascript">
function UpdateTitle()
{
var xmlhttp;
//get "track name" block
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
var s = xmlhttp.responseText;
document.getElementById('track_name').innerHTML = s;
}
}
//use random number in request to prevent caching
var rand_no = Math.random();
rand_no = rand_no * 100;
//read the "temp_title.txt" file
xmlhttp.open("POST", "/temp_title.txt?"+rand_no, true);
xmlhttp.send();
}
//
setInterval("UpdateTitle()", 1000);
UpdateTitle();
</script>
<!-- end update track title code -->
</body>
</html>
This code is inserted in the index where it calls the cacion and artist and all this is done through the radio broadcast program that writes a .txt file that is also uploaded to the server. The latter is with 777 permissions for reading and writing.
All this worked correctly in cPanel, but when migrating the webs to vesta, they stopped working.
Any ideas?
Thanks and pedon for the novel.
Hello, first of all to thank for VestaCP. I discovered it by chance and I'm quite happy with it. I have it installed on all my VPS.
I've only had one problem with some websites that happened to relate to see if anyone can tell me what to do to fix it.
You see, two of my websites use a script to launch the title and artist on those websites that are radio stations.
These websites use this code in a .php file
<?php
//get artist/title info
$artist = $_GET['artist'];
$title = $_GET['title'];
//create a temp file to store values for AJAX script
$r = fopen("temp_title.txt", "w");
fwrite($r, $artist." - ".$title);
fclose($r);
?>
This code is inserted in the index where it calls the cacion and artist
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<b>Here you'll see track title:</b>
<!-- begin update track title code -->
<div id="track_name"></div>
<script type="text/javascript">
function UpdateTitle()
{
var xmlhttp;
//get "track name" block
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
var s = xmlhttp.responseText;
document.getElementById('track_name').innerHTML = s;
}
}
//use random number in request to prevent caching
var rand_no = Math.random();
rand_no = rand_no * 100;
//read the "temp_title.txt" file
xmlhttp.open("POST", "/temp_title.txt?"+rand_no, true);
xmlhttp.send();
}
//
setInterval("UpdateTitle()", 1000);
UpdateTitle();
</script>
<!-- end update track title code -->
</body>
</html>
This code is inserted in the index where it calls the cacion and artist and all this is done through the radio broadcast program that writes a .txt file that is also uploaded to the server. The latter is with 777 permissions for reading and writing.
All this worked correctly in cPanel, but when migrating the webs to vesta, they stopped working.
Any ideas?
Thanks and pedon for the novel.