Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include ('mysql.php');
- include("temp.html");
- if (isset ($_POST['agreeregister'])) {
- $username = mysql_escape_string($_POST['username']);
- $password = mysql_escape_string(sha1($_POST['password']));
- $random_num = ($_POST['random_num']);
- $length = 6;
- if ((!empty ($username) && !empty ($password)) && ($random_num > 0 && strlen($random_num) == ($length))) {
- $sql = mysql_query ("INSERT INTO users (
- user_id,username,user_password,user_regdate)
- VALUES (
- '0','".$username."','".$password."','".time()."')
- ");
- echo '<font face="arial" size="5"><br /><br /><center><table width="400" align="center" bgcolor="#00ff00"><tr><td><center><b>you are now registered!<br /><Please Log Into Your Account Above</b></center></tr></td></table></center><br /></font>';
- } else {
- echo '<font face="arial" size="5"><br /><br /><center><table width="400" bgcolor="#ff0000"><tr><td><center>Your Username / Password has to be longer than 6 characters<br />AND<br />You have to put in the correct Validation code</center></td></tr></table></center></font><meta http-equiv="refresh" content="5; url="register.php">';
- }
- } else if (isset($_POST['register1'])) { {
- echo '<html>
- <head>
- <br /><center>-PLEASE READ-<br />
- </head>
- </font>
- <font face="arial" size="3">
- Before you sgin up i would like to say a few things...<br /><br />
- 1. You will not tell anyone you password, Even if they are your best friends<br />
- 2. You will not try to hack into the database and steal information<br />
- 3. You will not make any crude or racist usernames<br />
- 4. You will not upload inapproprate content in the photos/videos section<br /><br />
- <center>Failure to follow any of the above WILL result in immediate account termination</center>
- <br />
- If you would like to complete account making, click the "I Agree" button
- </font>
- </html><br />Please enter that desiered username and password<br />
- <right><form action="home.php" method="post">
- Username: <input type="text" name="username" /><br />
- Password: <input type="password" name="password" /><br />
- </right>';
- srand(time());
- $random = (rand()%6)+1;
- $random1 = (rand()%6)+1;
- $random2 = (rand()%6)+1;
- $random3 = (rand()%6)+1;
- $random4 = (rand()%6)+1;
- $random5 = (rand()%6)+1;
- $random_numbers = "$random$random1$random2$random3$random4$random5";
- echo 'Validation code:'; echo ' <input type="text" name="random_num" />'; print(" ($random_numbers)");
- echo '<br /><input type="submit" name="agreeregister" value="I Agree & Register" />
- </form>';
- } } else {
- echo '<center><form action="home.php" method="post"><input type="submit" name="register1" value="Click Here To Register" /></fotm>';}
- ?>
- #######################################
- <?php
- session_start();
- include("temp.html");
- include ('mysql.php');
- if (isset ($_POST['login'])) {
- $username = mysql_escape_string($_POST['username']);
- $password = mysql_escape_string(sha1 ($_POST['password']));
- if (!empty ($username) && !empty ($password)) {
- $sql = mysql_query ("SELECT * FROM users
- WHERE username='".$username."' AND
- user_password='".$password."' LIMIT 1");
- if (mysql_num_rows ($sql) > 0) {
- $_SESSION['loggedin'] = true;
- $_SESSION['username'] = $username;
- echo '<center><font color="#00ff00">You have been logged in<br />Please wait as we connect you to the member home page<meta http-equiv="Refresh" content="5; url=home.php">';
- } else {
- echo '<center><font color="#ff0000"><br />Your your username and/or password is incorrect. Please try again</center><meta http-equiv="refresh" content="5; url=home.php">';
- }
- } else {
- echo '<center><table width="400" table bgcolor="#ff0000"><tr><td><center>You must enter a username and/or password</center></td></tr></table></center><meta http-equiv="refresh" content="5; url="login.php">';
- }
- } else {
- echo '<center><form action="home.php" method="post">
- Username: <input type="text" name="username" cols="10" />
- Password: <input type="password" name="password" cols="10" />
- <input type="submit" name="login" value="Login" />
- </form></center>';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement