Changeset - eab20c15a6b2
[Not reviewed]
default
0 1 2
ethanzonca - 15 years ago 2010-10-10 17:09:19

Added feedback form
3 files changed with 94 insertions and 0 deletions:
0 comments (0 inline, 0 general)
feedback-submit.php
Show inline comments
 
new file 100644
 
<?php
 
        include_once 'inc/class.page.php';
 
        $feedbackpage = new page('Feedback');
 

	
 
	$toaddrs = array('ethanzonca@gmail.com, ngelderloos7@gmail.com, ohnobinki@ohnopublishing.net');
 
	$subject = '[SlatePermutate] - Feedback';
 
?>
 

	
 
<h3>Thanks!</h3>
 

	
 

	
 
<?php
 

	
 
$ip = $_POST['ip'];
 
$httpagent = $_POST['httpagent'];
 
$fromdom = $_POST['fromdom'];
 
$nameis = $_POST['nameis'];
 
$visitormail = $_POST['visitormail'];
 
$feedback = $_POST['feedback'];
 
$rating = $_POST['rating'];
 

	
 
if (eregi('http:', $feedback)) { 
 
  echo 'Please do not include URLs in your submission! Please click "back" and try again.';
 
}
 
if((!$visitormail == "") && (!strstr($visitormail,"@") || !strstr($visitormail,"."))) {
 
  echo '<p>Please click "back" and enter valid e-mail address.</p>';
 
}
 
if(empty($nameis) || empty($feedback) || empty($visitormail)) {
 
  echo '<p>Please click "back" and fill in all fields.</p>';
 
}
 

	
 

	
 
$feedback = stripcslashes($feedback);
 

	
 
$message = date('l, F j, Y, g:i a') ."
 
From: $nameis ($visitormail) \n
 
Rating: $rating 
 
Feedback: $feedback 
 
\n
 
IP = $ip 
 
Browser = $httpagent 
 
Deployment = $fromdom
 
";
 

	
 
$from = "From: $visitormail\r\n";
 

	
 
foreach($toaddrs as $toaddr){
 
  mail($toaddr, $subject, $message, $from);
 
}
 

	
 

	
 
?>
 

	
 
<p>Thanks for helping make SlatePermutate better. Your feedback is greatly appreciated.</p>
 
<p>We will attempt to respond via email if your feedback lends itself to a response.</p>
 

	
 

	
 
<?php
 
  $feedbackpage->foot();
feedback.php
Show inline comments
 
new file 100644
 
<?php 
 
	include_once 'inc/class.page.php'; 
 
	$mypage = new page('Feedback');
 

	
 
	$ipi = $_SERVER['REMOTE_ADDR'];
 
	$fromdom = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
 
	$httpagenti = $_SERVER['HTTP_USER_AGENT'];
 
?>
 
<form action="feedback-submit.php" method="post">
 
<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
 
<input type="hidden" name="fromdom" value="<?php echo $fromdom ?>" />
 
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />
 
<h2>Feedback Form</h2>
 
Name: <input type="text" name="nameis" size="20" /><br />
 
Email:&nbsp; <input type="text" name="visitormail" size="20" /><br />
 

	
 

	
 
<br/> Overall Rating:<br/> <input checked="checked" name="rating" type="radio" value="Good" />Good <input name="rating" type="radio" value="Buggy" />Buggy  <input name="rating" type="radio" value="Needs more features" />Needs more features <input name="rating" type="radio" value="Don't know" />Don't Know
 

	
 
<br /><br />
 
<h3>General Comments</h3>
 
<p>
 
<textarea name="feedback" rows="6" cols="40"></textarea>
 
</p>
 
<input type="submit" value="Submit Feedback" />
 
</form>
 

	
 

	
 

	
 

	
 

	
 

	
 
<?php
 
$mypage->foot();
todo.php
Show inline comments
 
@@ -5,6 +5,7 @@
 

	
 
<h3>Items to Consider:</h3>
 
<ul>
 
	<li>Add place to put prof name</li>
 
	<li>Autoincrement section num/letter/custom labels</li>
 
	<li>Make output and print output formatting look nicer</li>
 
	<li>Make printing work for saved jobs where jobkey != 0</li>
0 comments (0 inline, 0 general)