Tema: Codigo Php
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/07/2011, 14:54
Alber_h
 
Fecha de Ingreso: septiembre-2009
Mensajes: 138
Antigüedad: 14 años, 7 meses
Puntos: 3
Codigo Php

Tengo el Siguiente Codigo de php en mi form:

<head>
<title>PAGINA WEB MPSM</title>
</head>
<body>
<form name="form1" method="get" action="Untitled-1.php">
<table align="center">
<th>SISTEMA WEB MPSM</th>
</table>
<div id="Layer1">
<div id="Layer2" onClick="MM_showHideLayers('Layer6','','show','Lay er7','','hide','Layer31','','hide','Layer32','','h ide','Layer33','','hide','Layer34','','hide','Laye r8','','hide','Layer35','','hide','Layer36','','hi de','Layer37','','hide')">
<a href="#">CONTROLAR USUARIO</a></div>
<div id="Layer3" onClick="MM_showHideLayers('Layer6','','hide','Lay er7','','show','Layer31','','show','Layer32','','s how','Layer33','','show','Layer34','','show','Laye r8','','hide','Layer35','','hide','Layer36','','hi de','Layer37','','hide')">
<a href="#" >CONTROLAR ASISTENCIA</a></div>
<div id="Layer4" onClick="MM_showHideLayers('Layer6','','hide','Lay er7','','hide','Layer31','','hide','Layer32','','h ide','Layer33','','hide','Layer34','','hide','Laye r8','','show','Layer35','','show','Layer36','','sh ow','Layer37','','show')">
<a href="#">CONTROLAR ACTIVIDADES</a></div>
<div id="Layer5">
<a href="#" >ADMINISTRAR PERSONALES</a></div>
</div>
<div id="Layer6">
<div id="Layer9">Nombre:</div>
<div id="Layer10"><input type="text" name="nombre" value=<?php if(isset($_GET['nombre'])){ echo $_GET['nombre']; } ?>></div>
<div id="Layer11">Apellido:</div>
<div id="Layer12"><input type="text" name="apellido" value=<?php if(isset($_GET['apellido'])){ echo $_GET['apellido']; }?>></div>
<div id="Layer13">Direccion:</div>
<div id="Layer14"><input type="text" name="direcc" value=<?php if(isset($_GET['direcc'])){echo $_GET['direcc'];}?>></div>
<div id="Layer15">Edad:</div>
<div id="Layer16"><input type="text" name="edad" value=<?php if(isset($_GET['edad'])){ echo $_GET['edad']; } ?>></div>
<div id="Layer17">Dni:</div>
<div id="Layer18"><input type="text" name="dni" value=<?php if(isset($_GET['dni'])){ echo $_GET['dni']; } ?>></div>
<div id="Layer19">Correo:</div>
<div id="Layer20"><input type="text" name="correo" value=<?php if(isset($_GET['correo'])){ echo $_GET['correo'];}?>></div>
<div id="Layer21" align="center"><input type="submit" name="Submit" value="Insertar" onClick="alerta()"></div>
<div id="Layer22" align="center"><input type="submit" name="Submit2" value="Mostrar"></div>
<div id="Layer23" align="center"><input type="submit" name="Submit3" value="Eliminar"></div>
<div id="Layer24" align="center"><input type="submit" name="Submit4" value="Modificar"></div>
<br><br><br><br><br><br><br><br><br><br><br><br>

<?php
if(isset($_GET["Submit2"]))
{
$sel="select * from usuario";
$con=mysql_query($sel);
echo "<table id=tabla width=700 border=1 align=center>";
echo "<tr id=celdas name=celdas align=center width=700>";
echo "<td width=700>Id</td>";
echo "<td width=700>Nombre</td>";
echo "<td width=700>Apellido</td>";
echo "<td width=700>Direccion</td>";
echo "<td width=700>Edad</td>";
echo "<td width=700 name=id>Dni</td>";
echo "<td width=700>Correo</td>";
echo "<td width=700>Seleccion</td>";
echo "</tr></table>";
while($ins=mysql_fetch_array($con))
{
//onclick=alert(this.getElementsByTagName('td')[0].innerHTML)"
echo "<table id=tabla width=700 border=1 align=center>";
echo "<tr id=celdas name=celdas align=center width=350 onmouseover=this.style.cursor='hand'>";
echo "<td width=700 name=id>";
echo $ins[0];
echo "</td>";
echo "<td width=700>";
echo $ins[1];
echo "</td>";
echo "<td width=700>";
echo $ins[2];
echo "</td>";
echo "<td width=700>";
echo $ins[3];
echo "</td>";
echo "<td width=700>";
echo $ins[4];
echo "</td>";
echo "<td width=700>";
echo $ins[5];
echo "</td>";
echo "<td width=700>";
echo $ins[6];
echo "</td>";
echo "<td width=700>";
echo "<input type=checkbox name=caja value=$ins[0]>";
echo "</input>";
echo "</td>";
echo "</tr>";
echo "</table>";
}
}
?>
</div>

<div id="Layer7">
<div id="Layer31">Nombre:</div>
<div id="Layer32"><input type="text" name="textfield"></div>
<div id="Layer33">Fecha:</div>
<div id="Layer34"><input type="text" name="textfield2" id="calendar2_container"></div>
</div>

<div id="Layer8">
<div id="Layer35">Nombre Archivo:</div>
<div id="Layer36"><input name="archivos" type="file" id="archivos"></div>
<div id="Layer37" align="center"><input type="submit" name="Submit5" value="Subir"></div>
</div>

</form>
<?php
if(isset($_GET["Submit"]))

{
$consulta_insert="insert into usuario(Id,Nombre,Apellido,Direccion,Edad,Dni,Corr eo)values('','".$_GET['nombre']."','".$_GET[ 'apellido']."','".$_GET['direcc']."','".$_GET['edad']."','".$_GET['dni']."','".$_GET['correo']."')";
$consulta_ejecutar=mysql_query($consulta_insert) ;
}
?>


<?php
if(isset($_GET["Submit3"]))
{
if(isset($_REQUEST['caja']))
{
$cajavalor=$_REQUEST['caja'];
$eli="delete from usuario where id=$cajavalor";
$eje=mysql_query($eli);
}
}
?>


<?php
if(isset($_GET["Submit4"]))

{
if(isset($_REQUEST['caja']))
{
$cajavalor=$_REQUEST['caja'];
$eli="update usuario set Nombre='".$_GET['nombre']."',Apellido='".$_GET['apellido']."',Direccion='".$_GET['direcc']."',Edad='".$_GET['edad']."',Dni='".$_GET['dni']."',Coe='".$_GET['correo']."' where Id=$cajavalor";
$eje=mysql_query($eli);
}
}
?>
</body>
</html>



Como hago para que no se cargue toda la pagina.