Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/07/2006, 21:41
francofx
 
Fecha de Ingreso: julio-2006
Mensajes: 5
Antigüedad: 17 años, 8 meses
Puntos: 0
novato necesita entregar un trabajo para la facu :S

Hola soy nuevo en esto y estoy hasta las manos con la facu la cosa es sensilla tengo que hacer un ABM de docentes de la facultad el tema es que tengo un scrip mas o menos armado pero me tira errores a 4 manos si alguien me puede ayudar se lo agradeceria un monton es para mañana la 1era entrega :S

el error es :

Parse error: parse error in c:\archivos de programa\easyphp1-8\www\lpa\index.php on line 166

y el codigo es
<?
// archivo configuraqion
$nombreBase = "mysql";
$nombreUsuario = "root";
$usuarioContrasena = "";
$servidorMysql = "localhost";

echo ?>
<table width="640" cellspacing="2" cellpadding="0">
<form name="menu" action="'.$PHP_SELF.'" method="post">
<tr>
<td align="right" valign="top">
<input type="submit" name="ar" value="Alta Registro">
<input type="submit" name="pp" value="Pantalla Principal">
</td>
</tr>
</form>


<tr>

<td align="left" valign="top">
<? ;
if(isset($_POST[br]) or isset($_POST[mr]))
{
//alta registro
if(isset($_POST[ar]) and isset($_POST[guardar]))
{
//guarda registro
include('../conexion.inc.php');
//$sql="INSERT INTO docentes VALUES('','$_POST[nombre]','$_POST[apellido]','$_POST[materia]')";
$sql = "INSERT INTO docentes VALUES('','$_POST[nombre]','$_POST[apellido]','$_POST[materia]')";
$consulta=mysql_query($sql) or die(mysql_error());
echo'El registro a sido guardado exitosamente';
include('../cconexion.inc.php');
}
else if(isset($_POST[ar]) and !isset($_POST[guardar]))

{
//formulario de carga
echo?>
<form name="Alta" action="'.$PHP_SELF.'" method="post">
<input type="hidden" name="ar" value="'.$_POST[ar].'">
<table cellpadding="0">
<tr>
<td>Nombre:</td> <td><input type="text" name="nombre" size="45"></td>
</tr>
<tr>
<td>Apellido:</td> <td><input type="text" name="apellido" size="45"></td>
</tr>
<tr>
<td>Materia:</td> <td><input type="text" name="materia" size="45"></td>
</tr>
<tr>
<td> </td> <td><input type="submit" name="guardar" value="Guardar"></td>
</tr>
</table>
</form>
<?
}

//baja de registro
else if(isset($_POST[br])){
include('conexion.inc.php');
$sql="DELETE FROM docentes WHERE registros_legajo = '$_POST[registro_legajo]'";
$consulta = mysql_query($sql) or die(mysql_error());
echo ' El registro a sido eliminado exitosamente';
include('../cconexion.inc.php');
}

// Modifica registro

else if(isset($_POST[mr]) and isset($_POST[guardar]) and isset($_POST[registro_legajo]))
{
//guarda modificaciones al registro

include('../conexion.inc.php');
$sql = "UPDATE docentes SET registro_nombre='$_POST[nombre]',
registro_apellido='$_POST[apellido]',
registro_materia='$_POST[materia]'WHERE registro_legajo = '$_POST[registro_legajo]'";
$consulta = mysql_query($sql) or die(mysql_error());
include('../conexion.inc.php');
echo ' El registro a sido modificado correctamente';
}
else if(isset($_POST[mr]) and isset($_POST[registro_legajo]) and !isset($_POST[guardar]))
{
//Formulario de carga
include('../conexion.inc.php');
$sql = "SELECT * FROM docentes WHERE registro_legajo = '$_POST[registro_legajo]'";
$consulta = mysql_query($sql) or die(mysql_error());
$resultados = mysql_fetch_array($consulta);
include('../cconexion.inc.php');
echo

?>

<form name="Modificacion" action="'.PHP_SELF.'" method="post">
<input type="hidden" name="mr" value="'.$_POST[mr].'">
<input type="hidden" name="registro_legajo" value="'.$_POST[registro_legajo].'">
<table cellspacing="2" cellpadding="0">
<tr>
<td> Nombre: </td> <td><input type="text" name="nombre" size="45" value="'.$resultados[registro_nombre].'"></td>
</tr>
<tr>
<td> Apellido: </td> <td><input type="text" name="apellido" size="45" value="'.$resultados[registro_apellido].'"></td>
</tr>
<tr>
<td> Materia: </td> <td><input type="text" name="materia" size="45" value="'.$resultados[registro_materia].'"></td>
</tr>
<tr>
<td></td> <td><input type="submit" name="guardar" value="Guardar"></td>
</tr>
</table>
</form>

<?
}

else {
// Pantalla por defecto
echo ?>
<table cellspacing="0" cellpadding="5">
<tr>
<th>Registro Legajo</th><th>Nombre</th><th>Apellido</th><th colspan="3">Materia</th>
</tr>';

<?
$color=1;
include('../conexion.inc.php');
$sql = "SELECT * FROM docentes";
$consulta = mysql_query($sql) or die(mysql_error());
while($resultados=mysql_fetch_array($consulta))
{
echo?>
' <form name="Principal" action="'.$PHP_SELF.'" method="post">
<input type="hidden" name="registro_legajo" value="'.$resultados[registro_legajo].'">
<tr bgcolor="';
if($color == 1){
echo '#BFBFBF';
$color = 2;
} else {
echo '#D0D0D0';
$color = 1;
}
echo'">
<td>'.$resultados[registro_legajo].'</td><td>'.$resultados[registro_nombre].'</td>
<td>'.$resultados[registro_apellido].'</td><td>'.$resultados[registro_materia].'</td>
<td><input type="submit" name="mr" value="modifica"></td><td><input type="submit" name="br" value="Baja"></td>
</tr>
</form>

<?
}
include('../cconexion.inc.php');
echo ?>
</table>

<?
}
echo ?>
</td>
</tr>
<!-- contenido -->

</table>


Muchas gracias de antemano y espero que me ayuden porque me gusta mucho este tema de la programacion pero soy muy nuevo y necesito ayuda de algun lado para aprender :S