Fóruns sobre PHP, JavaScript, HTML, MySQLi, jQuery, Banco de Dados, CSS


Moderador: web

 
Mais de 100 postagens
Mais de 100 postagens
Tópico Autor
Mensagens: 448

Erro com contador de tempo online.

27-03-2016 02:17

O usuário que fica online no sistema tem um contador de tempo, do nada se o usuário após algumas horas atualiza com o botão f5 aparece a seguinte mensagem

Código de erro que aparece na tela

Time string must be either in the format "HH:MM:SS" or in the "HH:MM:SS:CC" format. Hours, minutes and seconds are all REQUIRED, as are the leading zeros, if any. Centiseconds are entirely optional, even if showCenti is true.

Código inteiro do js.

(function(){var $;$=jQuery;$.fn.jsclock=function(sTime,oConfig){var sCurrentTime,that;that=this;sCurrentTime="";if(oConfig==null){oConfig={};}$.fn.jsclock.getTime=function(){return sCurrentTime;};$.fn.jsclock.stopClock=function(){return oConfig.stopClock=true;};$.fn.jsclock.startClock=function(){if(oConfig.stopClock===true){oConfig.stopClock=false;if(sTime===null){return that.jsclock(sTime,oConfig);}else{return that.jsclock(sCurrentTime,oConfig);}}};$.fn.jsclock.toggleClock=function(){if(oConfig.stopClock===true){return that.jsclock.startClock();}else{return that.jsclock.stopClock();}};return this.each(function(){var aTime,clientClock,clockwork,iCurrentCenti,iCurrentHour,iCurrentMinute,iCurrentSecond,rValidateTimeString,reverseClockwork,updateTimeString;if(typeof sTime==="object"){oConfig=sTime;sTime=null;}iCurrentHour=0;iCurrentMinute=0;iCurrentSecond=0;iCurrentCenti=0;updateTimeString=function(){var addLeadingZero;addLeadingZero=function(iTimeStringFragment){if(iTimeStringFragment<10&&iTimeStringFragment.length!==2){iTimeStringFragment="0"+iTimeStringFragment;}return iTimeStringFragment;};iCurrentHour=addLeadingZero(iCurrentHour);iCurrentMinute=addLeadingZero(iCurrentMinute);iCurrentSecond=addLeadingZero(iCurrentSecond);iCurrentCenti=addLeadingZero(iCurrentCenti);if(oConfig.showCenti===true){sCurrentTime=""+iCurrentHour+":"+iCurrentMinute+":"+iCurrentSecond+":"+iCurrentCenti;}else{sCurrentTime=""+iCurrentHour+":"+iCurrentMinute+":"+iCurrentSecond;}that.html(sCurrentTime);if(oConfig.stopClock===true){return clearTimeout(clockLoop);}};rValidateTimeString=/^(([01][0-9])|(2[0-3])):[0-5][0-9]:[0-5][0-9](:[0-9][0-9])?$/i;if(oConfig.countdown!=null){if(typeof oConfig.countdown!=="boolean"){that.html('countdown value must either be "true" or "false".');return false;}}if(oConfig.showCenti!=null){if(typeof oConfig.showCenti!=="boolean"){that.html('showCenti value must either be "true" or "false".');return false;}}if(oConfig.callback!=null){if(typeof oConfig.callback!=="function"){that.html('callback must be a function!');return false;}}if(sTime){if(rValidateTimeString.test(sTime)){aTime=sTime.split(':');iCurrentHour=aTime[0];iCurrentMinute=aTime[1];iCurrentSecond=aTime[2];iCurrentCenti=aTime[3];if(oConfig.countdown===true){reverseClockwork=function(){var baseclock,fullclock,simpleclock;baseclock=function(){if(iCurrentSecond>0){return iCurrentSecond--;}else{iCurrentSecond=59;if(iCurrentMinute>0){return iCurrentMinute--;}else{iCurrentMinute=59;if(iCurrentHour>0){return iCurrentHour--;}else{if(typeof oConfig.callback==="function"){oConfig.callback.call(that);return clearTimeout(clockloop);}else{return iCurrentHour=23;}}}}};simpleclock=function(){var clockloop;updateTimeString();baseclock();return clockloop=setTimeout(simpleclock,1000);};fullclock=function(){var clockloop;if(iCurrentCenti>0){iCurrentCenti--;}else{iCurrentCenti=99;baseclock();}updateTimeString();return clockloop=setTimeout(fullclock,10);};if(oConfig.showCenti===true){return fullclock();}else{return simpleclock();}};return reverseClockwork();}else{clockwork=function(){var baseclock,fullclock,simpleclock;baseclock=function(){if(iCurrentSecond<59){return iCurrentSecond++;}else{iCurrentSecond=0;if(iCurrentMinute<59){return iCurrentMinute++;}else{iCurrentMinute=0;if(iCurrentHour<23){return iCurrentHour++;}else{return iCurrentHour=0;}}}};simpleclock=function(){var clockLoop;baseclock();updateTimeString();return clockLoop=setTimeout(simpleclock,1000);};fullclock=function(){var clockLoop;if(iCurrentCenti<99){iCurrentCenti++;}else{iCurrentCenti=0;baseclock();}updateTimeString();return clockLoop=setTimeout(fullclock,10);};if(oConfig.showCenti===true){return fullclock();}else{return simpleclock();}};return clockwork();}}else{return that.html('Time string <strong>must</strong> be either in the format "HH:MM:SS" or in the "HH:MM:SS:CC" format. Hours, minutes and seconds are all <strong>REQUIRED</strong>, as are the leading zeros, if any. Centiseconds are entirely optional, even if showCenti is true.');}}else{if(oConfig.countdown===true){that.html('You must specify a time string to countdown from!');return false;}else{clientClock=function(){var baseclock,fullclock,simpleclock;baseclock=function(){var oCurrentDate;oCurrentDate=new Date();iCurrentHour=oCurrentDate.getHours();iCurrentMinute=oCurrentDate.getMinutes();return iCurrentSecond=oCurrentDate.getSeconds();};simpleclock=function(){var clockLoop;baseclock();updateTimeString();return clockLoop=setTimeout(simpleclock,1000);};fullclock=function(){var bFirstTime,oCurrentDate;if(typeof bFirstTime!="undefined"&&bFirstTime!==null){if(iCurrentCenti<99){iCurrentCenti++;}else{iCurrentCenti=0;baseclock();}}else{baseclock();oCurrentDate=new Date();iCurrentCenti=oCurrentDate.getMilliseconds().toString().substr(0,2);bFirstTime=true;}updateTimeString();return setTimeout(fullclock,10);};if(oConfig.showCenti===true){return fullclock();}else{return simpleclock();}};return clientClock();}}});};}).call(this);

acabei de descobrir algo se o usuário ficar mais de 10 horas online ele para de contar o tempo e da a mensagem que eu coloquei acima, tem como resolver o problema ? obrigado
0
 
Avatar do usuário
ADMIN
ADMIN
Mensagens: 17736
Nome: Kleber
Descrição do site: Onde você encontra scripts grátis para o seu site
Sexo: Masculino
Localização: RJ / RJ / Brasil
Contato:

Re: Erro com contador de tempo online.

27-03-2016 02:52

Pelo erro provavelmente a variável de tempo se perde. Tem como postar o script completo para eu testar aqui localmente?
0
A melhor hospedagem para o seu site HostGator!
 
Mais de 100 postagens
Mais de 100 postagens
Tópico Autor
Mensagens: 448

Re: Erro com contador de tempo online.

28-03-2016 03:12

jsclock-0.8.js
/*! * JS Clock - jQuery Plugin version 0.8 * http://thiago-cavalcanti.github.com/JS-Clock/ * * Copyright (c) 2010 Thiago Cavalcanti Pimenta. * Dual licensed under the MIT and GPL version 3 licenses. * Check mit.txt and gpl.txt on this distribution for the respective * licensing text. * * Date: 2011-01-29 (Sat, 29 Jan 2011) */ (function() { var $; $ = jQuery; $.fn.jsclock = function(sTime, oConfig) { var sCurrentTime, that; that = this; sCurrentTime = ""; if (oConfig == null) { oConfig = {}; } $.fn.jsclock.getTime = function() { return sCurrentTime; }; $.fn.jsclock.stopClock = function() { return oConfig.stopClock = true; }; $.fn.jsclock.startClock = function() { if (oConfig.stopClock === true) { oConfig.stopClock = false; if (sTime === null) { return that.jsclock(sTime, oConfig); } else { return that.jsclock(sCurrentTime, oConfig); } } }; $.fn.jsclock.toggleClock = function() { if (oConfig.stopClock === true) { return that.jsclock.startClock(); } else { return that.jsclock.stopClock(); } }; return this.each(function() { var aTime, clientClock, clockwork, iCurrentCenti, iCurrentHour, iCurrentMinute, iCurrentSecond, rValidateTimeString, reverseClockwork, updateTimeString; if (typeof sTime === "object") { oConfig = sTime; sTime = null; } iCurrentHour = 0; iCurrentMinute = 0; iCurrentSecond = 0; iCurrentCenti = 0; updateTimeString = function() { var addLeadingZero; addLeadingZero = function(iTimeStringFragment) { if (iTimeStringFragment < 10 && iTimeStringFragment.length !== 2) { iTimeStringFragment = "0" + iTimeStringFragment; } return iTimeStringFragment; }; iCurrentHour = addLeadingZero(iCurrentHour); iCurrentMinute = addLeadingZero(iCurrentMinute); iCurrentSecond = addLeadingZero(iCurrentSecond); iCurrentCenti = addLeadingZero(iCurrentCenti); if (oConfig.showCenti === true) { sCurrentTime = "" + iCurrentHour + ":" + iCurrentMinute + ":" + iCurrentSecond + ":" + iCurrentCenti; } else { sCurrentTime = "" + iCurrentHour + ":" + iCurrentMinute + ":" + iCurrentSecond; } that.html(sCurrentTime); if (oConfig.stopClock === true) { return clearTimeout(clockLoop); } }; rValidateTimeString = /^(([01][0-9])|(2[0-3])):[0-5][0-9]:[0-5][0-9](:[0-9][0-9])?$/i; if (oConfig.countdown != null) { if (typeof oConfig.countdown !== "boolean") { that.html('countdown value must either be "true" or "false".'); return false; } } if (oConfig.showCenti != null) { if (typeof oConfig.showCenti !== "boolean") { that.html('showCenti value must either be "true" or "false".'); return false; } } if (oConfig.callback != null) { if (typeof oConfig.callback !== "function") { that.html('callback must be a function!'); return false; } } if (sTime) { if (rValidateTimeString.test(sTime)) { aTime = sTime.split(':'); iCurrentHour = aTime[0]; iCurrentMinute = aTime[1]; iCurrentSecond = aTime[2]; iCurrentCenti = aTime[3]; if (oConfig.countdown === true) { reverseClockwork = function() { var baseclock, fullclock, simpleclock; baseclock = function() { if (iCurrentSecond > 0) { return iCurrentSecond--; } else { iCurrentSecond = 59; if (iCurrentMinute > 0) { return iCurrentMinute--; } else { iCurrentMinute = 59; if (iCurrentHour > 0) { return iCurrentHour--; } else { if (typeof oConfig.callback === "function") { oConfig.callback.call(that); return clearTimeout(clockloop); } else { return iCurrentHour = 23; } } } } }; simpleclock = function() { var clockloop; updateTimeString(); baseclock(); return clockloop = setTimeout(simpleclock, 1000); }; fullclock = function() { var clockloop; if (iCurrentCenti > 0) { iCurrentCenti--; } else { iCurrentCenti = 99; baseclock(); } updateTimeString(); return clockloop = setTimeout(fullclock, 10); }; if (oConfig.showCenti === true) { return fullclock(); } else { return simpleclock(); } }; return reverseClockwork(); } else { clockwork = function() { var baseclock, fullclock, simpleclock; baseclock = function() { if (iCurrentSecond < 59) { return iCurrentSecond++; } else { iCurrentSecond = 0; if (iCurrentMinute < 59) { return iCurrentMinute++; } else { iCurrentMinute = 0; if (iCurrentHour < 23) { return iCurrentHour++; } else { return iCurrentHour = 0; } } } }; simpleclock = function() { var clockLoop; baseclock(); updateTimeString(); return clockLoop = setTimeout(simpleclock, 1000); }; fullclock = function() { var clockLoop; if (iCurrentCenti < 99) { iCurrentCenti++; } else { iCurrentCenti = 0; baseclock(); } updateTimeString(); return clockLoop = setTimeout(fullclock, 10); }; if (oConfig.showCenti === true) { return fullclock(); } else { return simpleclock(); } }; return clockwork(); } } else { return that.html('Time string <strong>must</strong> be either in the format\ "HH:MM:SS" or in the "HH:MM:SS:CC" format. Hours, minutes and \ seconds are all <strong>REQUIRED</strong>, as are the leading zeros, \ if any. Centiseconds are entirely optional, even if showCenti is \ true.'); } } else { if (oConfig.countdown === true) { that.html('You must specify a time string to countdown from!'); return false; } else { clientClock = function() { var baseclock, fullclock, simpleclock; baseclock = function() { var oCurrentDate; oCurrentDate = new Date(); iCurrentHour = oCurrentDate.getHours(); iCurrentMinute = oCurrentDate.getMinutes(); return iCurrentSecond = oCurrentDate.getSeconds(); }; simpleclock = function() { var clockLoop; baseclock(); updateTimeString(); return clockLoop = setTimeout(simpleclock, 1000); }; fullclock = function() { var bFirstTime, oCurrentDate; if (typeof bFirstTime != "undefined" && bFirstTime !== null) { if (iCurrentCenti < 99) { iCurrentCenti++; } else { iCurrentCenti = 0; baseclock(); } } else { baseclock(); oCurrentDate = new Date(); iCurrentCenti = oCurrentDate.getMilliseconds().toString().substr(0, 2); bFirstTime = true; } updateTimeString(); return setTimeout(fullclock, 10); }; if (oConfig.showCenti === true) { return fullclock(); } else { return simpleclock(); } }; return clientClock(); } } }); }; }).call(this);


