email issue , probably simple :) |
[eluser]DynamiteN[/eluser]
Hi i have a contact form where a user fill in different things in different boxes the problem i have is i dont know how to get all of those input values from that form into the message like i have two fields named "nick" and "name" and then i there is subject and the message it self, now how to i get those "nick" and "name" passed into the mail as well maybe write to a file it somehow ? i tried with write_file(); but then it wont work with an array apperantly, anyone knows how to do this, there is actually a few more fields then just those two but if anyone could point me in a direction here im sure i can figure something out ![]() //DynamiteN
[eluser]DynamiteN[/eluser]
anyone ? please ![]() been struggeling with this issue a while now ...
[eluser]danmontgomery[/eluser]
http://ellislab.com/codeigniter/user-gui...input.html Is the problem that you don't understand how PHP interacts with HTML forms, or that you don't understand how CI interacts with POST data?
[eluser]DynamiteN[/eluser]
Code: class Contact extends Controller{ this is t he code in the controller it works just fine but i would like to pass in those others input fields in to the mail, the message and the subject works jsut fien and mailing works jsut fine, but how to send these fields to Code: $nick = $this->input->post('nick'); i dont know how to get this in to the mail as well , maybe attach a file as i have done there and somehow pass the data from these inputs in to that file, hope u understand my problem better now
[eluser]DynamiteN[/eluser]
anyone ? been googeling this every day still cant find an answer how to do this :/
[eluser]heavenquake[/eluser]
how about this solution: Code: // validation has passed. Now send the email ?
[eluser]DynamiteN[/eluser]
[quote author="heavenquake" date="1266725850"]how about this solution: Code: // validation has passed. Now send the email ?[/quote] hmm , interesting , i will check it out , all though i am curious about this line Code: $message = 'Nick: ' . $nick . PHP_EOL . 'Name: ' . $name . PHP_EOL . PHP_EOL . $message; EDIT: Tried it now, it worked :O , now im gonna go google PHP_EOL ![]() Thank you ALOT what does that PHP_EOL do ? i will try it now anyway ![]()
[eluser]DynamiteN[/eluser]
This worked just as well , thank you so much never heard about PHP_EOL (End Of Line) before until now ![]() Code: $nick = $this->input->post('nick');
[eluser]heavenquake[/eluser]
It's great that it worked out for you! PHP_EOL is whatever the operating system the app is running on uses for linebreaks. |
Welcome Guest, Not a member yet? Register Sign In |