PHP Classes

File: sample_form_procesing.php

Recommend this page to a friend!
  Classes of José M. Carnero   Formulario   sample_form_procesing.php   Download  
File: sample_form_procesing.php
Role: Example script
Content type: text/plain
Description: Form processing
Class: Formulario
Generate and validate HTML forms
Author: By
Last change: better documentation and better example
Date: 15 years ago
Size: 1,119 bytes
 

Contents

Class file image Download
<?php //include_once("class.ddbb.inc"); ?>
<?php
$sMensajes
= '';

if(!empty(
$_POST['formName'])){
    include_once(
"class.formularioProc.inc");

   
$oProcFormulario = new formularioProc();

    if(
$oProcFormulario->procesarFormulario($_POST['formName'])){ //without problems, processing SQL
        /*
        //uses de SQL generated for insert/update/delete a record
        $oDDBBProc = ddbb_sel('mysql');
        $oDDBBProc->conectar(DB_SERVER, DB_USER, DB_PASSWORD, DB_DATABASE);
        $oDDBBProc->consulta($oProcFormulario->sFormularioSQL, $oProcFormulario->aFormularioSQL);*/
       
var_dump($oProcFormulario->sFormularioSQL); //SQL
       
var_dump($oProcFormulario->aFormularioSQL); //array with values for the SQL
   
}
    else{
//errores
       
$sMensajes = $oProcFormulario->sMensajeRetorno; //validation problems, return with this ($sMensajes) warning
   
}
}
else{
   
$sMensajes = 'No form to be processed.';
}

var_dump($sMensajes);

var_dump($_REQUEST);
var_dump($_SESSION);
//needs a redirection to the originating form page, with warnings or greetings
//necesita la correspondiente redireccion a la pagina origen con avisos de errores o confirmacion de exito
?>