Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/09/2011, 10:56
thehack
 
Fecha de Ingreso: abril-2010
Mensajes: 151
Antigüedad: 16 años, 5 meses
Puntos: 1
error en strstr

hola chicos aca tengo un error que me no e determinado la problematica del el.
estoy creando un formulario el cual no quiero usar html si no funciones el cual e creado algunas

Código PHP:

function formOpen($action = NULL, $class = "forms", $ID = NULL, $legend = NULL, $method = "post", $enctype = "multipart/form-data") {    
    
$ID     = (isset($ID))     ? ' id="'. $ID .'"'                            : NULL;
    
$legend = (isset($legend)) ? "<legend>$legend</legend>" . "\n" : NULL;
    
$action = (strstr($action, "http://")) ? $action : _url . $action;
    
    
$HTML  = '<form'. $ID .' action="'. $action .'" method="'. $method .'" class="'. $class .'" enctype="'. $enctype .'">' . "\n\t";
    
$HTML .= '<fieldset>' . "\n\t\t";
    
$HTML .= $legend . "\n";            

    return 
$HTML;
}


function 
formClose() {
    
$HTML  = "\t" . "</fieldset>" . "\n";
    
$HTML .= "</form>";        
    
    return 
$HTML;
} 
esas dos funciones deberian de crearme esto

<form action="" method="POST">

</form>

atraves de una arreglo que lo hago asi

Código PHP:
$login = array("action" => "", "method" => "post",);
print 
formOpen($login);

print 
formClose(); 

dandome este error Warning: strstr() expects parameter 1 to be string, array given in C:\xampp\htdocs\redsocial.com\system\helpers\forms .php on line 145