Foros del Web » Programando para Internet » PHP » Frameworks y PHP orientado a objetos »

formulario con jformer

Estas en el tema de formulario con jformer en el foro de Frameworks y PHP orientado a objetos en Foros del Web. Hola , estoy probando el frameworks jformer, pero hay algunas cosas que no logro entender del codigo. .como por ejemplo en que parte se conecta ...
  #1 (permalink)  
Antiguo 21/05/2012, 19:56
 
Fecha de Ingreso: julio-2011
Mensajes: 38
Antigüedad: 12 años, 9 meses
Puntos: 1
Pregunta formulario con jformer

Hola , estoy probando el frameworks jformer, pero hay algunas cosas que no logro entender del codigo.

.como por ejemplo en que parte se conecta a la base de datos ,

lo unico que vi que puede llegar a ser es $mysqli = new mysqli();

.en que parte le digo que hacer si el loguin es correcto , como por ejemplo redireccionar a otra pagina

.y si inicia una session o que parametros envia para que se inicie la session ,

es mucho codigo , y un poco como que me pierdo

la pagina es http://www.jformer.com

no puedo poner el codigo porque es muy largo , pero en la pagina esta.


y el ejemplo de de formulario que da es este :

Código PHP:
<font></font>
// Create the form<font></font>
$login = new JFormer('loginForm', array(<font></font>
    
'submitButtonText' => 'Login',<font></font>
));<
font></font>
<
font></font>
// Create the form page<font></font>
$jFormPage1 = new JFormPage($login->id.'Page', array(<font></font>
    
'title' => '<p>Login Demo</p>',<font></font>
));<
font></font>
<
font></font>
// Create the form section<font></font>
$jFormSection1 = new JFormSection($login->id.'Section', array());<font></font>
<
font></font>
// Check to see if the remember me checkbox should be checked by default<font></font>
<font></font>
// Add components to the section<font></font>
$jFormSection1->addJFormComponentArray(array(<font></font>
    new 
JFormComponentSingleLineText('username''Username:', array(<font></font>
        
'validationOptions' => array('required''username'),<font></font>
        
'tip' => '<p>The demo login is <b>admin</b>.</p>',<font></font>
    )),<
font></font>
<
font></font>
    new 
JFormComponentSingleLineText('password''Password:', array(<font></font>
        
'type' => 'password',<font></font>
        
'validationOptions' => array('required''password'),<font></font>
        
'tip' => '<p>Password is 12345</p>',<font></font>
    )),<
font></font>
<
font></font>
    new 
JFormComponentMultipleChoice('rememberMe''', <font></font>
        array(<
font></font>
            array(
'value' => 'remember''label' => 'Keep me logged in on this computer')<font></font>
        ),<
font></font>
        array(<
font></font>
        
'tip' => '<p>If a cookie is set you can have this checked by default.</p>',<font></font>
        )<
font></font>
    ),<
font></font>
));<
font></font>
<
font></font>
// Add the section to the page<font></font>
$jFormPage1->addJFormSection($jFormSection1);<font></font>
<
font></font>
// Add the page to the form<font></font>
$login->addJFormPage($jFormPage1);<font></font>
<
font></font>
// Set the function for a successful form submission<font></font>
function onSubmit($formValues) {<font></font>
    
$formValues $formValues->loginFormPage->loginFormSection;<font></font>
<
font></font>
    if(
$formValues->username == 'admin' && $formValues->password == '12345') {<font></font>
        if(!empty(
$formValues->rememberMe)) {<font></font>
            
$response = array('successPageHtml' => '<p>Login Successful</p><p>We\'ll keep you logged in on this computer.</p>');<font></font>
        }<
font></font>
        else {<
font></font>
            
$response = array('successPageHtml' => '<p>Login Successful</p><p>We won\'t keep you logged in on this computer.</p>');<font></font>
        }<
font></font>
    }<
font></font>
    else {<
font></font>
        
$response = array('failureNoticeHtml' => 'Invalid username or password.''failureJs' => "$('#password').val('').focus();");<font></font>
    }<
font></font>
<
font></font>
    return 
$response;<font></font>
}<
font></font>
<
font></font>
// Process any request to the form<font></font>
$login->processRequest();<font></font

si alguien lo conoce y sabe como hacerlo funcionar , les agradecería la ayuda ,

saludos

Etiquetas: formulario, jformer, login
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:38.