$value){ $str_r[$key] = trim($value); $str_r[$key] = addslashes($str_r[$key]); } }else{ $str_r = trim($str); } return $str_r; } function insert_db($tabla, $columna, $valor){ $valor = para_db($valor); if(is_array($valor)){ $columna = implode(",", $columna); $valor = implode("','", $valor); $valor = "'".$valor."'"; } query("INSERT INTO $tabla ($columna) VALUES ($valor)"); return mysql_insert_id(); } function query($query){ if(!($r = mysql_query($query))) echo('No se puede hacer el query
'.$query.'
'.mysql_error()); return $r; } function fetch_array($query){ $r = mysql_fetch_array($query); return $r; } function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = ""){ $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } function existe_db($tabla, $campo, $valor){ $valor = addslashes($valor); $r = query("SELECT id FROM $tabla where $campo = '$valor' limit 1"); $re = @mysql_num_rows($r); if($re) return true; else return false; } ?>\n"; $headers .= "Return-path: "."webmaster@toptotal.com"."\n"; $headers .= "Reply-To: "."webmaster@toptotal.com"."\n"; $headers .= "X-Mailer: PHP/". phpversion()."\n"; $headers .= "Content-Type: text/html; charset=\"ISO-8859-1\"\n"; mail( $recipient, $subject, $mensaje ,$headers ); } } ?> 10) $semilla = substr($semilla,0,5); return $semilla; } ?>59){$H++; $m=0; if($H>23){$H=0; } } $m++; } if(($m<$minutos ) || ($H!=$hora )){ $r=query("select * from sesiones order by id asc "); while($row = fetch_array($r)){ $ID=$row['id']; query("delete from sesiones where id='$ID'"); } } if(getenv("HTTP_X_FORWARDED_FOR")) $ip = getenv("HTTP_X_FORWARDED_FOR"); else $ip = getenv("REMOTE_ADDR"); $r=query("select * from sesiones WHERE ip='$ip' "); $row = fetch_array($r); $M=$row['Ip']; if($M=='') query("INSERT INTO sesiones (ip,usuario,hora,minutos) VALUES ('$ip','Anonimo','$hora','$minutos')"); } ?> Top total