Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $section = "reseller";
- include('inc/header.php');
- $login = "";
- $logged = "0";
- $warning = "";
- if ($_SERVER["REQUEST_METHOD"] == "POST") {
- require("include/config.php");
- $userpw = mysql_real_escape_string(md5($_POST['pw']));
- $userid = mysql_real_escape_string($_POST['email']);
- $query = "SELECT * FROM `reseller` WHERE `email`='$userid' AND `pass`='$userpw'";
- $result = mysql_query($query);
- $resultcount = mysql_num_rows($result);
- if ($resultcount == 0) {
- $warning = "Wrong username or password";
- } else {
- setcookie("user", $userid, time()+3600);
- setcookie("pass", $userpw, time()+3600);
- $logged = "1";
- }
- }
- ?>
- <div id="wrapper">
- <section id="primary">
- <h3>Reseller section</h3>
- <fieldset>
- <?php
- if (isset($_COOKIE["user"])) {
- $userpw = mysql_real_escape_string($_COOKIE["pass"]);
- $userid = mysql_real_escape_string($_COOKIE["user"]);
- $query = "SELECT * FROM `reseller` WHERE `email`='$userid' AND `pass`='$userpw'";
- $result = mysql_query($query);
- $resultcount = mysql_num_rows($result);
- if ($resultcount == 0) {
- $warning = "Wrong username or password!";
- } else {
- while($row = mysql_fetch_object($result)){
- $valid = $row->valid;
- $age = $row->birthday;
- $price = $row->price;
- $email = $row->email;
- $name = $row->name;
- $id = $row->id;
- If ($valid == "true") {
- $valida = "Yes";
- } elseif ( $valid == "pending") {
- $valida = "Is being reviewed";
- } else {
- $valida = "No";
- }
- }
- }
- ?>
- <p><?php echo $warning ?></p>
- <ul>
- <li>
- <a href="login.php">Profile Picture</a>
- </li>
- <li>
- <a href="login.php">Set name</a>
- </li>
- <li>
- <a href="login.php">Set age</a>
- </li>
- <li>
- <a href="login.php">Set price</a>
- </li>
- <li>
- <a href="login.php">Set email</a>
- </li>
- <li>
- <a href="login.php">Delete Account</a>
- </li>
- </ul>
- <?php
- } else {
- ?>
- <legend>Login</legend>
- <form method="POST" action="#">
- <p><?php echo $warning ?></p>
- <label for="email">Email:<br></label>
- <input type="text" name="email" id="email"><br>
- <label for="password">Passwort:<br></label>
- <input type="password" name="pw" id="pw"><br><br>
- <input type="submit" value="Login"> or sign up <a href="register.php">here</a>.
- </form>
- <?php
- }
- ?>
- </fieldset>
- </section>
- </div>
- <?php include('inc/footer.php'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement