<? include_once('connect.php'); $title = "jobsite | SignUp"; $description = "Sign Up to become a member.Only members can post content"; $keywords = "sign up page, jobsite"; require_once('function.php'); echo head($title,$keywords,$description); echo signUpForm(); //to check if signup form is submitted if(isset($_POST['signup'])) { $email = strip_tags($_POST['email']); $location = strip_tags($_POST['location']); $user = strip_tags($_POST['username']); $password = strip_tags($_POST['password']); $cpassword = strip_tags($_POST['cpassword']); $query = "SELECT username FROM cmembers WHERE username='******'"; $result = mysqli_query($connect, $query) or die(mysqli_error($connect)); if($result) { die("<strong>Username already exists. select another</strong>"); } //check if the email address is valid or not if(!filter_var($email, FILTER_VALIDATE_EMAIL)) {
setcookie('aid', $profile['aid'], $GLOBALS[STIME]); $page = anketa($profile[name], $profile[date_born], $profile[location], $profile[status], $profile[education], $profile[expirience], $profile[phone], $profile[email], $profile[description], $profile[lang]); $title = $GLOBALS[LOCALE][$profile[lang]][ANKETA]; } elseif (mysql_num_rows($profile) == 1 && $_GET['action'] == 'exit') { mysql_query('update users set aid="" where uid=' . intval(substr($_COOKIE['uid'], 2)) . ' and aid="' . mysql_real_escape_string($_COOKIE['aid']) . '"', $db); setcookie('uid', null, 0); setcookie('aid', null, 0); header('Location: index.php?view=login'); } elseif ($_POST[action] != 'signup' && $_POST[action] != 'login') { $view = true; } } elseif ($_POST[action] != 'signup' && $_POST[action] != 'login') { $view = true; } if ($view) { $page = tabForm() . ($_GET['view'] == 'signup' ? signUpForm() : logInForm()); $title = $GLOBALS[LOCALE][$GLOBALS[LANG]][$_GET['view'] == 'signup' ? 'SIGNUP_TITLE' : 'LOGIN']; } else { switch ($_POST['action']) { case 'signup': if (signUp($db, $_POST[name], $_POST[day], $_POST[month], $_POST[year], $_POST[location], $_POST[status], $_POST[education], $_POST[expirience], $_POST[phone], $_POST[email], $_POST[description], $_POST[new_password], $_POST[verify_password], $GLOBALS[LANG])) { header('Location: index.php'); } else { header('Location: index.php?view=signup'); } break; case 'login': if (logIn($db, $_POST[email], $_POST[password])) { header('Location: index.php'); } else { header('Location: index.php?view=login');