Advertisement
Guest User

Untitled

a guest
Sep 5th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.77 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <title>Mladi Metalac</title>
  5.     <meta charset="utf-8" />
  6.     <meta name="viewport" content="width=device-width, initial-scale=1">
  7.     <link rel="stylesheet" type="text/css" href="index.css">
  8. </head>
  9. <body>
  10.     <div id="wrapper">
  11.         <div id="topBar">
  12.             <div id="logoid">
  13.             MLADI<span class="logospan">METALAC</span>
  14.             </div>
  15.             <nav>
  16.                 <ul>
  17.                     <li><a href="index.html">POČETNA</a></li>
  18.                     <li><a href="about.html">O NAMA</a></li>
  19.                     <li class="active"><a href="contact.html">KONTAKT</a></li>
  20.                 </ul>
  21.             </nav>
  22.         </div>
  23.         <header>
  24.             <center><img src="images/header1.png" /></center>
  25.         </header>
  26.        
  27.         <div class="wrapper">
  28.         <div id="main" style="padding:5px 0 50px 0;">
  29.         <h3>Kontaktirajte nas</h3>
  30.         <h4>Popunite formu ispod, i mi ćemo vam se javiti u roku od 24 sata.</h4>
  31.        
  32.         <!-- Form -->
  33.         <form id="contact-form" action="contact.php" method="post">
  34.             <div>
  35.                 <label>
  36.                     <span>Ime: (obavezno)</span>
  37.                     <input placeholder="Unesite vaše ime" name="name" type="text" required autofocus>
  38.                 </label>
  39.             </div>
  40.             <div>
  41.                 <label>
  42.                     <span>Email: (obavezno)</span>
  43.                     <input placeholder="Unesite vašu email adresu" name="email" type="text" required>
  44.                 </label>
  45.             </div>
  46.             <div>
  47.                 <label>
  48.                     <span>Website: (obavezno)</span>
  49.                     <input placeholder="Počnite sa http://" name="website" type="url" required>
  50.                 </label>
  51.             </div>
  52.             <div>
  53.                 <label>
  54.                     <span>Poruka: (obavezno)</span>
  55.                     <textarea placeholder="Napišite Vašu poruku" name="message" required></textarea>
  56.                 </label>
  57.             </div>
  58.             <div>
  59.                 <button name="submit" type="submit" id="contact-submit">Pošalji Email</button>
  60.             </div>
  61.         </form>
  62.         <!-- /Form -->
  63.        
  64.         </div>
  65.     </div>
  66.  
  67.  
  68.         <footer id="theFooter">
  69.             <div class="column">
  70.                 <h3>Kontaktirajte nas</h3>
  71.                 <p>
  72.                     Adresa<br />
  73.                     71240, Hadžići<br />
  74.                     Sarajevo, Bosna i Hercegovina<br />
  75.                     +387 61 55 22 82<br />
  76.                     mladimetalac@live.com
  77.                 </p>
  78.             </div>
  79.             <div class="column">
  80.                 <h3 style="margin-bottom: 50px;">Potražite nas</h3>
  81.                 <ul>
  82.                     <li><a href="https://www.facebook.com/mladimetalac"><img src="images/facebook.png" /></a></li>
  83.                     <li><a href="#"><img src="images/twitter.png" /></a></li>
  84.                     <li><a href="https://plus.google.com/109990636859124733766"><img src="images/googleplus.png" /></a></li>
  85.                     <li><a href="https://www.youtube.com/user/Mladimetalac"><img src="images/youtube.png" /></a></li>
  86.                 </ul>
  87.             </div>
  88.             <div class="column">
  89.                 <img src="images/render.png" />
  90.             </div>
  91.         </footer>
  92.         </section>
  93.         <p style="text-align: center;">Copyright 2016. &#169; Website powered by <a href="benjo.html">Benjamin Fajić</a></p>
  94.     </div>
  95.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
  96.     <script type="text/javascript" src="script.js"></script>
  97.      //PHP Script
  98.     <?php
  99.     require 'PHPMailerAutoload.php';
  100.     if(isset($_POST['send']))
  101.     {
  102.     // Fetching data that is entered by the user
  103.     $email = $_POST['email'];
  104.     $password = $_POST['password'];
  105.     $to_id = $_POST['toid'];
  106.     $message = $_POST['message'];
  107.     $subject = $_POST['subject'];
  108.  
  109.     // Configuring SMTP server settings
  110.     $mail = new PHPMailer;
  111.     $mail->isSMTP();
  112.     $mail->Host = 'smtp.gmail.com';
  113.     $mail->Port = 587;
  114.     $mail->SMTPSecure = 'tls';
  115.     $mail->SMTPAuth = true;
  116.     $mail->Username = $email;
  117.     $mail->Password = $password;
  118.  
  119.     // Email Sending Details
  120.     $mail->addAddress($to_id);
  121.     $mail->Subject = $subject;
  122.     $mail->msgHTML($message);
  123.  
  124.     // Success or Failure
  125.     if (!$mail->send()) {
  126.     $error = "Mailer Error: " . $mail->ErrorInfo;
  127.     echo '<p id="para">'.$error.'</p>';
  128.     }
  129.     else {
  130.     echo '<p id="para">Message sent!</p>';
  131.     }
  132.     }
  133.     else{
  134.     echo '<p id="para">Please enter valid data</p>';
  135.     }
  136.     ?>
  137. </body>
  138. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement