Answer the question
In order to leave comments, you need to log in
How to fix script to not cut title after # in PHP ucoz?
Hello everyone, are there any experts in PHP Yukoz ?
There is a script that shows what page the user last viewed.
First, a get request occurs:
<script type="text/javascript">$.get('/php/user_mn/index.php?n='+document.title);</script>
<?php
$___notjson = 1;
$id = ucoz_getinfo("SITEUSERID");
$getid = $_REQUEST['i'];
$n = $_REQUEST['n'];
$name = explode('?', $n);
$url = $_SERVER['HTTP_REFERER'];
if(empty($name[0])){
if(!empty($getid) && file_exists('data/'.$getid.'.dat')){
header('Content-Type: text/html; charset=utf-8');
$file = file_get_contents('data/'.$getid.'.dat');
echo $file;
}else{
echo 'Нет данных...';
}
}else{
$f = fopen('data/'.$id.'.dat', 'w+');
fwrite($f, '<a href="'.$url.'" target="_blank">'.$name[0].'</a>');
fclose($f);
}
?>
<div class="udtb"><div class="udtlb">Последний раз был:</div> <span id="whtl">Загрузка...</span></div>
<script type="text/javascript">$('#whtl').load('/php/user_mn/index.php?i=$_USER_ID$');</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question