PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Oliver Leuyim Angel  >  Forms on the go  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: an simple example with a where query!
Class: Forms on the go
Create forms to insert or update MySQL records
Author: By
Last change: update the vars to connect to a db.
Date: 1 year ago
Size: 4,774 bytes
 

Contents

Class file image Download
<?php

$db
="database";

include_once (
'class.forms.php');

$form = new buildForm();

       
//Edit the database settings below if you wish to use database connectivity
       
$form->dbServer = "localhost"; //database server (usually localhost)
       
$form->dbUser = "username"; //database username
       
$form->dbPass = "password"; //database password
       
$form->db = "database"; //database to connect to
       
$form->uploads = 'incspt/fotos/'; //default directory for uploading files

$form->database = array('table' => $db, 'where' => 'anynamecolum != "GO"');

if(
$_POST["passm"]) {
   
$resultado = $form->processSubmitted($_POST,$_FILES);
    if (
$resultado == '' ){
        print
"
        <fieldset style=\"border-color:green;background-color:#C0FFC0;color:black;text-decoration:blink;\">
        <legend>Alerta!</legend>
        Config succesfull.
        </fieldset>
        "
;
    }else{
        print
"
        <fieldset style=\"border-color:red;background-color:#C0FFC0;color:black;text-decoration:blink;\">
        <legend>Alerta!</legend>
       
$resultado
        </fieldset>
        "
;
    } }

$form->method = 'post';
$form->action = 'example.php';
$form->validate = true;
$form->open();
      
?>

<fieldset>
<legend><b>Config de servidor SMTP (ENVIO).</b></legend>
<span >
SMTP HOST:</span>
<?php $form->text(array('name' => 'host', size => '30', 'value' => '[sql]', validate => 'Write a host')); ?>

<br><span>
Puerto del SMTP:</span>
<?php $form->text(array('name' => 'port', size => '30', 'value' => '[sql]', validate => 'Write a port'));?>

<br><span >
Usuario del SMTP:</span>
<?php $form->text(array('name' => 'userm', size => '30', 'value' => '[sql]', validate => 'Escriba un usuario'));?>
<br><span >
Password del SMTP:</span>
<?php $form->password(array('name' => 'passm', size => '30', 'value' => '[sql]', validate => 'Escriba un password'));?>
<br><span >
Seguridad:</span>
<?php
$form
->radio(array('name' => 'seg', 'value' => '', 'checked' => '[sql]', 'label' => 'Ninguna', 'validate' => 'Seleccione un tipo'));
$form->radio(array('name' => 'seg', 'value' => 'ssl', 'checked' => '[sql]', 'label' => 'SSL', 'validate' => 'Seleccione un tipo'));
$form->radio(array('name' => 'seg', 'value' => 'tls', 'checked' => '[sql]', 'label' => 'TLS', 'validate' => 'Seleccione un tipo'));
?>
</fieldset>

<fieldset>
<legend><b>Config de Bounces. (LECTURA)</b></legend>
<span >
HOST:</span>
<?php $form->text(array('name' => 'smtpbounced', size => '30', 'value' => '[sql]', validate => 'Escriba un Host')); ?>
<br><span>
Puerto:</span>
<?php $form->text(array('name' => 'portbounced', size => '30', 'value' => '[sql]', validate => 'Write a port')); ?>

<br><span >
Servicio:</span>
<?php
$form
->radio(array('name' => 'servis', 'value' => 'pop3', 'checked' => '[sql]', 'label' => 'pop3', 'validate' => 'Seleccione un tipo'));
$form->radio(array('name' => 'servis', 'value' => 'imap', 'checked' => '[sql]', 'label' => 'imap', 'validate' => 'Seleccione un tipo'));
$form->radio(array('name' => 'servis', 'value' => 'imap2', 'checked' => '[sql]', 'label' => 'imap2', 'validate' => 'Seleccione un tipo'));
$form->radio(array('name' => 'servis', 'value' => 'imap2bis', 'checked' => '[sql]', 'label' => 'imap2bis', 'validate' => 'Seleccione un tipo'));
$form->radio(array('name' => 'servis', 'value' => 'imap4', 'checked' => '[sql]', 'label' => 'imap4', 'validate' => 'Seleccione un tipo'));
$form->radio(array('name' => 'servis', 'value' => 'imap4rev1', 'checked' => '[sql]', 'label' => 'imap4rev1', 'validate' => 'Seleccione un tipo'));
?>
<br><span >
Usuario:</span>
<?php $form->text(array('name' => 'bounced', size => '30', 'value' => '[sql]', validate => 'Write a username')); ?>
<br><span >
Password:</span>
<?php $form->password(array('name' => 'passbounced', size => '30', 'value' => '[sql]', validate => 'Write a password'));?>
<br><span >
Seguridad:</span>
<?php
$form
->radio(array('name' => 'seg2', 'value' => '', 'checked' => '[sql]', 'label' => 'Ninguna', 'validate' => 'Select any type'));
$form->radio(array('name' => 'seg2', 'value' => 'ssl', 'checked' => '[sql]', 'label' => 'SSL', 'validate' => 'Select any type'));
$form->radio(array('name' => 'seg2', 'value' => 'tls', 'checked' => '[sql]', 'label' => 'TLS', 'validate' => 'Select any type'));
?>
</fieldset>

<fieldset>
<legend><b>Config de Reply.</b></legend>
<span >
Correo:</span>
<?php $form->text(array('name' => 'reply', size => '30', 'value' => '[sql]', validate => 'Write a username')); ?>
</fieldset>

<br><span >
<?php
echo $form->submit(array('value' => ' Save changes'));
$form->close();
?>
</span>