jsclock-0.8.min.js
/*! * JS Clock - jQuery Plugin version 0.8 * http://thiago-cavalcanti.github.com/JS-Clock/ * * Copyright (c) 2010 Thiago Cavalcanti Pimenta. * Dual licensed under the MIT and GPL version 3 licenses. * Check mit.txt and gpl.txt on this distribution for the respective * licensing text. * * Date: 2011-01-29 (Sat, 29 Jan 2011) */ (function(){var $;$=jQuery;$.fn.jsclock=function(sTime,oConfig){var sCurrentTime,that;that=this;sCurrentTime="";if(oConfig==null){oConfig={};}$.fn.jsclock.getTime=function(){return sCurrentTime;};$.fn.jsclock.stopClock=function(){return oConfig.stopClock=true;};$.fn.jsclock.startClock=function(){if(oConfig.stopClock===true){oConfig.stopClock=false;if(sTime===null){return that.jsclock(sTime,oConfig);}else{return that.jsclock(sCurrentTime,oConfig);}}};$.fn.jsclock.toggleClock=function(){if(oConfig.stopClock===true){return that.jsclock.startClock();}else{return that.jsclock.stopClock();}};return this.each(function(){var aTime,clientClock,clockwork,iCurrentCenti,iCurrentHour,iCurrentMinute,iCurrentSecond,rValidateTimeString,reverseClockwork,updateTimeString;if(typeof sTime==="object"){oConfig=sTime;sTime=null;}iCurrentHour=0;iCurrentMinute=0;iCurrentSecond=0;iCurrentCenti=0;updateTimeString=function(){var addLeadingZero;addLeadingZero=function(iTimeStringFragment){if(iTimeStringFragment<10&&iTimeStringFragment.length!==2){iTimeStringFragment="0"+iTimeStringFragment;}return iTimeStringFragment;};iCurrentHour=addLeadingZero(iCurrentHour);iCurrentMinute=addLeadingZero(iCurrentMinute);iCurrentSecond=addLeadingZero(iCurrentSecond);iCurrentCenti=addLeadingZero(iCurrentCenti);if(oConfig.showCenti===true){sCurrentTime=""+iCurrentHour+":"+iCurrentMinute+":"+iCurrentSecond+":"+iCurrentCenti;}else{sCurrentTime=""+iCurrentHour+":"+iCurrentMinute+":"+iCurrentSecond;}that.html(sCurrentTime);if(oConfig.stopClock===true){return clearTimeout(clockLoop);}};rValidateTimeString=/^(([01][0-9])|(2[0-3])):[0-5][0-9]:[0-5][0-9](:[0-9][0-9])?$/i;if(oConfig.countdown!=null){if(typeof oConfig.countdown!=="boolean"){that.html('countdown value must either be "true" or "false".');return false;}}if(oConfig.showCenti!=null){if(typeof oConfig.showCenti!=="boolean"){that.html('showCenti value must either be "true" or "false".');return false;}}if(oConfig.callback!=null){if(typeof oConfig.callback!=="function"){that.html('callback must be a function!');return false;}}if(sTime){if(rValidateTimeString.test(sTime)){aTime=sTime.split(':');iCurrentHour=aTime[0];iCurrentMinute=aTime[1];iCurrentSecond=aTime[2];iCurrentCenti=aTime[3];if(oConfig.countdown===true){reverseClockwork=function(){var baseclock,fullclock,simpleclock;baseclock=function(){if(iCurrentSecond>0){return iCurrentSecond--;}else{iCurrentSecond=59;if(iCurrentMinute>0){return iCurrentMinute--;}else{iCurrentMinute=59;if(iCurrentHour>0){return iCurrentHour--;}else{if(typeof oConfig.callback==="function"){oConfig.callback.call(that);return clearTimeout(clockloop);}else{return iCurrentHour=23;}}}}};simpleclock=function(){var clockloop;updateTimeString();baseclock();return clockloop=setTimeout(simpleclock,1000);};fullclock=function(){var clockloop;if(iCurrentCenti>0){iCurrentCenti--;}else{iCurrentCenti=99;baseclock();}updateTimeString();return clockloop=setTimeout(fullclock,10);};if(oConfig.showCenti===true){return fullclock();}else{return simpleclock();}};return reverseClockwork();}else{clockwork=function(){var baseclock,fullclock,simpleclock;baseclock=function(){if(iCurrentSecond<59){return iCurrentSecond++;}else{iCurrentSecond=0;if(iCurrentMinute<59){return iCurrentMinute++;}else{iCurrentMinute=0;if(iCurrentHour<23){return iCurrentHour++;}else{return iCurrentHour=0;}}}};simpleclock=function(){var clockLoop;baseclock();updateTimeString();return clockLoop=setTimeout(simpleclock,1000);};fullclock=function(){var clockLoop;if(iCurrentCenti<99){iCurrentCenti++;}else{iCurrentCenti=0;baseclock();}updateTimeString();return clockLoop=setTimeout(fullclock,10);};if(oConfig.showCenti===true){return fullclock();}else{return simpleclock();}};return clockwork();}}else{return that.html('Time string <strong>must</strong> be either in the format "HH:MM:SS" or in the "HH:MM:SS:CC" format. Hours, minutes and seconds are all <strong>REQUIRED</strong>, as are the leading zeros, if any. Centiseconds are entirely optional, even if showCenti is true.');}}else{if(oConfig.countdown===true){that.html('You must specify a time string to countdown from!');return false;}else{clientClock=function(){var baseclock,fullclock,simpleclock;baseclock=function(){var oCurrentDate;oCurrentDate=new Date();iCurrentHour=oCurrentDate.getHours();iCurrentMinute=oCurrentDate.getMinutes();return iCurrentSecond=oCurrentDate.getSeconds();};simpleclock=function(){var clockLoop;baseclock();updateTimeString();return clockLoop=setTimeout(simpleclock,1000);};fullclock=function(){var bFirstTime,oCurrentDate;if(typeof bFirstTime!="undefined"&&bFirstTime!==null){if(iCurrentCenti<99){iCurrentCenti++;}else{iCurrentCenti=0;baseclock();}}else{baseclock();oCurrentDate=new Date();iCurrentCenti=oCurrentDate.getMilliseconds().toString().substr(0,2);bFirstTime=true;}updateTimeString();return setTimeout(fullclock,10);};if(oConfig.showCenti===true){return fullclock();}else{return simpleclock();}};return clientClock();}}});};}).call(this);

