<?php require_once('../../Connections/?????.php'); ?>
<?php
session_start();
?>
<?php
$colname_rstUse = "1";
if (isset($_SESSION['NAME'])) {
$colname_rstUse = (get_magic_quotes_gpc()) ? $_SESSION['NAME'] : addslashes($_SESSION['NAME']);
}
$colname_rstTex = "1";
if (isset($_GET['read'])) {
$colname_rstTex = (get_magic_quotes_gpc()) ? $_GET['read'] : addslashes($_GET['read']); //Collects indentifying title from URL
}
$user=$_SESSION['NAME']; //sets username variable to select records from dbase
mysql_select_db($database_tormented3, $tormented3);
$query_rstTex = sprintf("SELECT * FROM authtext WHERE username='$user' AND title='%s'", $colname_rstTex); //Sets up Recordset from "authtext" dbase
$rstTex = mysql_query($query_rstTex, $tormented3) or die(mysql_error());
$row_rstTex = mysql_fetch_assoc($rstTex);
$totalRows_rstTex = mysql_num_rows($rstTex);
mysql_select_db($database_tormented3, $tormented3);
$query_rstAut = sprintf("SELECT * FROM authors WHERE username = '$user'"); //Sets up Recordset from "authors" dbase
$rstAut = mysql_query($query_rstAut, $tormented3) or die(mysql_error());
$row_rstAut = mysql_fetch_assoc($rstAut);
$totalRows_rstAut = mysql_num_rows($rstAut);
?>
<?php
$reader = $_POST['reader']; //Set up variables for email messages
$details = $_POST['feedback'];
$email = $_POST['email1'];
$auth = $row_rstAut['firstname']; // More variables for email message
$story = $row_rstTex['title'];
if(isset($_POST['Submit'])) // 'submit' is the name of your submit button
{
$error = '';
// process and validate a field:
$email = trim($_POST['email1']);
}
if($email == ''){ // if name is empty, show an error message (us that for required fields)
$error .= '<p style="color:red;">You missed out your email address!</p>'; // error message
}
if($error == '')
{ // if no error, process the form
// place here your mail script
$message = "Dear $auth, You have had feedback from the U3A Writers Website\n"; // Set up the email message to the client.
$message .= "about your piece, $story, from $reader, as follows:\n\n";
$message .= " $details .\n\n";
$message .= "$reader's email address is $email. \n";
$inform_me = "Feedback re. $story have been sent to $auth"; // Set up the email to inform me of the information request.
// The emails:
if(mail("aa@bb.com", "Feedback", $message, "From: Dart Valley Writers")
&& mail("noone@nowhere.com", "Feedback Alert", $inform_me, "From: Dart valley writers"))
//{
header('location: [URL unfurl="true"]http://www.dartvalleywriters.org.uk/email_redirect.php');//[/URL] redirect to page if email has been successfully sent
exit;
}
else{
$error == '<p style="color:red;">An error occured, your email could not be sent. Please try
again</p>';
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<title>Feedback Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- DO NOT MOVE! The following AllWebMenus linking code section must always be placed right AFTER the BODY tag-->
<!-- ******** BEGIN ALLWEBMENUS CODE FOR menu ******** -->
<script type="text/javascript">var MenuLinkedBy="AllWebMenus [4]",awmMenuName="menu",awmBN="922";</script><script charset="UTF-8" src="menu/menu.js" type="text/javascript"></script><script type="text/javascript">awmBuildMenu();</script>
<!-- ******** END ALLWEBMENUS CODE FOR menu ******** -->
<div id="wrapper">
<table width="98%" border="0">
<tr>
<td><table width="100%" border="0">
<tr class="bluecell">
<td colspan="2"><p> </p>
<p>Dart Valley Writers U3A</p>
<p> </p></td>
<td colspan="2"> <?php echo $error; ?></td>
<td width="1%"> </td>
<td width="4%"> </td>
</tr>
<tr>
<td width="23%" class="bluecell"> </td>
<td width="15%" class="up_right" id="awmAnchor-menu"> </td>
<td width="19%" class="up_right"><h6>"<?php echo $row_rstTex['title'] ;?>"</h6></td>
<td colspan="2" class="textcell">by <?php echo $row_rstAut['firstname']; ?> <?php echo $row_rstAut['surname']; ?> </td>
<td class="bluecell"> </td>
</tr>
<tr>
<td class="bluecell"> </td>
<td class="up_right"><p> </p>
<p>Your name : </p>
<p>Your email address : </p>
<p> </p>
<p><span class="textcell">Your Feedback : </span></p>
</td>
<td colspan="2" class="textcell"><form name="email1" method="POST" >
<p> </p>
<p>
<input name="reader" type="text" id="reader" size="50">
</p>
<p>
<input name="email1" type="text" id="email1" size="60">
</p>
<p> </p>
<p>
<textarea name="feedback" cols="70" rows="6" id="feedback"></textarea>
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form> <p align="left"> </p>
<p align="left"> </p></td>
<td class="textcell"> </td>
<td class="bluecell"> </td>
</tr>
<tr>
<td class="bluecell"> </td>
<td class="bluecell"> </td>
<td colspan="2" class="bluecell"> </td>
<td class="bluecell"> </td>
<td class="bluecell"> </td>
</tr>
</table></td>
</tr>
</table>
<p> </p>
</div>
</body>
</html>
<?php
mysql_free_result($rstTex);
mysql_free_result($rstAut);
?>