per uppare il sito su altervista basta che copio la cartella "MIOSITO" nel mio spazioweb in altervista????Originariamente inviato da luke83
devi aver abilitato il php, sinceramente nn credo.. nn di default ecco.. mettilo su qlc spazio tipo altervista e testalo...
![]()
poi apro il link della homepage(in cui ho messo il contatore) e dovrebbe apparirmi,giusto???
Io ho scelto questa soluzione:
<?
define(ROOT,"./");
$cont = (int) implode("",file(ROOT.'contatore.txt'));
if (((int) time() - (int) $_COOKIE['contatore'])>=86400){
$h=fopen(ROOT.'contatore.txt','w+');
fwrite($h,++$cont);
fclose($h);
}
setcookie("contatore",time());
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>AltreAttivita</title>
<style type="text/css">
<!--
.Stile1 {font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
.Stile2 {font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
}
-->
</style>
</head>
<body>
<table width="255" height="259" border="0" align="center">
<tr>
<td>[img]immagini/sfondi/uc14.gif[/img]</td>
</tr>
</table>
</p>
<p align="center"><span class="Stile1"><span class="Stile2">Torna alla Homepage </span></span>
<? echo $cont;?>
</p>
</body>
</html>
ho salvato questa pagina con dreamweaver e poi l'ho uppata sullo spazio web ma non compare alcun contatore... :master:
ma per caso dentro la cartella mio sito devo creare un file di testo chiamato contatore.txt???
guarda,questo è quell oche mi appare....![]()
http://papo1.altervista.org/BIOETICA...contatore2.htm
il codice è quello che vedi esattamente sopra..
con l'altra soluzione invece,cioè:
<?
include("contatore.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>AltreAttivita</title>
<style type="text/css">
<!--
.Stile1 {font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
}
.Stile2 {font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
}
-->
</style>
</head>
<body>
<table width="255" height="259" border="0" align="center">
<tr>
<td>[img]immagini/sfondi/uc14.gif[/img]</td>
</tr>
</table>
</p>
<p align="center"><span class="Stile1"><span class="Stile2">Torna alla Homepage </span></span>
<? echo $cont;?> </p>
</body>
</html>
ecco cosa mi appare...
http://papo1.altervista.org/BIOETICA...atore.htm.....
premetto che queste due pagine sono all'interno di una cartella in cui si trova anche il file contatore.ohp il cui codice è:
<CODE>
<CODE><?
define(ROOT,"./");
$cont = (int) implode("",file(ROOT.'contatore.txt'));
if (((int) time() - (int) $_COOKIE['contatore'])>=86400){
$h=fopen(ROOT.'contatore.txt','w+');
fwrite($h,++$cont);
fclose($h);
}
setcookie("contatore",time());
?> </CODE>
</CODE>

Rispondi quotando
).
