Location: PHPKode > projects > Standardized Test Practice Engine > stpe/admin/index.php
Copyright 2004 by Jonathan Bell and Daniel Perelman
This file is part of STPE - the Standardized Test Practice Engine.

    STPE is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    STPE is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Foobar; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

	if($_POST['password1'] == $_POST['password2']){
		$sql2 = "SELECT * from `students` WHERE `teacher_name` = '$PHP_AUTH_USER' LIMIT 1";
$total_result = @mysql_query($sql2, $connection) or die("Error #". mysql_errno() . ": " . mysql_error());
$total_found = @mysql_num_rows($total_result);

	while ($row = mysql_fetch_array($total_result)) {
		$sql = "UPDATE `passwords` SET `password` = '$pass' where `name` = '$PHP_AUTH_USER'";
		$total_result = @mysql_query($sql, $connection) or die("Error #". mysql_errno() . ": " . mysql_error());
		$themessage = 'Just a little note reminding you - you have just changed your password to '.$_POST['password1'].'

Jonathan Bell
Dan Perelman';

sock_mail($emailaddy,"Your [updated] logon credentials for the Amity SAT II Chemistry site",$themessage,"","hide@address.com");

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<title><?php echo $site_name; ?> Admin: Home</title>

<link rel="stylesheet" type="text/css" href="../style.css" />
<?php include("../header.inc.php"); ?>
		<tr valign="top">
			<?php include("../nav.inc.php"); ?>
			<td class="maincontent">
				<p>Welcome to the administration control panel, <?php echo $PHP_AUTH_USER ?>. Please select an action.</p>
				<p><a href="counter.php">Counter stats</a></p>
				<th>Test adding users</th><th>Test taking users</th><th>Review management</th><th>Other</th></tr>
				<td><a href="newadder.php">New test adding user</a></td>
				<td><a href="newtake.php">New test taking user</a><br />
				<a href="newtake.php?method=import">Import test taking users</a></td>
				<td><a href="newadmin.php">New administrator</a></td>
				<td><a href="editadders.php">Edit test adding users</a></td>
				<td><a href="edittake.php">Edit test taking users</a></td>
				<td><a href="editreview.php">Edit a review</a><br />
				<a href="editquestions.php">Edit questions</a></td>
				<td><a href="editadmin.php">Edit administrators</a></td>
				<td><a href="deleteadder.php">Delete test adding user</a></td>
				<td><a href="deletetake.php">Delete test takers</a></td>
				<td><a href="deletereview.php">Delete a review</a><br />
				<a href="deletequestions.php">Delete questions</a></td>
				<td><a href="deleteadmin.php">Delete an administrator</a></td>
				<td><a href="viewadders.php">View test adding users</a></td>
				<td><a href="resultslist.php">View test results</a></td></tr>
				<a id="update" name="update" title="update"></a><p>Or... Change your password. Please enter your password twice.<br />
				if(isset($_POST['password1']) & $_POST['password1'] != $_POST['password2']){
					echo "<br /><strong>Wups... your passwords don't match!</strong><br />";
				<form method="post" action="index.php">
				<p><input type="password" name="password1" /><br />
				<input type="password" name="password2" /><br /><br />
				<input type="submit" /></p>
<?php include("../footer.inc.php"); ?>
Return current item: Standardized Test Practice Engine