Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php session_start() ?>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Precision - Contact</title>
- <!-- Bootstrap -->
- <link href="css/bootstrap.min.css" rel="stylesheet">
- <?php include('form_process.php'); ?>
- <link rel="stylesheet" type="text/css" href="css/main.css">
- </head>
- <body>
- <nav class="navbar navbar-inverse">
- <div class="container">
- <!-- Brand and toggle get grouped for better mobile display -->
- <div class="navbar-header">
- <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
- <span class="sr-only">Toggle navigation</span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- <a class="navbar-brand" href="index.html">Precision</a>
- </div>
- <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
- <ul class="nav navbar-nav navbar-right">
- <li><a href="about.html">About</a></li>
- <li><a href="gallery.html">Gallery</a></li>
- <li class="dropdown">
- <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>
- <ul class="dropdown-menu">
- <li><a href="#">Exposed Aggregate</a></li>
- <li><a href="#">Other stuff</a></li>
- <li><a href="#">Other stuff</a></li>
- <li><a href="#">Other stuff</a></li>
- <li><a href="#">Other stuff</a></li>
- </ul>
- </li>
- <li class="active"><a href="contact.html">Contact <span class="sr-only">(current)</span></a></li>
- </ul>
- </div>
- </div>
- </nav>
- <div class="jumbotron" id="conjumbo">
- <h3 id="contactheader"></h3>
- <p id="contactpara">Contact us</a></p>
- </div>
- <div class="container" id="contactform">
- <?php
- //init variables
- $cf = array();
- $sr = false;
- if(isset($_SESSION['cf_returndata'])){
- $cf = $_SESSION['cf_returndata'];
- $sr = true;
- }
- ?>
- <ul id="errors" class="<?php echo ($sr && !$cf['form_ok']) ? 'visible' : ''; ?>">
- <li id="info">There were some problems with your form submission</li>
- <?php
- if(isset($cf['errors']) && count($cf['errors']) > 0) :
- foreach($cf['errors'] as $error) :
- ?>
- <li><?php echo $error ?></li>
- <?php
- endforeach;
- endif;
- ?>
- </ul>
- <p id="success" class="<?php echo ($sr && $cf['form_ok']) ? 'visible' : ''; ?>">Thanks for your message! We will get back to you ASAP!</p>
- <form action="form_process.php" method="post" name="contact">
- <div class="form-group" id="fname">
- <label>First Name</label>
- <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>
- </div>
- <div class="form-group" id="lname">
- <label>Last Name</label>
- <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>
- </div>
- <div class="form-group" id="email">
- <label>Email</label>
- <input name="email "type="email" class="form-control" value="<?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['email'] : '' ?>" placeholder="Add Email" required>
- </div>
- <div class="form-group" id="phone">
- <label>Phone</label>
- <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>
- </div>
- <div class="form-group" id="enquiry">
- <label for="enquiry">Enquiry: </label>
- <select id="enquiry" name="enquiry">
- <option value="Quote" <?php echo ($sr && !$cf['form_ok'] && $cf['posted_form_data']['enquiry'] == 'Quote') ? "selected='selected'" : '' ?>>Quote</option>
- <option value="Information" <?php echo ($sr && !$cf['form_ok'] && $cf['posted_form_data']['enquiry'] == 'Information') ? "selected='selected'" : '' ?>>Information</option>
- </select>
- </div>
- <div class="form-group" id="message">
- <label>Message</label>
- <textarea name="message" class="form-control" placeholder="Add Message" required><?php echo ($sr && !$cf['form_ok']) ? $cf['posted_form_data']['message'] : '' ?></textarea>
- </div>
- <button type="submit" class="btn btn-primary" id="csub">Submit</button>
- <button type="reset" class="btn btn-danger" id="cres">Reset</button>
- </form>
- <?php unset($_SESSION['cf_returndata']); ?>
- </div>
- <div style="height:400px"></div>
- <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
- <!-- Include all compiled plugins (below), or include individual files as needed -->
- <script src="js/bootstrap.min.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement