<?php require_once 'protect.php'; ?>
<div class="divspace">
<div class="margbottom10"><?php echo $textlogin1 ?></div>
<form name="login" action="order" method="post">
<label for="email1" class="hlabel">Email</label>
<input type="email" name="email1" id="email1" placeholder="Email*" size="40" maxlength="60" class="forms2" required>
<label for="password1" class="hlabel">Password</label>
<input type="password" name="password1" id="password1" placeholder="Password*" size="40" maxlength="30" class="forms2" required>
<input type="submit" name="submit1" value="<?php echo $buttonnext ?>" class="button">
</form>
</div>
<hr>

<div class="divspace">
<?php echo $textlogin2 ?>  
<a href="order" class="button"><?php echo $buttonnext ?></a>
</div> 
<hr>

<div class="divspace"> 
<?php
if (isset($_POST['sendcode'])) {
$email = $mysqli->real_escape_string(strip_tags($_REQUEST['email']));
		
if ($email AND $_REQUEST['notes']=='' AND $_REQUEST['data']==$_POST['code1']) {

$result = $mysqli->query("SELECT * FROM members WHERE email='$email'");
$row = $result->fetch_array();
$email1=$row['email'];
$password1=$row['password'];
if ($email == $email1) {
$to="$email";
$from="$email";
$reply="$email";
$headers="From: $from\nReply-To: $reply";
$subject="$domain user details";
$message="Your user details:
				
Password: $password1
				
www.$domain
";
mail ($to,$subject, $message,$headers);
?>

<?php echo $textsendc1 ?>

<?php } else { ?>
<?php echo $textsendc2 ?>
<?php } ?>

<?php } else { ?>
<a href="javascript:history.go(-1);"><?php echo $fieldtext2 ?></a>
<?php } ?>

<?php } else { ?>
<div class="margbottom10"><?php echo $textsendc3 ?></div>
<form name="formacod" method="post">
<?
global $data;
$data = mt_rand(100000,1000000);
?>
<input type="hidden" name="data" value="<?php echo $data ?>"> 
<label for="email" class="hlabel">Email</label>
<input type="email" name="email" id="email" placeholder="Email*" size="40" maxlength="60" class="forms2" required>
<label for="code1" class="hlabel"><?php echo $fieldcode ?></label>
<input type="hidden" name="code1" value="<?php echo $code1 ?>">
<img src="<?php echo $codepath ?>includes/dynamicimage.php?dt=<? global $data; echo base64_encode($data);?>" alt="">
<input type="text" name="code1" id="code1" placeholder="<?php echo $fieldcode ?>" size="16" maxlength="6" class="inputcode" required> 
<label class="hide">note<input type="text" name="notes" id="notes" size="1" maxlength="20" class="formsn"></label> 
<input type="submit" name="sendcode" value="<?php echo $button1 ?> Password" class="button">
</form>
</div>
<?php }?>