Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $request = trim(strtolower($_REQUEST['email']));
- $valid = 'true';
- //The classic, long way to do it:
- $dbServer = "localhost";
- $dbUser = "rocke691_bettLan";
- $dbPass = "ViVCTT59c371";
- $dbName = "rocke691_betterLandlord";
- //Connect to the database
- $link = mysql_connect($dbServer, $dbUser, $dbPass);
- if (!$link) {
- die('Could not connect: ' . mysql_error());
- }
- //Select the correct database and table
- mysql_select_db($dbName, $link);
- //Construct the query to search for the email
- $sql = "SELECT `email` FROM `users`";
- $sql .= " WHERE `email` LIKE '{$request}'";
- $result = mysql_query($sql);
- $count= count($result);
- if(!empty($result)) {
- $valid = '"That\'s already taken"';
- echo $valid;
- } else {
- echo $result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement