Advertisement
Rusudan

Untitled

Nov 22nd, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.73 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <title>შეტყობინება</title>
  5.     <link rel="stylesheet" type="text/css" href="style.css">
  6. </head>
  7. <body>
  8.  
  9.     <h1>მადლობა!</h1>
  10.     <?php
  11.     $sex = $_POST['sex'];
  12.     $title;
  13.     if ($sex == 'female'){
  14.         $title = 'ქალბატონო';
  15.     } elseif ($sex == 'male'){
  16.         $title = 'ბატონო';
  17.     } else {
  18.         $title = ' ';
  19.     }
  20.    
  21.     $country = $_POST['country'];
  22.     $country_str;
  23.     switch ($country){
  24.         case 'ukr':
  25.         $country_str = 'უკრაინა';
  26.         break;
  27.         case 'npl':
  28.         $country_str = 'ნეპალი';
  29.         break;
  30.         case 'spain':
  31.         $country_str = 'ესპანეთი';
  32.         break;
  33.         default:
  34.         $country_str = 'ტრაკი';
  35.     }
  36.    
  37.     $f_name = $_POST['f_name'];
  38.     ?>
  39.     <div id="message">
  40.     <p>თქვენი შეტყობინება:</p>
  41.     <p><? print("სასურველი ქვეყანა - " . $country_str . ", ტურის დაწყების სასურველი თარიღი " . $_POST['start_date'] )?>
  42.     </p>
  43.     <p><? print($_POST['message']) ?></p>
  44.     თქვენი ფერია <? print $_POST['color'] ?>
  45.      
  46.     </div>
  47.    
  48.     <p><? print $title; print $f_name; ?> თქვენი შეტყობინება გაგზავნილია. უმოკლეს დროში დაგიკავშირდებით.</p>
  49.    
  50.    
  51.     <?php
  52.         $from = $_POST['mail'];
  53.         $to = 'tsiskreli@highlander.ge';
  54.         $subject = "ტურის შეკვეთა $country_str";
  55.         $msg = $_POST['f_name'] . " " . $_POST['l_name'] . " \n"  .
  56.             $_POST['town'] . " " . $country_str . " დაწყების სასურველი თარიღი " . $_POST['start_date'] . " \n" .
  57.             "საკონტაქტო ინფორმაცია: " . $_POST['mail'] . " " . $_POST['phone'] . " " . $_POST['url'] . " \n" .
  58.             $_POST['message'];
  59.            
  60.         mail($to, $subject, $msg);
  61.        
  62.        
  63.         $l_name = $_POST['l_name'];
  64.         $city = $_POST['city'];
  65.         $date = $_POST['date'];
  66.         $phone = $_POST['phone'];
  67.         $url = $_POST['url'];
  68.         $color = $_POST['color'];
  69.         $message = $_POST['message'];
  70.        
  71.         $dbc = mysqli_connect('localhost', 'highler_learn', 'KarambA77', 'highler_learning' )
  72.         or die('Error connecting to MySQL database server.');
  73.        
  74.        
  75.        
  76.         $query = "INSERT INTO formCapture ('first_name', 'last_name', 'city', 'country', 'date', 'sex', 'mail', 'phone', 'web', 'color', 'message') VALUES ('$f_name', '$l_name', '$city', '$country', '$date', '$sex', '$from', '$phone', '$url', '$color', '$message')";
  77.         $result = mysqli_query($dbc, $query) or die('Error querying database.');
  78.         mysqli_close($dbc);
  79.        
  80. ?>
  81.        
  82.    
  83.  
  84. </body>
  85. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement