Location: PHPKode > projects > OpenSupports > Opensupports_v2_EN/support/reg2.php
<?php 
require "config.php";

$usuario = $_POST['correoelectronico']; 
$busca = "select * from usuarios WHERE user='$usuario'";
$todoslosquehay =  @mysql_num_rows(mysql_query($busca));

$usuario2 = $_POST['nombredelformulario']; 
$busca2 = "select * from usuarios WHERE nombre='$usuario'";
$todoslosquehay2 =  @mysql_num_rows(mysql_query($busca));
if ($todoslosquehay > 0)
{
header ('Location: regerr.php?err=existe');
}
elseif($todoslosquehay2 > 0)
{
header ('Location: regerr.php?err=existe');
}
elseif (strlen($_POST[nombredelformulario]) <= 0)
{
header ('Location: regerr.php?err=name');
}
elseif (strlen($_POST[correoelectronico]) <= 5 && strpos($_POST[correoelectronico],"@") !== false)
{
header ('Location: regerr.php?err=email');
}
elseif (strlen($_POST[passwordrequerido]) <= 5)
{
header ('Location: regerr.php?err=pass');
}
elseif ($_POST[passwordrequerido] != $_POST[rpass])
{
header ('Location: regerr.php?err=rpass');
}
elseif ($_POST[codigo] != $_POST[valueverfity])
{
header ('Location: regerr.php?err=verify');
}
else
{
$conect = mysql_query("insert into usuarios(id,nombre,user,pass) values ('','$_POST[nombredelformulario]','$_POST[correoelectronico]','$_POST[passwordrequerido]')") or die("Error en el Servidor".mysql_error());
//iniciar:mail
$sendTo = $_POST[correoelectronico];
$subject = "Support Center - " . $titulo ." - Welcome";
$headers = "From: ";
$headers .= "<" . $mailprincipal . ">\r\n";
$headers .= "Reply-To: " . $mailprincipal; 
$message =   "Hello,\nThanks you for register on the" . $titulo . " Support Center.\nNow you can send tickets and see articles, guides and docs.\nTo login go here:" . $url . "\nInformation:\nEmail:  " . $_POST['correoelectronico'] . "\nPassword:  " . $_POST[passwordrequerido];
mail($sendTo, $subject, $message, $headers);
//temina
header ('Location: regcomplete.php');
}
?>

Return current item: OpenSupports