Jump to content

4me

New Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by 4me

  1. Jacques1 thanks can not do it, I found the script, it seems: http://www.codingcage.com/2015/04/php-login-and-registration-script-with.html
  2. Jacques1The fact that a database for different servers I need a script that would register users on select server demo https://jabber.ru/user/register
  3. I have several databases jabberserver1 - (localhost; user1;pass1;dbname1) jabberserver2 - (localhost; user2;pass2;dbname2) etc I need to make sure that the user has registered by the server for registration jabberserver1 or jabberserver2 the script would be entered into the database data for selected mysql server
  4. Jacques1 <?php if(isset($_POST['submit'])) { session_start(); if($_POST['kapcha'] != $_SESSION['rand_code']) exit ("<center>error code image</center>"); else echo ""; if (isset($_POST['login'])) { $login = $_POST['login']; if ($login == '') { unset($login); } } $err = array(); if(!preg_match("/^[a-z0-9\_]+$/", $login)) { exit ("<center>Username can only contain letters of the Latin alphabet and numbers!</center>"); } if( preg_match( "/[а-яёА-ЯЁ|\s]/", $login ) ) { exit ("<center>Username may contain only letters and numbers!</center>"); } if (isset($_POST['password'])) { $password = $_POST['password']; if ($password =='') { unset($password); } } if (strlen($login) < 3 or strlen($login) > 25) { exit ("<center>Login must be at least from <b> 3 </ b> characters and no more than: <b>25<b>, go back and try again</center>"); } if (strlen($password) < 6 or strlen($password) > 20) { exit ("<center>The password should consist of at least from <b> 6 </ b> characters and no more than from <b> 20 </ b>, go back and try again</center>"); } if (empty($login) or empty($password)) { exit ("<center>You do not have entered all the information, go back and fill in all fields!</center>"); } $login = stripslashes($login); $login = htmlspecialchars($login); $password = stripslashes($password); $password = htmlspecialchars($password); $login = $_POST['login']; $password = $_POST['password']; //$password = htmlspecialchars($password); //$password = md5($password); //удаляем лишние пробелы $login = trim($login); $password = trim($password); include ("mysql.php"); $result = mysql_query("SELECT username FROM users WHERE username='$login'", $db); $myrow = mysql_fetch_array($result); if (!empty($myrow['username'])) { exit ("<center>Sorry, you entered login is already registered. Please enter a different username.</center>"); } $result2 = mysql_query ("INSERT INTO users (username,password) VALUES('$login','$password')"); $login = mysql_real_escape_string($_POST['login']); $password = mysql_real_escape_string($_POST['password']); if ($result2=="TRUE") { echo "<center>You have successfully logged in! Now you can log in using your ID.</center>"; } else { echo "Error! You are not registred."; } } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <meta charset="utf-8"/> <head> <link rel="stylesheet" href="css/styles.css"> <link href="favicon.ico" rel="shortcut icon" type="image/x-icon" /> <title>Register</title> </head> <body> <center><h3><a href="/">Jabber Server </a></h3></center> <div> <form action="../register.php?do=reg" method="post"> <label for="name">Login:</label> <input name="login" type="name" size="15" maxlength="15"> <br /> <label for="password">password:</label> <input name="password" type="password" size="15" maxlength="15"> <br /> <input name="md5" type="hidden"> <img src = "captcha.php" /> <br /> <input type = "text" name = "kapcha" /> <br /> <input type="submit" name="submit" value="Register"> <center> </center> </form> </div> </body> </html> I want to make as there https://jabber.ru/user/register
  5. Hello. Please help me, I can not make a "registered with the choice mysql of server" Ie is the usual registration form
×
×
  • 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.