Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/04/2006, 12:30
dark_cyber
 
Fecha de Ingreso: abril-2006
Mensajes: 4
Antigüedad: 18 años
Puntos: 0
Pregunta como lo hago??

ok, muy bien lo quiero es hacer una clase o funcion en php que llame a un boton y lo valide algo como esto

Código PHP:
<?
class boton
{
var 
$opc=1;
function 
boton()
{
if( 
$ingreso ){ //esta parte no se como llamarla dentro de una clase o funcion
switch( $ingreso ){ // igual
case "Ingresar" $this->opc 2; break;
}
}
if( 
$this->opc == ) echo"<input type = submit name = ingreso value='Ingresar'";
if( 
$this->opc == ) echo"<input type = submit name = ingreso value='Guardar'";
}
}

//prueba.php
?>
<form method=POST action="<?php echo $PHP_SELF?>">
<input type=text name=campo1 >
<p>&nbsp;</p>
<? $obj = new boton(); ?>
</form>

<?

if ($ingreso == "Guardar"){
echo 
" se ha guardado el registro";
}
if (
$ingreso == "Ingresar"){
echo 
" Va ha insertar un registro";
}
?>