Advertisement
Guest User

contact

a guest
Jun 21st, 2017
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.91 KB | None | 0 0
  1. <?php session_start() ?>
  2. <html lang="en">
  3.   <head>
  4.     <meta charset="utf-8">
  5.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6.     <meta name="viewport" content="width=device-width, initial-scale=1">
  7.    
  8.     <title>Precision - Contact</title>
  9.  
  10.     <!-- Bootstrap -->
  11.     <link href="css/bootstrap.min.css" rel="stylesheet">
  12.     <?php include('form_process.php'); ?>  
  13.     <link rel="stylesheet" type="text/css" href="css/main.css">
  14.   </head>
  15.   <body>
  16.      
  17.       <nav class="navbar navbar-inverse">
  18.       <div class="container">
  19.         <!-- Brand and toggle get grouped for better mobile display -->
  20.         <div class="navbar-header">
  21.           <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
  22.             <span class="sr-only">Toggle navigation</span>
  23.             <span class="icon-bar"></span>
  24.             <span class="icon-bar"></span>
  25.             <span class="icon-bar"></span>
  26.           </button>
  27.           <a class="navbar-brand" href="index.html">Precision</a>
  28.         </div>
  29.  
  30.         <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
  31.           <ul class="nav navbar-nav navbar-right">
  32.             <li><a href="about.html">About</a></li>
  33.             <li><a href="gallery.html">Gallery</a></li>
  34.             <li class="dropdown">
  35.               <a href="Products/index.html" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Products <span class="caret"></span></a>
  36.               <ul class="dropdown-menu">
  37.                 <li><a href="#">Exposed Aggregate</a></li>
  38.                 <li><a href="#">Other stuff</a></li>
  39.                 <li><a href="#">Other stuff</a></li>
  40.                 <li><a href="#">Other stuff</a></li>
  41.                 <li><a href="#">Other stuff</a></li>
  42.               </ul>
  43.             </li>
  44.               <li class="active"><a href="contact.html">Contact <span class="sr-only">(current)</span></a></li>
  45.           </ul>
  46.         </div>
  47.       </div>
  48.     </nav>
  49.      
  50.     <div class="jumbotron" id="conjumbo">
  51.         <h3 id="contactheader"></h3>
  52.         <p id="contactpara">Contact us</a></p>
  53.     </div>
  54.      
  55.     <div class="container" id="contactform">
  56.        
  57.     <?php
  58.         //init variables
  59.         $cf = array();
  60.         $sr = false;
  61.  
  62.         if(isset($_SESSION['cf_returndata'])){
  63.             $cf = $_SESSION['cf_returndata'];
  64.             $sr = true;
  65.         }
  66.     ?>
  67.        
  68.         <ul id="errors" class="<?php echo ($sr && !$cf['form_ok']) ? 'visible' : ''; ?>">
  69.             <li id="info">There were some problems with your form submission</li>
  70.             <?php
  71.             if(isset($cf['errors']) && count($cf['errors']) > 0) :
  72.                 foreach($cf['errors'] as $error) :
  73.             ?>
  74.             <li><?php echo $error ?></li>
  75.             <?php
  76.                 endforeach;
  77.             endif;
  78.             ?>
  79.         </ul>
  80.         <p id="success" class="<?php echo ($sr && $cf['form_ok']) ? 'visible' : ''; ?>">Thanks for your message! We will get back to you ASAP!</p>
  81.        
  82.       <form action="form_process.php" method="post" name="contact">
  83.          
  84.           <div class="form-group" id="fname">
  85.               <label>First Name</label>
  86.               <input name="fname" type="text" class="form-control" value="<?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['fname'] : '' ?>" placeholder="Add First Name" required autofocus>
  87.           </div>
  88.          
  89.           <div class="form-group" id="lname">
  90.               <label>Last Name</label>
  91.               <input name="lname" type="text" class="form-control" value="<?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['lname'] : '' ?>" placeholder="Add Last Name" required>
  92.           </div>
  93.          
  94.           <div class="form-group" id="email">
  95.               <label>Email</label>
  96.               <input name="email "type="email" class="form-control" value="<?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['email'] : '' ?>" placeholder="Add Email" required>
  97.           </div>
  98.          
  99.           <div class="form-group" id="phone">
  100.             <label>Phone</label>
  101.               <input name="phone" type="tel" class="form-control" value="<?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['phone'] : '' ?>" placeholder="Add Phone Number" required>
  102.           </div>
  103.          
  104.           <div class="form-group" id="enquiry">
  105.               <label for="enquiry">Enquiry: </label>
  106.                 <select id="enquiry" name="enquiry">
  107.                     <option value="Quote" <?php echo ($sr && !$cf['form_ok'] && $cf['posted_form_data']['enquiry'] == 'Quote') ? "selected='selected'" : '' ?>>Quote</option>
  108.                     <option value="Information" <?php echo ($sr && !$cf['form_ok'] && $cf['posted_form_data']['enquiry'] == 'Information') ? "selected='selected'" : '' ?>>Information</option>
  109.                 </select>
  110.           </div>
  111.          
  112.           <div class="form-group" id="message">
  113.               <label>Message</label>
  114.               <textarea name="message" class="form-control" placeholder="Add Message" required><?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['message'] : '' ?></textarea>
  115.           </div>
  116.          
  117.           <button type="submit" class="btn btn-primary" id="csub">Submit</button>
  118.           <button type="reset" class="btn btn-danger" id="cres">Reset</button>
  119.          
  120.       </form>
  121.        
  122.         <?php unset($_SESSION['cf_returndata']); ?>
  123.        
  124.      </div>
  125.      
  126.     <div style="height:400px"></div>
  127.      
  128.     <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  129.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  130.     <!-- Include all compiled plugins (below), or include individual files as needed -->
  131.     <script src="js/bootstrap.min.js"></script>
  132.   </body>
  133. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement