PHP - ayuda con error php

 
Vista:

ayuda con error php

Publicado por feliphe23 (2 intervenciones) el 11/11/2011 17:10:43
tengo el siguiente codigo , al principio lo tenia solo para username , password , email , repassword , fullname y funcionaba ok agraba los datos en la bd y ahora agrege otros campos como direccion apoderado y apellido y me da una serie de errores y no entiendo que podria ser ayuda ayudita please


register.php

<?php
class register
{
public $username;
public $password;
public $repassword;
public $email;
public $fullname;
public $direccion;
public $apoderado;
public $apellido;
public $query;
public $numrows;
public $error;
public $error2;
public $error3;
public $error4;
public $ok;
public $fields;
public $regquery;

public function __construct($username, $password, $repeatpassword, $email, $fullname, $direccion, $apoderado, $apellido)
{
include "config.php";
$this->user = $username;
$this->password = $password;
$this->repassword = $repeatpassword;
$this->email = $email;
$this->fullname = $fullname;
$this->direccion = $direccion;
$this->apoderado = $apoderado;
$this->apellido = $apellido;
$this->query = mysql_query("SELECT * FROM users WHERE username = '".$this->user."'");
$this->numrows = mysql_num_rows($this->query);
$this->error = "Nombre de usuario en uso.";
$this->error2 = "Las contraseñas no coinciden";
$this->error3 = "Nombre completo y/o nombre de usuarios superan los 25 caracteres.";
$this->error4 = "La contraseña debe tener un minimo de 6 caracteres y un maximo de 25";
$this->ok = "Te has registrado correctamente";
$this->fields = "Por favor, rellena todos los campos.";
}
public function check()
{
if($this->numrows!=0)
{
die ($this->error);
}
if($this->user&&$this->password&&$this->email&&$this->fullname&&$this->direccion&&$this->apoderado&&$this->apellido)
{
if($this->password == $this->repassword)
{
if(strlen($this->username)>25||strlen($this->fullname)>25)
{
echo $this->error3;
}
else
{
if(strlen($this->password)>25||strlen($this->password)<6)
{
echo $this->error4;
}
else
{
$this->password = md5($this->password);
$register = mysql_query("INSERT INTO `users` (`id`, `fullname`, `username`, `password`, `email`, `admin`, `direccion`, `apoderado`, `apellido`) VALUES (NULL, '".$this->fullname."', '".$this->user."', '".$this->password."', '".$this->email."', '0', '".$this->direccion."', '".$this->apoderado."', '".$this->apellido."')");
echo $this->ok;
}
}
}
else
{
echo $this->error2;
}
}
else
{
echo $this->fields;
}
}
}
include_once "clear.php";
$reg = new register(clear($_POST['username']), clear($_POST['password']), clear($_POST['repeatpassword']), clear($_POST['email']), clear($_POST['fullname']));
echo $reg->check();
?>


///////////////////////////////////
registroalumno.php

<?php
include 'header.php';
?>
<link href="css/Vista3.css" rel="stylesheet" type="text/css" />
<div id="navcontainer">
<?php include 'menuprofesor.php'?>
</div>

<div id="bodycontainer">
<div id="banner">
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
WIDTH=776 HEIGHT=243>
<PARAM NAME=movie VALUE="flash/ma2.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolorVALUE=#FFFFFF>
<EMBED src="flash/ma2.swf" quality=high bgcolor=#FFFFFF WIDTH=776 HEIGHT=243 TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
</div>

<div class="blank"></div>

<div id="bodycontainerleft">
<div id="lmaim">
<div id="loginmaim">
<div id="loginbg">
<center>
<br />
Piramide Alimenticia
</center>
</div>
</div>
<div id="blmaim"></div>
</div>
</div>
<div id="bodycontainercenter">
<div id="wmaim">
<h2 id="welcome"><br />
<span class="h1">Registro Alumno:
</span></h2>
<div id="wtxt">



<form action='register.php' method='POST'>
<center>
<table align="left" border="0">
<td align="left" width="100">Alumno:</td>
<td align="center" width="150"><input type="text" name="fullname" id="nombres" size="25" /></td>
<tr>
<td align="left" width="100">Apoderado:</td>
<td align="center" width="150"><input type="text" name="apoderado" id="apoderado" size="25"></td>
<tr>
<td align="left" width="100">Direccion:</td>
<td align="center" width="150"><input type="text" name="direccion" id="direccion" size="25"></td>
<tr>
<td widht="100">Email:</td>
<td align="right" width="150"><input type="text" name="email" id="email" size="25"></td>
<tr>
<td widht="100">Apellidos:</td>
<td align="right"><input type="text" name="apellido" id="apellido" size="25"></td>
<tr>
<td widht="100">Rut:</td>
<td align="right"><input type="text" name="username" id="rut" size="25"></td>
<tr>
<td widht="100">Pass:</td>
<td align="right"><input type="password" name="password" id="pass" size="25"></td>
<tr>
<tr>
<td widht="100">Repite pas:</td>
<td align="right"><input type="password" name="repeatpassword" id="pass" size="25"></td>
<tr>
<td widht="100"></td>
<td align="right"><label>
<input type='submit' name='submit' value='Register' class="button">

</label></td>

</TABLE>
<p><br />
<br />
</p>
</center>
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</form>
</p>
<span class="wtext"><p>.<br />
</p>
</span><br />
</div>
</div>
</div>
<div id="bodycontainerright">
<div id="rmaim">
<h2 id="featured"></h2>
<div class="fpm1">
<div class="fpmleft"><img src="imagenes/deporte1.jpg" alt="" width="98" height="101" /></div>
<div class="ftext fpmright">
<p><span class="h1">No al bulling </span>. </p>
<p align="justify">El rendimiento a umentado un 15% </p>
<div align="right"></div>
</div>
</div>

<div class="fpm1"><br/><br/>
<div class="fpmleft"><img src="imagenes/deporte2.jpg" alt="" width="97" height="98" /></div>
<div class="ftext fpmright">
<p class="h1">Profesores</p>
<div align="justify">15 años formando la educacion de chile
</div>
<div align="right"> </div>
</div>
</div>
</div>
</div>
<br class="spacer" />
</div>

<?php
include 'footer.php';
?>
</body>
</html>








///////////////////////////////


errores
) Warning: Missing argument 6 for register::__construct(), called in C:\VertrigoServ\www\re2\register.php on line 82 and defined in C:\VertrigoServ\www\re2\register.php on line 22 Call Stack # Time Memory Function Location 1 0.0024 364496 {main}( ) ..\register.php:0 2 0.0038 368856 register->__construct( ) ..\register.php:82
( ! ) Warning: Missing argument 7 for register::__construct(), called in C:\VertrigoServ\www\re2\register.php on line 82 and defined in C:\VertrigoServ\www\re2\register.php on line 22 Call Stack # Time Memory Function Location 1 0.0024 364496 {main}( ) ..\register.php:0 2 0.0038 368856 register->__construct( ) ..\register.php:82
( ! ) Warning: Missing argument 8 for register::__construct(), called in C:\VertrigoServ\www\re2\register.php on line 82 and defined in C:\VertrigoServ\www\re2\register.php on line 22 Call Stack # Time Memory Function Location 1 0.0024 364496 {main}( ) ..\register.php:0 2 0.0038 368856 register->__construct( ) ..\register.php:82
( ! ) Notice: Undefined variable: direccion in C:\VertrigoServ\www\re2\register.php on line 30 Call Stack # Time Memory Function Location 1 0.0024 364496 {main}( ) ..\register.php:0 2 0.0038 368856 register->__construct( ) ..\register.php:82
( ! ) Notice: Undefined variable: apoderado in C:\VertrigoServ\www\re2\register.php on line 31 Call Stack # Time Memory Function Location 1 0.0024 364496 {main}( ) ..\register.php:0 2 0.0038 368856 register->__construct( ) ..\register.php:82
( ! ) Notice: Undefined variable: apellido in C:\VertrigoServ\www\re2\register.php on line 32 Call Stack # Time Memory Function Location 1 0.0024 364496 {main}( ) ..\register.php:0 2 0.0038 368856 register->__construct( ) ..\register.php:82
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder