Welcome Guest, Not a member yet? Register   Sign In
sessions not enabled on go daddy server
#18

[eluser]labao[/eluser]
which then gets dumped into this controller:

Quote:<?php



class Myform extends Controller {

function Myform()
{
parent::Controller();
$this->load->library('form_validation');
$this->load->database();
$this->load->helper('form');
$this->load->helper('url');
$this->load->model('myform_model');
}
function frm()
{


$data = array();
$this->form_validation->set_rules('first_name','First Name','required|trim');
$this->form_validation->set_rules('last_name','Last Name','required|trim');
$this->form_validation->set_rules('shipping_street_address','Shipping Street Address','required|trim');
$this->form_validation->set_rules('city','City','required|trim');
$this->form_validation->set_rules('special_insructions','Special Insructions','');
$this->form_validation->set_rules('telephone','Telephone','required|trim|min_length[10]');
$this->form_validation->set_rules('alternate_telephone','Alternate telephone','');
$this->form_validation->set_rules('email','Email','required|trim|valid_email|matches[email_confirm]');
$this->form_validation->set_rules('email_confirm','Email Confirm','required|trim|valid_email');
$this->form_validation->set_error_delimiters('<br /><span class="error">', '</span>');

if ($this->form_validation->run() == FALSE) // validation hasn'\t been passed



{




$pageID = $this->uri->segment(3);
$data = array(
'pageID' => $pageID
);
$this->load->view('template',$data);
}
else // passed validation proceed to post success logic
{
// build array for the model
$session_id = $this->session->userdata('session_id');
$form_data = array(
'first_name' => strtoupper(set_value('first_name')),
'last_name' => strtoupper(set_value('last_name')),
'address' => strtoupper(set_value('shipping_street_address')),
'city' => strtoupper(set_value('city')),
'message' => set_value('special_insructions'),
'tel' => set_value('telephone'),
'alt_tel' => set_value('alternate_telephone'),
'email' => set_value('email'),
'email_confirm' => set_value('email_confirm'),
'sessionid' => $session_id,
'car_id' => set_value('vehicle')
);


// run insert model to write data to db

if ($this->myform_model->save_form($form_data) == TRUE)
{
redirect('myform/success'); // or whatever logic needs to occur
}
else
{
echo 'An error occurred saving your information. Please try again later';
// Or whatever error handling is necessary
}
}
}
function success()
{
redirect('master/page/verify');
}
}
?&gt;

NOTE that the user info DOES get dumped into the database because it's not using the userdata

from there, the controller needs to go to this view:


Messages In This Thread
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 04:33 AM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 10:37 AM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 11:10 AM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 11:20 AM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 11:25 AM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 11:34 AM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 12:51 PM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 01:31 PM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 01:40 PM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 01:57 PM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 02:23 PM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 02:41 PM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 02:47 PM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 02:47 PM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 07:56 PM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 08:03 PM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 08:04 PM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 08:07 PM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 08:11 PM
sessions not enabled on go daddy server - by El Forum - 04-09-2010, 08:14 PM
sessions not enabled on go daddy server - by El Forum - 04-15-2010, 02:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB