Created
September 29, 2019 07:47
-
-
Save Sadicko/ad479590bcb5b83193eb844ad959aaa4 to your computer and use it in GitHub Desktop.
validating user signup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//including the header | |
include 'header.php' | |
?> | |
<?php | |
//checking if all fields in the signup are empty | |
$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; | |
if (strpos($url, 'error=empty') !== false) { | |
echo "Fill out all fields"; | |
} | |
//checking if the username already exist | |
if (strpos($url, 'error=username') !== false) { | |
echo "User already"; | |
} | |
//session to check if your are logged in | |
if (isset($_SESSION['id'])){ | |
echo $_SESSION['id']; | |
} else { | |
echo "you are not logged in"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment