Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Сегодня набросаю. К полуночи.Для одного сайта,
можешь выложить пример?
$dblocation = "localhost";
$dbname = "";
$dbuser = "";
$dbpasswd = "";
$dbcon = @mysql_connect($dblocation,$dbuser,$dbpasswd);
if (!$dbcon)
{
echo( "<P> DB not connect.</P>" );
exit();
}
if (!@mysql_select_db($dbname, $dbcon))
{
echo( "<P> not connect</P>" );
exit();
}
$query="select count(*) n from copirait where url='".$_SERVER[REQUEST_URI]."'";
$rown=mysql_fetch_array(mysql_query($query));
if($rown[n]>0)// урл есть в базе
{
$result = mysql_query("SELECT * FROM copirait WHERE url='".$_SERVER[REQUEST_URI]."';", $dbcon);
$row = mysql_fetch_array($result);
echo $row['copir'];
}
else
{
//урла нет в базе ancorlist
$query="select count(*) n from ancorlist";
$rown=mysql_fetch_array(mysql_query($query));
$result = mysql_query("SELECT * FROM ancorlist");
mysql_data_seek($result, rand(0,$rown[n]-1));
$row = mysql_fetch_array($result);
$query = "INSERT INTO copirait (url, copir) VALUES ('".$_SERVER[REQUEST_URI]."', '".$row['ancor']."')";
mysql_query($query, $dbcon);
echo $row['ancor'];
};