Ver Mensaje Individual
  #6 (permalink)  
Antiguo 14/04/2016, 08:54
VR1387
 
Fecha de Ingreso: abril-2016
Mensajes: 19
Antigüedad: 8 años, 1 mes
Puntos: 0
Respuesta: Disintos index.php apartir de presionar un boton

Buenas

Gracias por la respuesta.

Pude realizar co el switch la vista de diferentes "index" en el mismo index depende de lo que haga click. Pero ahora se me presenta otra duda.

La cual es:

Si le doy registrar me muestra el echo PERRA pero no el valor de la variable $id que dado caso seria la que capturo del formulario, la cual al parecer no esta capturando. Dejo el codigo.


Código:
<?php
require "conexion.php";
/*require "formularioclientes.php";*/
$cuerpo=$_GET['cuerpo'];
switch($cuerpo)
{
	case "registrar":
		require "formularioclientes.php";
		break;
	case "buscar":
		require "busquedaclientes.php";
		break;
	default:
		echo require "formularioprincipal.php";
} // switch
if ($cuerpo='registrar')
{
	echo "PERRA";
	$id=$_REQUEST['cedrif'];
	$name=$_REQUEST['nombre'];
	$nacionalidad=$_REQUEST['nacionalidad'];
	$direccion=$_REQUEST['direccion'];
	$mail=$_REQUEST['correo'];
	$tlf=$_REQUEST['telefono'];
	echo $id;
}


Este es el fomularioclientes.php


Código:
<?php
$index=
'<html>
<head>
<title>Registro de clientes</title>
</head>
<body>
<center>
<form action="registroclientes2.php" method="post"> <- El form lo he 
quitado y colocado pero no me funciona con y sin el form
<table border="2" bordercolor="#151515" bgcolor="#F7F8E0" width="600">
	<tr>
		<td width="150"><center>RIF o Cedula</center>
		</td>
		<td width="30">
		<select name="nacionalidad">
		<option value="0">---</option>
		<option value="1">J</option>
		<option value="2">V</option>
		<option value="3">E</option>
		</select>
		</td>
		<td width="393">
    	<input type="text" maxlength="9" size="5"  name="cedrif">
		</td>
	</tr>
	<tr>
    	<td><center>Razon Social</center>
		</td>
    	<td colspan="2">
    	<input type="text" size="60" name="nombre">
		</td>
	</tr>
	<tr>
    	<td><center>Direccion</center>
		</td>
    	<td  colspan="2">
    	<input type="text" size="60" name="direccion">
		</td>
	</tr>
	<tr>
    	<td><center>Correo electronico</center>
		</td>
		<td  colspan="2">
    	<input type="text" size="60" name="correo">
		</td>
	</tr>
		<tr>
    	<td><center>Telefono</center>
		</td>
		<td  colspan="2">
    	<input type="text" size="60" name="telefono">
		</td>
	</tr>
</table>
	<a href="registroclientes2.php?cuerpo=registrar" name="registrar" >Registrar</a>
	<a href="registroclientes2.php?cuerpo=buscar" name="buscar">Buscar</a>
';
echo $index;
?>