continuamos
bien ahora creamos estos otros
confirm.php
Código PHP:
Ver original<?php
require_once('db.php');
include('functions.php');
if($_GET['ID']!='' && numeric
($_GET['ID'])==TRUE && strlen($_GET['key'])==32 && alpha_numeric
($_GET['key'])==TRUE) {
{
if($row['Active']==1)
{
echo "&error=".$error = 'This member is already active !';
}
elseif($row['Random_key']!=$_GET['key'])
{
echo "&error=".$error = 'The confirmation key that was generated for this member does not match with the one entered !';
}
else
{
$msg = 'Congratulations ! You just confirmed your membership !';
}
}
else {
echo "&error=".$error = 'User not found !';
}
}
else {
$error = 'Invalid data provided !';
}
{
echo "&error=".$error;
}
else {
echo "&msg=".$msg;
}
?>
este otro
confirm_password.php
Código PHP:
Ver original<?php
require_once('db.php');
include('functions.php');
{
if($row['Temp_pass']==$_GET['new'] && $row['Temp_pass_active']==1)
{
$msg = 'Your new password has been confirmed. You may login using it.';
}
else
{
$error = 'The new password is already confirmed or is incorrect';
}
}
else {
$error = 'You are trying to confirm a new password for an unexisting member';
}
{
echo $error;
}
else {
echo $msg;
}
?>
ahora este otro
functions.php
Código PHP:
Ver original<?php
function checkLogin($levels)
{
if(!$_SESSION['logged_in'])
{
$access = FALSE;
}
else {
$kt = split(' ', $levels);
$access = FALSE;
{
if($val==$row['Level_access'])
{//if the user level matches one of the allowed levels
$access = TRUE;
}
}
}
if($access==FALSE)
{
header("Location: login.php"); }
else {
//do nothing: continue
}
}
function valid_email($str)
{
return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ?
FALSE : TRUE; }
function checkUnique($field, $compared)
{
{
return TRUE;
}
else {
return FALSE;
}
}
function numeric($str)
{
return ( ! ereg("^[0-9\.]+$", $str)) ?
FALSE : TRUE; }
function alpha_numeric($str)
{
return ( ! preg_match("/^([-a-z0-9])+$/i", $str)) ?
FALSE : TRUE; }
function random_string($type = 'alnum', $len = 8)
{
switch($type)
{
case 'alnum' :
case 'numeric' :
case 'nozero' :
switch ($type)
{
case 'alnum' : $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
break;
case 'numeric' : $pool = '0123456789';
break;
case 'nozero' : $pool = '123456789';
break;
}
$str = '';
for ($i=0; $i < $len; $i++)
{
}
return $str;
break;
break;
}
}
?>
y listo cualquiercosa pasate por mi foro
suerte
atte
ingeniero:jose alexis trujillo
caracas-venezuela