vishwamano

source of vishwamano.com
git clone git://git.ricketyspace.net/vishwamano.git
Log | Files | Refs

commit 30827edf8efed936f97a931cabcd4348b3a09888
parent 760831f518dadac53d766434c8b1753d654b5885
Author: rsiddharth <rsiddharth@ninthfloor.org>
Date:   Thu, 27 Jun 2013 11:19:25 +0530

in as/ we've a 'reg form' (a modal).

Diffstat:
as/index.html | 41++++++++++++++++++++++++++++++++++-------
as/reg-error.html | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
as/reg-handler.php | 44++++++++++++++++++++++++++++++++++++++++++++
as/registered.html | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 212 insertions(+), 7 deletions(-)

diff --git a/as/index.html b/as/index.html @@ -116,14 +116,41 @@ <h3 id="RegisterNow">Photography Class Registration</h3> </div> <div class="modal-body"> - <p> Send an email - to <a href="mailto:vishwa91photography@gmail.com">vishwa91photography@gmail.com </a> - for the upcoming batch details. - </p> - </div> + <form class="form-horizontal" id="reg-form" method="POST" action="/as/reg-handler.php"> + <fieldset> + <div class="control-group"> + <label class="control-label" for="name">Name</label> + <div class="controls"> + <input type="text" id="name" name="name" placeholder="Spock" required> + </div> + </div> + + <div class="control-group"> + <label class="control-label" for="email">Email</label> + <div class="controls"> + <input type="email" id="email" name="email" placeholder="spock@cyb.org" required> + </div> + </div> + <div class="control-group"> + <label class="control-label" for="blurb"> Tell us about yourself </label> + <div class="controls"> + <textarea id="blurb" name="blurb" rows="3" + placeholder="Blurb" required></textarea> + </div> + </div> + <div class="control-group"> + <label class="control-label" for="humantest"> What is 100 + 1 ?</label> + <div class="controls"> + <input type="text" id="humantest" name="humantest" placeholder="Prove that you're not a bot." required> + </div> + </div> + </fieldset> + </form> + </div> <div class="modal-footer"> - <button class="btn btn-inverse" data-dismiss="modal" aria-hidden="true">Close</button> - </div> + <button class="btn btn-inverse" type="submit" value="Submit" + form="reg-form" aria-hidden="true">Register</button> + </div> </div> </div> </div> diff --git a/as/reg-error.html b/as/reg-error.html @@ -0,0 +1,68 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <title> Message Handler - Vishwa Manoharan Photography </title> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen"> + <link href="/css/bootstrap-lightbox.min.css" rel="stylesheet" media="screen"> + <link href="/css/custom.css" rel="stylesheet" media="screen"> +</head> +<body> + <div class="container-fluid"> + <div class="navbar navbar-inverse"> + <div class="navbar-inner"> + <a class="brand" href="/">Vishwa Manoharan Photography</a> + <ul class="nav pull-right"> + <li><a href="/">Home</a></li> + <li><a href="/gallery/"> Gallery </a></li> + <li><a href="/as/"> Apertures & Shutters</a></li> + <li><a href="/bio/"> Bio </a></li> + <li><a href="/contact/"> Contact </a></li> + </ul> + </div> + </div> + </div> + + <div class="container-fluid"> + <div class="row-fluid"> + <div class="offset3 span6"> + <div class="alert alert-error"> + <strong>Registration Error!</strong> You've either failed + the human test or you've not filled the fields properly. + </div> + <p class="text-center"> + <a class="btn btn-mini btn-inverse" href="/as/"> + <i class="icon-chevron-left icon-white"></i> + Back + </a> + </p> + </div> + + </div> + </div> + + <footer class="footer"> + <div class="container-fluid"> + <p> + Copyright &copy; 2013 + <a href="http://vishwamano.com/" property="cc:attributionName" + rel="cc:attributionURL"> + Vishwa Manoharan. + </a> + <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_US"> + <img alt="Creative Commons License" style="border-width:0" src="/img/cc.png" /> + </a> + </p> + <ul class="footer-links"> + <li class="muted"> &middot; </li> + <li> <a href="/colophon/"> Colophon </a> </li> + <li class="muted"> &middot; </li> + </ul> + </div> + </footer> + <script src="/js/jquery-1.10.0.min.js"></script> + <script src="/js/bootstrap.min.js"></script> + <script src="/js/bootstrap-lightbox.min.js"></script> +</body> +</html> diff --git a/as/reg-handler.php b/as/reg-handler.php @@ -0,0 +1,44 @@ +<?php + +/** + * + * Wrote with help from HTML Form Guide <http://www.html-form-guide.com/contact-form> + * + */ + +$myemail = 'vishwa91photography@gmail.com'; + +$name = $_POST['name']; +$email_address = $_POST['email']; +$blurb = $_POST['blurb']; +$humantest = $_POST['humantest']; + +$humantest_answer= "101"; + +if(strcmp($humantest, $humantest_answer)==0) +{ + if(empty($_POST['name']) || + empty($_POST['email']) || + empty($_POST['blurb'])) { + // redirect to the mesg-error page + header('Location: /as/reg-error.html'); + return; + } + $to = $myemail; + $email_subject = "[VishaMano.com] A&S Registration from $name"; + + $email_body = "$name <$email_address> has registered for the A&S Basic Level 1 Weekend Photography Course \n\n". + "About $name:\n\n $blurb"; + + $headers = "From: no-reply@vishwamano.com\n"; + $headers .= "Reply-To: $email_address"; + + mail($to,$email_subject,$email_body,$headers); + //redirect to mesg-sent page + header('Location: /as/registered.html'); +} +else { + // redirect to the mesg-error page + header('Location: /as/reg-error.html'); +} +?> diff --git a/as/registered.html b/as/registered.html @@ -0,0 +1,66 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <link href="/css/bootstrap.min.css" rel="stylesheet" media="screen"> + <link href="/css/bootstrap-lightbox.min.css" rel="stylesheet" media="screen"> + <link href="/css/custom.css" rel="stylesheet" media="screen"> + <title> Vishwa Manoharan Photography </title> +</head> +<body> + <div class="container-fluid"> + <div class="navbar navbar-inverse"> + <div class="navbar-inner"> + <a class="brand" href="/">Vishwa Manoharan Photography</a> + <ul class="nav pull-right"> + <li><a href="/">Home</a></li> + <li><a href="/gallery/"> Gallery </a></li> + <li><a href="/as/"> Apertures & Shutters</a></li> + <li><a href="/bio/"> Bio </a></li> + <li><a href="/contact/"> Contact </a></li> + </ul> + </div> + </div> + </div> + + <div class="container-fluid"> + <div class="row-fluid"> + <div class="offset3 span6"> + <div class="alert alert-success"> + <strong>Thank you for registering!</strong> Vishwa Manoharan will get back to you soon. + </div> + <p class="text-center"> + <a class="btn btn-mini btn-inverse" href="/"> + <i class="icon-home icon-white"></i> + Home + </a> + </p> + </div> + </div> + </div> + + <footer class="footer"> + <div class="container-fluid"> + <p> + Copyright &copy; 2013 + <a href="http://vishwamano.com/" property="cc:attributionName" + rel="cc:attributionURL"> + Vishwa Manoharan. + </a> + <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_US"> + <img alt="Creative Commons License" style="border-width:0" src="/img/cc.png" /> + </a> + </p> + <ul class="footer-links"> + <li class="muted"> &middot; </li> + <li> <a href="/colophon/"> Colophon </a> </li> + <li class="muted"> &middot; </li> + </ul> + </div> + </footer> + <script src="/js/jquery-1.10.0.min.js"></script> + <script src="/js/bootstrap.min.js"></script> + <script src="/js/bootstrap-lightbox.min.js"></script> +</body> +</html>