Permalink
Browse files

added an email form handled by a function in _thread

  • Loading branch information...
1 parent 7bbe98f commit 5dec1f00e9eca1a014b7871faec1e6af4cb8548f @nickcottrell committed May 6, 2012
Showing with 87 additions and 14 deletions.
  1. +4 −0 _includes/header.textile
  2. +49 −6 _thread.textile
  3. +6 −2 about/index.php
  4. +6 −2 about/subject/index.php
  5. +18 −3 contact/index.php
  6. +4 −1 index.php
View
@@ -5,6 +5,10 @@
<title><?pageName()?></title>
+<meta name="description" content="<?pageDescription()?>">
+<meta name="keywords" content="<?pageKeywords()?>">
+<meta name="author" content="Nick Cottrell, Brand Experience Designer">
+
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
View
@@ -1,6 +1,15 @@
-<?
+<?//================================
+
$_ENV['pageNameGLOB'] = $pageName;
$_ENV['layoutNameGLOB'] = $layoutName;
+$_ENV['pageDescriptionGLOB'] = $pageDescription;
+$_ENV['pageKeywordsGLOB'] = $pageKeywords;
+
+
+function pathext() {
+ $var = $_SERVER['PATH_INFO'];
+ echo $var;
+}
function top() {
include '_includes/header.textile';
@@ -28,14 +37,48 @@ function navbttm() {
include '_includes/navfooter.textile';
}
-function pathext() {
- $var = $_SERVER['PATH_INFO'];
+function pagename() {
+ $var = $_ENV['pageNameGLOB'];
echo $var;
}
-function pagename() {
- $var = $_ENV['pageNameGLOB'];
+function pageDescription() {
+ $var = $_ENV['pageDescriptionGLOB'];
+ echo $var;
+}
+
+function pageKeywords() {
+ $var = $_ENV['pageKeywordsGLOB'];
echo $var;
}
-?>
+function contactsub() {
+
+ if(isset($_POST['Submit'])) {
+ $to = 'nick.a.cottrell@gmail.com' ;
+ $subject = '** from button-down contact form **';
+ $headers = 'MIME-Version: 1.0' . "\r\n";
+ $headers = 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
+ $message = "Name: ".$_POST['name']."<br />
+ Email: ".$_POST['email']."<br />
+ Message: ".$_POST['message']."<br />" ;
+ mail($to, $subject, $message, $headers);
+
+ }
+
+ $var = $_SERVER['PATH_INFO'];
+ echo ($var.'?sent=yes');
+}
+
+function msgstatus() {
+ $val = $_GET['sent'];
+
+ if ($val == "yes") {
+ echo "Your message has been sent.";
+ }
+ else {
+ echo "Type your message below.";
+ };
+}
+
+//=================================?>
View
@@ -1,10 +1,14 @@
<?//================================
+
$pageName = "About";
+$pathExt = null;
$layoutName = "default";
+$pageDescription = "This page is about button-down";
+$pageKeywords = "button-down, about";
//=================================
-$var = $_SERVER['DOCUMENT_ROOT'];
-include $var."/_thread.textile";
+$needle = $_SERVER['DOCUMENT_ROOT'];
+include $needle."/_thread.textile";
//=================================?>
<?top()?>
View
@@ -1,10 +1,14 @@
<?//================================
+
$pageName = "About - Subject";
+$pathExt = null;
$layoutName = "default";
+$pageDescription = "This page is a button-down sub page of the about section";
+$pageKeywords = "sub, subject, about";
//=================================
-$var = $_SERVER['DOCUMENT_ROOT'];
-include $var."/_thread.textile";
+$needle = $_SERVER['DOCUMENT_ROOT'];
+include $needle."/_thread.textile";
//=================================?>
<?top()?>
View
@@ -1,17 +1,32 @@
<?//================================
+
$pageName = "Contact";
+$pathExt = null;
$layoutName = "default";
+$pageDescription = "This page is a button-down contact form.";
+$pageKeywords = "contact, form, submit";
//=================================
-$var = $_SERVER['DOCUMENT_ROOT'];
-include $var."/_thread.textile";
+$needle = $_SERVER['DOCUMENT_ROOT'];
+include $needle."/_thread.textile";
//=================================?>
<?top()?>
<h2>Contact</h2>
-<p><a href="##">email@test.com</a><p>
+<h3><?msgstatus()?></h3>
+
+<form name="form" method="post" action="<?contactsub()?>">
+Name<br />
+<input name="name" type="text" id="name" size="50"><br /><br />
+Email<br />
+<input name="email" type="text" id="email" size="50"><br /><br />
+Message<br />
+<textarea name="message" cols="50" rows="4" id="message"></textarea><br /><br />
+<input type="submit" name="Submit" value="Submit"> <input type="reset" name="Submit2" value="Reset">
+</form>
+
<?bttm()?>
View
@@ -3,9 +3,12 @@
$pageName = "Home";
$pathExt = null;
$layoutName = "default";
+$pageDescription = "This is the Home page.";
+$pageKeywords = "clean, php, simple";
//=================================
-require '_thread.textile';
+$needle = $_SERVER['DOCUMENT_ROOT'];
+include $needle."/_thread.textile";
//=================================?>
<?top()?>

0 comments on commit 5dec1f0

Please sign in to comment.