página do código (info_bemvindo.php)
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <div id="info_bemvindo"> <?php $usuario = $_SESSION['MM_Username']; $boas_vindas = mysql_query("SELECT * FROM up_users WHERE usuario = '$usuario'") or die(mysql_error()); if(@mysql_num_rows($boas_vindas) <= '0') echo 'Erro ao selecionar o usuário'; else{ while($res_boas_vindas=mysql_fetch_array($boas_vindas)){ $id = $res_boas_vindas[id]; $nome = $res_boas_vindas[nome_p]; $email = $res_boas_vindas[email]; ?> <strong>Bem-vindo</strong> <?php /*echo $nome;*/ ?> <br /> <?php include $_SERVER['DOCUMENT_ROOT'].URL_PATH_C.'scripts/dataehora.php'; ?> <?php } } ?> </div> <div id="info_bemvindo_painel"> <?php /*echo $_SESSION['id'] .'<br>' ; echo $_SESSION['nome_p'] .'<br>'; echo $_SESSION['nome_i'] .'<br>';*/ //ONLINES $id = $_SESSION['id']; $sql_o = mysql_query("SELECT * FROM usuarios_online WHERE id_usuario = '$id'"); $sql_on = mysql_query("SELECT * FROM usuarios_online"); $total_online = mysql_num_rows($sql_on); //VISITAS $sql_v = mysql_query("SELECT visitas FROM contador LIMIT 1"); $d_v = mysql_fetch_object($sql_v); $total_visitas = $d_v->visitas; echo "<div style='float:left;margin-right:30px;'><i class='icon-append fa fa-bar-chart' title='Total de Visítas'></i>: ".$total_visitas."<br>"."</div>"; echo "<div style='float:left;margin-right:30px;'><i class='icon-append fa fa-users' title='Usuários Online' style='float:left; '></i><i class='fa fa-circle' title='Usuários Online' style='font-size:12px; float:left; margin-left:-1px; color:#00CD17; margin-top:3px; '></i>: ".$total_online."<br>"."</div>"; while($t_o = mysql_fetch_array($sql_o)){ $datahora = $t_o['tempo']; $horabanco = substr($datahora, 10, 10); $horaatual = date('H:i:s'); $nDiff = strtotime($horaatual) - strtotime($horabanco); $nHour = round($nDiff / 3600, 2); $nMin = round(($nDiff / 60) % 60, 2); $nSeg = round($nDiff % 60, 2); $nomep = $t_o['nome_p']; $nomei = $t_o['nome_i']; } if(empty($nomep)) { echo '<div style="float:left;margin-right:30px;"><i class="fa fa-user" title="Usuário" style="color:#1FBB00;"></i>: '.$nomei."</div>"; } else { echo '<div style="float:left;margin-right:30px;"><i class="fa fa-user" title="Usuário" style="color:#1FBB00;"></i>: '.$nomep."</div>"; } ?> <script src="<?php include $_SERVER['DOCUMENT_ROOT'].URL_PATH_C.""; ?>jsclock-0.8.min.js "></script> <script> $(document).ready(function(){ $('#tempoonline').jsclock('<?php $tempo_online = (printf("%02d:%02d:%02d", $nHour, $nMin, $nSeg)); ?>'); }); </script> <div style="margin-right:5px;float:left "> <i class="icon-append fa fa-user" title='Tempo Online' style=" float:left;"></i> <i class="icon-append fa fa-clock-o" title='Tempo Online' style="font-size:15px; float:left; margin-left:-1px; color:#FF0004;"></i> :</div> <div id="tempoonline" style="float:left;"></div> <div style="clear:both;"></div> </div>

0
 
Avatar do usuário
ADMIN
ADMIN
Mensagens: 17736
Nome: Kleber
Descrição do site: Onde você encontra scripts grátis para o seu site
Sexo: Masculino
Localização: RJ / RJ / Brasil
Contato:

Re: Erro com contador de tempo online.

28-03-2016 09:17

O valor de $tempo_online não deveria estar no echo dentro da chamada jQuery?

<?php echo (printf("%02d:%02d:%02d", $nHour, $nMin, $nSeg)); ?>

Também notei que você usa SESSION para a consulta. E é dai que você obtém os valores para o contador.

Provavelmente a SESSION termina, a consulta fica nula, e sem retornar valores o contador deixa de funcionar.

Talvez você solucionaria esse problema usando COOKIE ao invés de SESSION. Porque a SESSION quando fecha o navegador você acaba perdendo ela algumas vezes. Já o COOKIE não.
0
A melhor hospedagem para o seu site HostGator!
 
Mais de 100 postagens
Mais de 100 postagens
Tópico Autor
Mensagens: 448

Re: Erro com contador de tempo online.

28-03-2016 15:27

certo como eu faria essas mudanças ?
0
 
Mais de 100 postagens
Mais de 100 postagens
Tópico Autor
Mensagens: 448

Re: Erro com contador de tempo online.

28-03-2016 15:29

como eu coloco dentro da chamada jquery ? obrigado
0
 
Avatar do usuário
ADMIN
ADMIN
Mensagens: 17736
Nome: Kleber
Descrição do site: Onde você encontra scripts grátis para o seu site
Sexo: Masculino
Localização: RJ / RJ / Brasil
Contato:

Re: Erro com contador de tempo online.

28-03-2016 15:36

Pelo que entendi o problema está sendo que a SESSION termina e o valor não é mais exibido. Então o foco é no valor da SESSION.

Pelo que vejo você usa dois valores de SESSION: $_SESSION['MM_Username'] e $_SESSION['id']

Você precisa salvar os valores em COOKIES, dá uma olhada nesse link Erro-com-cookie-cookie-nao-funciona-com ... _9644.html

Ai no seu script com os valores já salvos no COOKIE você vai só fazer a troca:

$_SESSION['MM_Username'] e $_SESSION['id']

por

$_COOKIE['MM_Username'] e $_COOKIE['id']
0
A melhor hospedagem para o seu site HostGator!

Quem está online

Usuários navegando neste fórum: Bing [Bot]