Ok this is what i've got:
This bit is generating an email (not finished but ill get to that in a bit):
This bit is what is shown on the page (not including the bit above it which is all CSS stuff for looks):
What im aiming to do is have a page where the left column of a tables contents is generated from a txt file, this bit works fine, now what i want is for the second column to be editable so people can input data into them to be submitted... that's my first problem
The second problem i have which i can't solve until i've solved problem one is getting all this information into the email section above, if i make the tables myself i get variable names etc which i can do easily but i want another member of staff to be able to edit the name lists containted in "7b.txt" hence why im doing it this way.
Anyone able to help me out with this? im quite a novice when it comes to web coding.
This bit is generating an email (not finished but ill get to that in a bit):
Code:
<?php
if(isset($_POST['submit'])) {
$name = trim($_POST['Student']);
$emailTo = '[email protected]';
$subject="7B Praise Points";
$headers = "From: " . $emailTo . "\r\nReply-To: " . $emailTo;
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$message = '
<html>
<head>
<title>7B Praise Points</title>
</head>
<body>
<h1 align="center"><strong>7B Praise Points</strong></h1>
<pre> </pre>
<p> </p>
</body>
</html>
';
mail($emailTo, $subject, $message, $headers);
$emailSent = true;
}
?>
This bit is what is shown on the page (not including the bit above it which is all CSS stuff for looks):
Code:
<body>
<h1 align="center"><u>7B Praise Points</u></h1>
<div id="contact-wrapper">
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" id="contactform">
<?php
$file = file("7B.txt");
$count = 0;
print "<table cellspacing='2'>\n
<tr><td>Student Name</td><td>Number of Praise Points</td></tr>\n";
foreach($file as $line){
$line = trim($line);
$split = split("\t",$line);
print "<tr>\n<td>$split[0]<input name='name$count' type='hidden' value='$split[0]'></td>\n<td>$split[1]<input name='points$count' type='hidden' value='$split[1]'></td>\n</tr>";
$count++;
}
print "</table>";
?>
<p>
<input name="submit" type="submit" value="Submit">
</p>
</form>
</div>
</body>
What im aiming to do is have a page where the left column of a tables contents is generated from a txt file, this bit works fine, now what i want is for the second column to be editable so people can input data into them to be submitted... that's my first problem
The second problem i have which i can't solve until i've solved problem one is getting all this information into the email section above, if i make the tables myself i get variable names etc which i can do easily but i want another member of staff to be able to edit the name lists containted in "7b.txt" hence why im doing it this way.
Anyone able to help me out with this? im quite a novice when it comes to web coding.