Store form data in database and email it to email address x |
[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); [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); [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'); [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... |
Welcome Guest, Not a member yet? Register Sign In |