Support MemHT, Vote Now!
MemHT Portal is a Free PHP CMS and Blog
It permit the creation and the management online of websites with few and easy steps.
It's completelly customizable, expandable and suitable for all needs.
     Site demo
Moderators: mem paulo89 adminik
Page 1/3 1 2 3 > >|
RSSReply
ciao mem mi potresti aiutare
AuthorText
rocco.mo
Junior Member
Avatar

Posts: 80
Contributes: 4

Gender: _NEUTRAL_
Online: No
Date: 23/09/2007 18:55
ciao mem mi potresti aiutare
#post1802
ciao mem ho visto che hai messo online l ultima versione la 3.2 ottima l ho gia provata ascolta mem ti vorrei chiedere un aiuto non riesco a vare l output di questo script anzi a dirla tutta sarebbe il numero di utenti online e l ip pero mi fa l output solo del ip ma degli user online non me lo fa ti punto script

code




$server = "localhost";
$db_user = "root";
$db_pass = "";
$database = "3333";
$timeoutseconds = 300;

$timestamp = time();
$timeout = $timestamp-$timeoutseconds;
error_reporting ( E_WARNING | ~ E_NOTICE ) ;
$REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
$PHP_SELF = $_SERVER['PHP_SELF'];
$ip = getenv("REMOTE_ADDR");
mysql_connect($server, $db_user, $db_pass);
$insert = mysql_db_query($database, "INSERT INTO useronline VALUES ('$timestamp','$REMOTE_ADDR','$PHP_SELF')");

if(!($insert)) {
print "Useronline Insert Failed > ";
}

$delete = mysql_db_query($database, "DELETE FROM useronline WHERE timestamp<$timeout");

if(!($delete)) {
print "Useronline Delete Failed > ";
}

$result = mysql_db_query($database, "SELECT DISTINCT ip FROM useronline WHERE file='$PHP_SELF'");

if(!($result)) {
print "Useronline Select Error > ";
}

$user = mysql_num_rows($result);

mysql_close();

mysql_connect($server, $db_user, $db_pass) or die("Connessione non riuscita: " . mysql_error());

if($user == 1) {
print("<b>user online $user</b> ");
} else {
print("<b>users online $user</b> ");
}
echo"</br>";
print("<b>IP adress $ip</b> ");
echo"</br>";
while($useronline = mysql_fetch_array($result)){

$output .= '&ip'.'='.$useronline['ip'];
echo'</br>';
$output .= '&user'.'='.$useronline['user'];

   
}
echo $output;

?>


 
Delete Edit Quote
 
mem
MemHT's Dad
Admin / Developer

Avatar

Posts: 3886
Contributes: 1161

Gender: _MALE_
Online: No

Languages: English, Italian, Macedonian, Serbian
Date: 23/09/2007 19:27
ciao mem mi potresti aiutare
#post1803
$timeout dovrebbe essere $timestamp + $timeoutseconds e non -, così crei un riferimento futuro (adesso + 2 ore esempio)

e poi nel confronto all'interno della query WHERE timestamp>$timeout invece di <, cioè io devo cancellare i dati che sono più vecchi di (adesso + intervallo)

Per come è attualmente lo script, appena inserisci un dato, viene subito cancellato perchè timestamp sarà sempre > $timeout (che diventa minore di timestamp perchè fai timestamp - intervallo)
Image
MemHT Portal - Free PHP CMS and Blog

"Great works are performed, not by strength, but by perseverance."
Samuel Johnson

READ THIS before posting your support question in the forum!
Delete Edit Quote
 
rocco.mo
Junior Member
Avatar

Posts: 80
Contributes: 4

Gender: _NEUTRAL_
Online: No
Date: 23/09/2007 19:43
ciao mem mi potresti aiutare
#post1804
mem mi puoi postare osa devo modi****re per favore e per quanto riguarda l output devo farlo per trasmettere i dati a flash
Delete Edit Quote
 
rocco.mo
Junior Member
Avatar

Posts: 80
Contributes: 4

Gender: _NEUTRAL_
Online: No
Date: 23/09/2007 19:48
Re: ciao mem mi potresti aiutare
#post1805
l' output devo farlo del numero di utenti online e del ip

code
while($useronline = mysql_fetch_array($result)){

$output .= '&ip'.'='.$useronline['ip'];
echo'</br>';
$output .= '&user'.'='.$useronline['user'];

   
}
echo $output;


io ho fotto cosi e mi da solo l ip e non il numero di user online
Delete Edit Quote
 
mem
MemHT's Dad
Admin / Developer

Avatar

Posts: 3886
Contributes: 1161

Gender: _MALE_
Online: No

Languages: English, Italian, Macedonian, Serbian
Date: 23/09/2007 20:00
ciao mem mi potresti aiutare
#post1806
ma tu non inserisci mai nel database un nome utente, la variabile user che hai te proviene dal mysql_num_rows e può essere al massimo un numero
Image
MemHT Portal - Free PHP CMS and Blog

"Great works are performed, not by strength, but by perseverance."
Samuel Johnson

READ THIS before posting your support question in the forum!
Delete Edit Quote
 
mem
MemHT's Dad
Admin / Developer

Avatar

Posts: 3886
Contributes: 1161

Gender: _MALE_
Online: No

Languages: English, Italian, Macedonian, Serbian
Date: 23/09/2007 20:02
ciao mem mi potresti aiutare
#post1807
Non selezioni nemmeno il database mysql Smile Aspetta ti faccio io un piccolo script
Image
MemHT Portal - Free PHP CMS and Blog

"Great works are performed, not by strength, but by perseverance."
Samuel Johnson

READ THIS before posting your support question in the forum!
Delete Edit Quote
 
rocco.mo
Junior Member
Avatar

Posts: 80
Contributes: 4

Gender: _NEUTRAL_
Online: No
Date: 23/09/2007 20:03
ciao mem mi potresti aiutare
#post1808
si ma a me non arriva nessun numero l output del ip me lo da quando faccio una prova mentre il numero utenti non me lo da
Delete Edit Quote
 
rocco.mo
Junior Member
Avatar

Posts: 80
Contributes: 4

Gender: _NEUTRAL_
Online: No
Date: 23/09/2007 20:05
ciao mem mi potresti aiutare
#post1809
cosi mi da il browser
&ip=127.0.0.1&user=
Delete Edit Quote
 
mem
MemHT's Dad
Admin / Developer

Avatar

Posts: 3886
Contributes: 1161

Gender: _MALE_
Online: No

Languages: English, Italian, Macedonian, Serbian
Date: 23/09/2007 20:15
Re: ciao mem mi potresti aiutare
#post1810
non ho testato lo script ma a grandi linee dovrebbe funzionare
Attachment: useronline.php
Image
MemHT Portal - Free PHP CMS and Blog

"Great works are performed, not by strength, but by perseverance."
Samuel Johnson

READ THIS before posting your support question in the forum!
Delete Edit Quote
 
rocco.mo
Junior Member
Avatar

Posts: 80
Contributes: 4

Gender: _NEUTRAL_
Online: No
Date: 23/09/2007 20:19
ciao mem mi potresti aiutare
#post1811
grazie lo provo e ti dico
Delete Edit Quote
 
Reply
Page 1/3 1 2 3 > >|
Tags Cloud
Advertising
News Archive
Language
Help MemHT Portal
Navigator
Search
Users Block
Hi Guest
IP: 38.103.63.60

Username
Password
New files
MemHT Wiki
Friends
MemHT Portal is a free software released under the GNU/GPL License by Miltenovik Manojlo