Luke Welling takes a humorous look at something he misses in PHP - register globals being set to on.
I am aware that there are some things so shocking that you are not supposed to say them in polite company [...] so confronting that they are best kept to yourself regardless of how strongly you believe them. I have a similarly shocking sentiment that I feel I have to share.
I really like register_globals in PHP.
He reminicies about the days gone by of being able to assume that register_globals is turned on, the days of simpler, lighter code that's even easier for the newbies to get into. Anyone for a tshirt?











Fatal error: Call to a member function query() on a non-object in C:wwwbertomarkuser_auth_fns.php on line 9
of the code:
function register($username, $email, $password)
//registrar nueva persona en la BD
//devuelve cierto o mensaje de error
{
//conectar a la bd
$conn = db_connect();
// verifica si el username es unico
$result=$conn->query("select * from user where username='$username'");
if (!$result)
throw new Exception('No puedo ejectar la busqueda.');
if ($result->num_rows>0)
throw new Exception('Ya existe ese usuario, vuelva a intentarlo.');
// Si es OK, lo registra en la BD
$result=$conn->query("insert into user values('$username', sha1('$password'), '$email')");
if (!$result)
throw Exception('No se pudo registrar a la base de datos');
return true;
}
What wrong with it??...
Thank for the help
Alberto