Hi Everyone
I have the following which is a form that will add data to my Database when sent.
if(substr(basename($_SERVER['PHP_SELF']), 0, 11) == "imEmailForm") {
include '../res/x5engine.php';
$form = new ImForm();
$form->setField('Name', @$_GET['Name'], 'Name', false);
$form->setField('Job:', @$_GET['Sire'], 'Job', false);
$form->setField('', @$_GET['imObjectForm_6_5'], '', true);
$form->setField('Sex', @$_GET['Sex'], 'Sex', false);
$form->setField('Date Of Birth ', @$_GET['DOB'], 'DOB', false);
if(@$_GET['action'] != 'check_answer') {
if(!isset($_GET['imJsCheck']) || $_GET['imJsCheck'] != '7E2ACB592B4423AFFD09BDD9C' || (isset($_GET['imSpProt']) && $_GET['imSpProt'] != ""))
die(imPrintJsError());
$db = getDbData('61ekzeq4');
if (!$db)
die("Cannot find db");
$db = ImDb::from_db_data($db); if (!$form->saveToDb($db, 'people))
die("Unable to connect to db");
@header('Location: ../page-123.php');
exit();
} else {
echo $form->checkAnswer(@$_GET['id'], @$_GET['answer']) ? 1 : 0;
}
}
This works fine but i am trying to add something
What i need is something that will change the format of the text that is entered before sending.
So if text entered is “BOB THE SPONGE” will become “Bob The Sponge”
So when it gets to the Database is not "BOB THE SPONGE but “Bob The Sponge”
Can anyone tell me what needs to be added to the code to do this, Thanks
P.S just found that “ucwords” would probably work just don’t know how to build it into the form.