Welcome Guest, Not a member yet? Register   Sign In
Store form data in database and email it to email address x
#6

[eluser]rhand_ci[/eluser]
@ Codemaster Snake

Thanks for this great reply. Here some more questions in response to your post:
[quote author="Codemaster Snake" date="1266001306"]
1. Fetch user data.
[/quote]
I do that using
Code:
$this->db->insert('rentalform', $_POST);
but I am sure you mean something else
[quote author="Codemaster Snake" date="1266001306"]
2. Process data using form_validation. If valid goto step 3 or goto step 1.
[/quote]
Validation should not be to hard, but has no priority yet as I try to store data and send it by email first..
[quote author="Codemaster Snake" date="1266001306"]
3. Prepare and SQL Query like: 'INSERT INTO table_name VALUES...'
[/quote]
Why not just use:
Code:
$this->db->insert('rentalform', $_POST);
? Forgive my ignorance but I am still learning...

[quote author="Codemaster Snake" date="1266001306"]
4. Fire Query using $this->db->query();
[/quote]
Query to get the inserted data? How can I query data just sent so I email what was sent and not all table data?
[quote author="Codemaster Snake" date="1266001306"]
5. Then Initialize Email class.
[/quote]
Found this:
Code:
$this->load->library('email');

$this->email->from('[email protected]', 'Your Name');
$this->email->to('[email protected]');
$this->email->cc('[email protected]');
$this->email->bcc('[email protected]');

$this->email->subject('Email Test');
$this->email->message('Testing the email class.');

$this->email->send();

echo $this->email->print_debugger();
I guess that is what you mean?
[quote author="Codemaster Snake" date="1266001306"]
6. Send an Email to the the person
[/quote]
using:
Code:
$this->email->send();
?
[quote author="Codemaster Snake" date="1266001306"]
7. Check if email has been successfully sent or not. If successfully sent then exit otherwise go to next step
[/quote]
[quote author="Codemaster Snake" date="1266001306"]
8. Delete the last entry from the database and throw an error
[/quote]

Why delete the last entry? I would like to store data in database AND email to email address x...


Messages In This Thread
Store form data in database and email it to email address x - by El Forum - 02-12-2010, 07:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB