PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Oliver Leuyim Angel   Parse importer   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example for use this class
Class: Parse importer
Import email addresses into a MySQL database
Author: By
Last change:
Date: 10 years ago
Size: 1,047 bytes
 

Contents

Class file image Download
<form action="" method="POST" enctype="multipart/form-data">

emails:<textarea cols='35' rows='15' name='address'></textarea>
<br>gile:<input type='file' name='addresses'>
<br>Group:<input type='text' name='grupo'>

<br>
<input type="submit" value="Send!" name="submit">
</form>

<?php

if(!empty($_POST['address']) or !empty($_FILES['addresses']))
{

require(
"class.import.php");
$import = new Import();

$import->grupo = $_POST["grupo"];
$import->dbtableName = "datatable";
$import->identify();
$resultaqdo = $import->procesar();
if(
$resultaqdo){
   
    print
"
    <fieldset style=\"border-color:green;background-color:#C0FFC0;color:black;text-decoration:blink;\">
    <legend>Alert!</legend>
    Pefect Uploaded... "
.count($resultaqdo)." contacto(s).
    </fieldset>
    "
;
}else{
    print
"
    <fieldset style=\"border-color:red;background-color:#FF9D9D;color:black;text-decoration:blink;\">
    <legend>Alerta!</legend>
    Got stock.
{$import->show_errors()}
    </fieldset>
    "
;
}

}
?>