Jump to content

berry05

Members
  • Posts

    204
  • Joined

  • Last visited

    Never

Everything posted by berry05

  1. i tried both codes and i keep getting errors..im using dremaweaver and i have a textfield box called "textfield4" to use it as where the people put in there e-mail address to check if its already taken... idk what to do...i googled php check if email exists already like webmaster told me to and still nothing.... please help!
  2. ok ill check the codes you guys sent...but this is my registration code.. <?php require_once('Connections/login.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "register")) { if($_POST['textfield2'] == $_POST['textfield3']) { $insertSQL = sprintf("INSERT INTO users (username, password) VALUES (%s, %s)", GetSQLValueString($_POST['textfield'], "text"), GetSQLValueString($_POST['textfield2'], "text")); mysql_select_db($database_login, $login); $Result1 = mysql_query($insertSQL, $login) or die(mysql_error()); if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } $insertGoTo = "good.html"; header(sprintf("Location: %s", $insertGoTo)); } else { echo 'Your passwords did not match'; } } ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form id="register" name="register" method="POST" action="<?php echo $editFormAction; ?>"> <label>Desired Username:<br /> <input type="text" name="textfield" id="textfield" /> </label> <label><br /> <br /> </label> <table width="200" border="0" bordercolor="#000000"> <tr> <td><label> Password: <input type="password" name="textfield2" id="textfield2" /> </label></td> </tr> </table> <p> <label>Confim Password:<br /> <input type="password" name="textfield3" id="textfield3" /> </label> </p> <p> <label>E-Mail Verification<br /> <input type="text" name="textfield4" id="textfield4" /> </label> </p> <p> <label> <input type="submit" name="Register" id="Register" value="Register" /> </label> </p> <p> </p> <input type="hidden" name="MM_insert" value="register" /> </form> </body> </html>
  3. how do i do that? i looked everywhere on google for a script or a tut and couldn't find any.. like i want to add it to the registration form..and if its a invalid email or already used the registration wont go through...and if its valid it sticks to my database so that nobody else can sign up with that email again.. any help plz?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.