[eluser]oldnews[/eluser]
Thanks to all. I appreciate the abundant feedback and try, to my abilities, to absorb and to learn as a newbie from all. Have been doing HTML and JavaScript for 15 years, but PHP is new to me. And this CI framework in particular. Here's how I have cleaned up the mess, however, I'm now stuck with a line 38 (the very lengthy
message segment) error:
Parse error: syntax, unexpected T_CONSTANT_ENCAPSED_STRING for the controller/form.php. I've tried both single and double quotes and both yield the same error msg.
Code:
<?php
class Form extends Controller {
function index()
{
$this->load->helper(array('form', 'url'));
$this->load->library('form_validation');
$this->form_validation->set_rules('who', 'your name', 'required');
$this->form_validation->set_rules('mainphone', 'primary phone', 'required');
$this->form_validation->set_rules('email', 'email address', 'required|valid_email');
$this->form_validation->set_rules('extraphone', 'additional phone');
$this->form_validation->set_rules('address', 'mailing address', 'required');
$this->form_validation->set_rules('altphone', 'alternative phone');
$this->form_validation->set_rules('city', 'municipality', 'required');
$this->form_validation->set_rules('zip', 'zip code', 'required');
$this->form_validation->set_rules('description', 'describe photo', 'required');
$this->form_validation->set_rules('location', 'photo location', 'required');
$this->form_validation->set_rules('ageutresidency', 'certification checkbox', 'required');
if ($this->form_validation->run() == FALSE)
{
$this->load->view('header2');
$this->load->view('myform');
$this->load->view('footer2');
}
else
{
$this->load->library('email');
$this->email->subject("Best Summer Vacation Picture contest entry");
$this->email->email_from($email, $who);
$this->email->reply_to($email, $who);
$this->email->to("[email protected]");
$this->email->message($address', '$city', UT '$zip', photo description: '$description', location: '$location', primary phone: '$mainphone', optional secondary phone: '$extraphone', optional tertiary phone: '$altphone', certification of minimum age of 18 and UT residency: '$ageutresidency);
// $this->email->attach("/uploads/"$photofile);
$this->email->send();
echo $this->email->print_debugger();
if ( ! $this->email->send())
{
// Generate error
}
else
{
$this->load->view('header2');
$this->load->view('formsuccess');
$this->load->view('footer2');
}
}
}
}
// End of file: form.php
// Location: ./system/application/controllers/form.php
Obviously, I have commented out the TBA image attachment (previously downloaded), hoping to simply witness a successfully dispatched text email. Prpject on deadline, appreciate this community's intelligent support.
UploadPixMaverik.com