How to?? Save web form info to csv....im a bit stuck :)
Posted: Mon May 19, 2008 10:53 am
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Hi im trying to move information from a web form (entered by user) through to a database. the flow at the moment is
user enters details> form passes info to process.php > process emails to outlook > info is manually copied and pasted into empty csv file and imported into db.
at the moment im using this in my process.php
My only problem is i could do with outputting the info to a seperate csv file and attaching that to save doing this manually. im just a bit stuck with how to do this. My only other alternative is to process it at this end using some type of batch processing script/app.... My output in email has carriage returns which is a pain in the posterior and looks like this.

~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
Hi im trying to move information from a web form (entered by user) through to a database. the flow at the moment is
user enters details> form passes info to process.php > process emails to outlook > info is manually copied and pasted into empty csv file and imported into db.
at the moment im using this in my process.php
Code: Select all
function sendApplicationDataEmail() {
global $bodyHeadingApplication;
global $subjectApplication;
global $emailTo;
$emailFrom = _cleanUp($_REQUEST['appEmail']);
$emailReplyTo = _cleanUp($_REQUEST['appEmail']);
$lineEnd = "\n";
$trimmedReferrerID = returnID($_SESSION['referrerID']);
// create message body
$messageBody = $bodyHeadingApplication.$lineEnd."----------------------------------------".$lineEnd.$lineEnd;
$messageBody .= "Marital Status : "._cleanUp($_REQUEST['appMarital']).$lineEnd.$lineEnd;
$messageBody .= ""._cleanUp($_REQUEST['appTitle']);
$messageBody .= ","._cleanUp($_REQUEST['appFirstNames']);
$messageBody .= ","._cleanUp($_REQUEST['appSurname']);
$messageBody .= ","._cleanUp($_REQUEST['appDOB']);
$messageBody .= ","._cleanUp($_REQUEST['appAddress']);
$messageBody .= ","._cleanUp($_REQUEST['appTownCity']);
$messageBody .= "County : "._cleanUp($_REQUEST['appCounty']).$lineEnd.$lineEnd;
$messageBody .= ","._cleanUp($_REQUEST['appPostCode']);
$result = @mail("$emailTo","$subjectApplication","$messageBody","From: $emailFrom\r\nReply-to: $emailReplyTo");
if (!$result) {
return "SYSTEM ERROR: sign in form submission failed!";
}
else {
sendAcceptAutoEmail();
sendReferrerEmail();
return "Thanks stopping by .";
}
}this is non-profit just trying to help a friend out and im starting to think im in over my head lol. Any advice is appreciated.Title,First Names,Surname,Date of Birth,Street Address,Town/City,Post Code
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: