<?php // var_dump($_POST); // var_dump($_GET); include 'user.php'; $userObj = new User(); $email = $_GET['email']; $user = $userObj->if_exist($email); echo $user;
<?php include 'user.php'; $user = new User(); $result = $user->if_exist($_GET['email']); if ($result == 'true') { echo "match"; } else { echo "notmatch"; }
$allow_imag = array('image/jpg', 'image/png'); // if (!in_array($type, $allow_imag)) { // echo "PLZ upload correct image "; // if ($size>123456) // { // echo"PLZ upload another photo"; // } // } // else // { move_uploaded_file($tmp_name, "profileimages/" . $name); #echo "<img src='images/$name'/>"; //} } $user = new User(); if ($user->if_exist($_POST['email'])) { $errors[] = "unavailable name"; $_SESSION['email'] = "this email isnot available"; header('location:register.php'); } else { $user = new User(); $user->name = $_POST['name']; echo $user->name; $user->password = $_POST['password']; $user->email = $_POST['email']; $user->credit = $_POST['credit']; $user->birthdate = $_POST['birthdate']; $user->tel = $_POST['tel']; $user->address = $_POST['address']; $user->job = $_POST['job']; $user->interests = $_POST['interests'];
<?php session_start(); require 'user.php'; $x = 'admin'; if (isset($_POST['login'])) { if (!isset($_POST['username']) || !isset($_POST['password'])) { echo "<meta http-equiv='Refresh' content='0;url=index.php' />"; } else { $user = new User(); $is_exist = $user->if_exist($_POST['username'], $_POST['password']); if (!$is_exist) { $errors = "Email or password is invalid you must regist at first"; } } if (!empty($errors)) { $_SESSION['errors'] = $errors; echo "<meta http-equiv='Refresh' content='0;url=index.php' />"; } else { $user = new User(); $user->getUser($_POST['username'], $_POST['password']); $_SESSION['logged'] = $user->id_user; print_r($_SESSION['logged']); //session carry the id of the current user echo "<meta http-equiv='Refresh' content='0;url=windex.php' />"; die; } } else { header("location:wregist.php"); }