Forum Moderators: coopster
<?php
if(isset($_POST['submit'])){
if(isset($_GET['go'])){
if(preg_match("/^[0-9]+/", $_POST['name'])){
$name=$_POST['name'];
$db=mysql_connect ("localhost", "----", "----") or die ('I cannot connect to the database because: ' . mysql_error());
$mydb=mysql_select_db("----");
$sql="SELECT acct, pw FROM `ouc` WHERE acct = $name";
$result=mysql_query($sql);
$row=mysql_fetch_array($result);
$acct =$row['acct'];
$pw =$row['pw'];
if(empty($acct)){
echo "<div class='cbb red'><p><strong>This account number does not exist in our database, please enter the number exactly as it is printed on your bill. If you believe you have reached this message in error, please call us at ----- or email us at -----.</strong></p></div>";
}
else{
echo "<div class='cbb green'><ul>\n";
echo "<li>" . "Account ID - " .$acct . "</a></li>\n";
echo "<li>" . "Temporary Password - " .$pw . "</a></li>\n";
echo "</ul></div>";
echo "<div class='cbb gray'>Please write down your password as this will be the <strong>ONLY</strong> opportunity you have, then click below to validate and claim your account information. Once validated you will be able to log in, however you will <strong>NOT</strong> be able to use this screen again to find out your temporary password, so make sure you write it down.";
echo "<br><br>";
echo "<center><a href='-----.php?id=".$acct."'><img src='-----' border='0'></a></center><br/></div>";
}
}
else{
echo "<div class='cbb red'><p><strong>Your account id must start with a number.</strong></p></div>";
}
}
}
?>