reloj checador 2
| From: | Dacio Pasarell | Date: | Sat, 08 Jun 2002 04:54:13 +0000 |
| Subject: | reloj checador 2 | ||
| Groups: | php.general.es | ||
| Request: | Send a blank email to general-es+get-23553@lists.php.net to get a copy of this message | ||
Hola soy yo de nuevo esta vez le mando mi progreso porque no he logrado que jale, de nuevo po si les interesa tengo que hacer un registro de accesos a un pag. web y guardarlos en Mysql.
esto incluso me ha llegado a desesperar a si que necesito ayuda urgentemente.
gracias.
les anexo los archivos que uso:
config.inc.php
<?
$db_hostname = "localhost";
$db_user = "far";
$db_password = "pass";
$db_name = "far";
?>
-------------------------------------
functions.inc.php
<?
//session_name ("enviar" );
//session_start();
include "gettime.php";
include "getdate.php";
$fecha = date("Ymd");
$time = date("H:i:s");
include "config.inc.php";
/*include "tablas.php";*/
function db_connect()
{
global $db_hostname,$db_user,$db_password,$db_name;
$link= @mysql_pconnect($db_hostname,$db_user,$db_password);
if($link && mysql_select_db ("far"))
return ($link);
return(FALSE);
// die "ERROR";} function create_top($Title) { print("<html>"); print("<header>"); print("<Title>$Title </Title>"); print("</header>"); print("<body bg=black>"); } ---------------------------------------------- getdate.php $today = getdate(); $month = $today['mes']; $mday = $today['dia']; $year = $today['año']; ------------------------------------ gettime.php function wait($usecs){ $temp=gettimeofday(); $start=(int)$temp["usec"]; while(1){
$temp=gettimeofday();
$stop=(int)$temp["usec"];
if ($stop-$start >= $usecs) break;
}
}
---------------------------------------------------
putdatosenbd.php
<?
include "functions.inc.php";
db_connect();
$query="SELECT * FROM visitantes";
$result=mysql_query($query);
//$query2="SELECT No_visita FROM contador";
//$result2=mysql_query($query2);
print $query;
print $query2;
print $result2;
print "<CENTER>";
print "<TABLE BORDER=1>";
while($row = mysql_fetch_array($result))
{
print "<TR>";
print "<TD>";
print $row["Esta es la vez #"];
print "</TD>";
//print "gettimeofday()";
//print "getdate()";
//include "includes/functions.inc.php";
db_connect();
$query="INSERT gettimeofday INTO checador (Hora_entrada)";
echo "<br>";
print("Gracias por logearte");
$r=mysql_query($query);
if (!$r)
die (" Por favor intentalo de nuevo en tu explorador");
}
?>
----------------------------------------------------
tablas.php
CREATE TABLE visitantes
(
nombre varchar (40),); CREATE TABLE checador (
apellido varchar (40), telefono varchar (20), Hora entrada varchar (20), Equipo varchar (4),No_visita varchar (100), ); --------------------------------------------- Por favor si pudieran corregir los errores e indicarme como corregirlos me ayudarian bastante gracias _________________________________________________________________ Únase con MSN Hotmail al servicio de correo electrónico más grande del mundo. http://www.hotmail.com