HTML / Swift Form & CSV Database [SOLVED]

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
User avatar
eymorais
Forum Newbie
Posts: 14
Joined: Fri Apr 11, 2008 8:38 am
Location: Moncton NB Canada

HTML / Swift Form & CSV Database [SOLVED]

Post by eymorais »

Hello Y'all!

Has anyone been able to combine an HTML / Swift backed Form & a CSV database?

Tried to compine Form2CSVtable (http://www.danbp.org/form2csvtable.html) as it was only a very small php file with my Swift handler with no luck.
Last edited by eymorais on Wed Apr 23, 2008 9:10 am, edited 1 time in total.
User avatar
eymorais
Forum Newbie
Posts: 14
Joined: Fri Apr 11, 2008 8:38 am
Location: Moncton NB Canada

Re: HTML / Swift Form & CSV Database

Post by eymorais »

If anyone is trying to get this working, I was able to do it on my end...

The code is within a swift mailer php file....

Code: Select all

 
if ($sent)
{          
     
    list($from, $junk) = split("@",$from_email);
 
    $form_info = array(
        'from' => $from,
        'name' => $name,
        'email' => $email,
        'type' => $type,
        'pckg' => $pckg,
        'acct' => $acct,
        'business' => $busname,
        'username' => $username,
        ); 
 
    // Serialize the array 
    $serialized_info = serialize($form_info); 
    
    $str.= $serialized_info;
    $str.= "\n";
    
    // Write the formatted array to file 
    $file = 'data/form.txt'; 
    $handle = fopen($file, 'a'); 
    fwrite($handle, $str); 
    fclose($handle); 
 
    session_destroy ();
    header("Location: ../success.php");
    exit();
}
else
{
    header("Location: ../form.php?error=sending");
    exit();
}
 
If any one else has ideas on how to better this, just reply.
Post Reply