|
Posted by Alec on 08/28/06 12:01
Sorry beginners question..
The following link http://www.schott-systeme.com/en/logintest.php is a
test secure login page for our customers.
Type in 123-456-BSE and login, and it returns a form for the customer
to check three typical bits of into, ie refno, name and email. This
works ok and code is below.
<?php
//Process login
if (isset($_POST['companyID'])) {
// Check login
$companyID = $_POST['companyID'];
$resultlogin = @mysql_query ("SELECT userID, username, useremail FROM
schott_news WHERE userID='$companyID'");
while ($row = mysql_fetch_array($resultlogin))
{
$userID = $row['userID'];
$username = $row['username'];
$useremail = $row['useremail'];
}
if ($_POST['companyID'] = $userID)
{
$_SESSION['authorized'] = TRUE;
}
}
//Process logout
if (isset($_SESSION['authorized'])) {
//Display secure information
?>
<h1>Please complete all information</h1>
<div>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<label>UserID:
<input type="text" name="code" value="<?php echo $userID;
?>"/></label><br />
<label>User Name:
<input type="text" name="name" value="<?php echo $username;
?>"/></label><br />
<label>User E-Mail:
<input type="text" name="email" value="<?php echo $useremail;
?>"/></label>
<input type="submit" value="Submit" />
</form>
</div>
<p><a href="<?php echo $_SERVER['PHP_SELF']; ?>?logout=1">Log
OUT</a></p>
<?php
} else {
//Display login form
?>
<h1>Please Enter Company Ref No</h1>
<div>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="post">
<label>User ID:
<input type="text" name="companyID" /></label>
<input type="submit" value="log IN" />
</form>
</div>
<?php
}
?>
I want to now click on Submit, and the form results are emailed to
test@test.com and the user logged out.
What is the easiest way to achieve this?
Many thanks
Alec
Navigation:
[Reply to this message]
|