Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $post = array();
- foreach($_POST as $field => $value){
- $post[$field] = $value;
- }
- if(!$post['turnoff_1'])
- sendMail( $post );
- else
- sendFullMail( $post );
- function sendMail( $post ){
- $to = 'mail@mail.com';
- $subject = 'Form mail';
- $message =
- "Name: " . $post['name'] . " " . $post['last'] . "\n" .
- "Gender: " . $post['gender'] . "\n" .
- "Age: " . $post['age'] . "\n" .
- "Phone: " . $post["phone_1"] . "-" . $post["phone_2"] . "-" . $post["phone_3"] . "\n" .
- "Email: " . $post["mail"] . "\n" .
- "Income: " . $post["income"] . "\n" .
- "Zip: " . $post["zip"];
- $headers = 'FROM: sender@mail.com';
- mail($to, $subject, $message, $headers);
- }
- function sendFullMail( $post ){
- $personal = _preparePersonalInfo($post);
- $date = _prepareDateInfo($post);
- $dislikes = _prepareDislikesInfo($post);
- switch($post['priority']){
- case 'top':
- $priority = 'It\'s at the top of my priority list.';
- break;
- case 'three':
- $priority = 'It\'s one of my top three priorities.';
- break;
- case 'seven':
- $priority = 'It\'s one of my top seven priorities.';
- break;
- case 'none':
- $priority = 'It\'s not one of my priorities.';
- break;
- }
- switch($post['feel']){
- case 'excellent':
- $feel = 'Excellent, I know I need to try something new.';
- break;
- case 'ok':
- $feel = 'Ok, I\'m always open to try new ideas.';
- break;
- case 'uncomfortable':
- $feel = 'Little uncomfortable, something new to me.';
- break;
- case 'nervous':
- $feel = 'Nervous, this process is new to me.';
- break;
- }
- $to = 'mail@mail.com;
- $subject = 'From mail';
- $message = "
- <html>
- <head>
- <title>Send information</title>
- </head>
- <body>
- <table>
- <caption>Contact information</caption>
- <tr><td>Name: </td><td> " . $post["name"] . " " . $post["last"] ."</td></tr>
- <tr><td>Gender: </td><td> " . $post["gender"] . "</td></tr>
- <tr><td>Phone: </td><td> " . $post["phone_1"] . "-" .$post["phone_2"] . "-" .$post["phone_3"] ."</td></tr>
- <tr><td>Email: </td><td> " . $post["mail"] . " </td></tr>
- <tr><td>Income: </td><td> " . $post["income"] . "</td></tr>
- <tr><td>Zip: </td><td> " . $post["zip"] . " </td></tr>
- </table>
- <table>
- <caption>Additional profile information</caption>
- <tr><td>Ethnicity: </td><td> " . $post["ethnicity"] . " </td></tr>
- <tr><td>Religion: </td><td> " . $post["religion"] . " </td></tr>
- <tr><td>Work Schedule: </td><td> " . $post["w_schedule"] . " </td></tr>
- <tr><td>Usually available: </td><td> " . $post["available"] . " </td></tr>
- <tr><td>Marital status: </td><td> " . $post["m_status"] . " </td></tr>
- <tr><td>Education: </td><td> " . $post["education"] . " </td></tr>
- <tr><td>Employment status: </td><td> " . $post["employment"] . " </td></tr>
- <tr><td>Primary Social Goal: </td><td> " . $post["goal"] . " </td></tr>
- </table>
- <table>
- <caption>About yourself and your goals</caption>
- " . $personal . "
- </table>
- <table>
- <caption>What I'd like to know before the first date</caption>
- " . $date . "
- </table>
- <table>
- <caption>Your dislikes in the other person</caption>
- " . $dislikes . "
- </table>
- <table>
- <caption>Extended questionnaire</caption>
- <tr>
- <td>What type of priotity is it to you meet someone special for a loving relationship?</td>
- <td>" . $priority . "</td>
- </tr>
- <tr>
- <td>Which of the following best describes how do you feel about a relationship to further assit you?</td>
- <td>" . $feel . "</td>
- </tr>
- </table>
- <table>
- <caption>In your own words</caption>
- <tr>
- <td>Lenght of time at your current occupation?</td>
- <td>" . $post["l_occ"] . "</td>
- </tr>
- <tr>
- <td>What are the three biggest turn-offs in a potential partner?</td>
- <td>" . $post["turnoff_1"] . "\n</td>
- <td>" . $post["turnoff_2"] . "\n</td>
- <td>" . $post["turnoff_3"] . "</td>
- </tr>
- <tr>
- <td>How are you meeting people now?</td>
- <td>" . $post["h_meet"] . "</td>
- </tr>
- <tr>
- <td>How would you describe your ideal mate?</td>
- <td>" . $post["i_mate"] . "</td>
- </tr>
- </table>
- </body>
- </html>
- ";
- $headers = "FROM: sender@mail.com\n";
- $headers .= "MIME-Version: 1.0\n";
- $headers .= "Content-type: text/html; charset=iso-8859-1";
- mail($to, $subject, $message, $headers);
- }
- function _preparePersonalInfo( $data ){
- if($data['y_area'])
- $item = '<tr><td colspan="2">I am new to the area</td></tr>';
- if($data['y_goals'])
- $item .= '<tr><td colspan="2">I am dating someone who has different goals</td></tr>';
- if($data['y_right'])
- $item .= '<tr><td colspan="2">I have not been meeting the right people</td></tr>';
- if($data['y_children'])
- $item .= '<tr><td colspan="2">I would like to have children</td></tr>';
- if($data['y_married'])
- $item .= '<tr><td colspan="2">I would like to get married</td></tr>';
- if($data['y_dating'])
- $item .= '<tr><td colspan="2">I am not dating anyone seriously</td></tr>';
- if($data['y_busy'])
- $item .= '<tr><td colspan="2">I am too busy to make new contacts</td></tr>';
- if($data['y_people'])
- $item .= '<tr><td colspan="2">I would like to date many different people</td></tr>';
- if($data['y_parent'])
- $item .= '<tr><td colspan="2">I am already a parent</td></tr>';
- return $item;
- }
- function _prepareDateInfo($data){
- if($data['bef_hobbies'])
- $item = '<tr><td colspan="2">Hobbies</td></tr>';
- if($data['bef_athletics'])
- $item .= '<tr><td colspan="2">Athletics interests</td></tr>';
- if($data['bef_goals'])
- $item .= '<tr><td colspan="2">Goals</td></tr>';
- if($data['bef_religion'])
- $item .= '<tr><td colspan="2">Religion</td></tr>';
- if($data['bef_cultural'])
- $item .= '<tr><td colspan="2">Cultural interests</td></tr>';
- if($data['bef_occupation'])
- $item .= '<tr><td colspan="2">Occupation</td></tr>';
- if($data['bef_children'])
- $item .= '<tr><td colspan="2">Wants children</td></tr>';
- if($data['bef_looks'])
- $item .= '<tr><td colspan="2">Looks</td></tr>';
- if($data['bef_education'])
- $item .= '<tr><td colspan="2">Education</td></tr>';
- return $item;
- }
- function _prepareDislikesInfo($data){
- if($data['dis_jelaous'])
- $item = '<tr><td colspan="2">Over Jealous</td></tr>';
- if($data['dis_moody'])
- $item .= '<tr><td colspan="2">Moody</td></tr>';
- if($data['dis_interests'])
- $item .= '<tr><td colspan="2">Different interests</td></tr>';
- if($data['dis_goals'])
- $item .= '<tr><td colspan="2">Different goals</td></tr>';
- if($data['dis_self'])
- $item .= '<tr><td colspan="2">Self image</td></tr>';
- if($data['dis_infidelity'])
- $item .= '<tr><td colspan="2">Infidelity</td></tr>';
- if($data['dis_sexual'])
- $item .= '<tr><td colspan="2">Sexual incompatibility</td></tr>';
- if($data['dis_commit'])
- $item .= '<tr><td colspan="2">Lack of commitment</td></tr>';
- if($data['dis_affec'])
- $item .= '<tr><td colspan="2">Lack of affection</td></tr>';
- if($data['dis_viewp'])
- $item .= '<tr><td colspan="2">Parental viewpoints</td></tr>';
- if($data['dis_controlling'])
- $item .= '<tr><td colspan="2">Too controlling</td></tr>';
- if($data['dis_inc'])
- $item .= '<tr><td colspan="2">Incompatibility</td></tr>';
- if($data['dis_values'])
- $item .= '<tr><td colspan="2">Different values</td></tr>';
- if($data['dis_child'])
- $item .= '<tr><td colspan="2">Wants children</td></tr>';
- if($data['dis_life'])
- $item .= '<tr><td colspan="2">Different lifestyle</td></tr>';
- if($data['dis_trust'])
- $item .= '<tr><td colspan="2">Trust</td></tr>';
- if($data['dis_manage'])
- $item .= '<tr><td colspan="2">Financial management</td></tr>';
- if($data['dis_religion'])
- $item .= '<tr><td colspan="2">Religious difference</td></tr>';
- if($data['dis_comm'])
- $item .= '<tr><td colspan="2">Lack of communication</td></tr>';
- return $item;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement