Jump to content

alivec

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

alivec's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. thats the thing thought its not an image.. the output is like this.. Your verification code is: cqaoyyj4 is there a way to check it still?
  2. i have a login form, registration form and mySQL tables.
  3. no i am really new to SQL i had help with it before but.. now i'm on my own and would like to continue and learn at the same time. so can you explain it in simpler terms?
  4. well im useing <? function createRandomPassword() { $chars = "abcdefghijkmnopqrstuvwxyz0123456789"; srand((double)microtime()*100000); $i = 0; $pass = '' ; while ($i <= 7) { $num = rand() % 33; $tmp = substr($chars, $num, 1); $pass = $pass . $tmp; $i++; } to create a random code.. i am planning on using this on my website for the verification code in the register.. but now that i have made this i cannot figure out how to verify that the code this generates is the code the user enters into the text box. thank you. if i posted this in the wrong forum im sorry i wasn't sure where to post this question.
  5. any other idea's like i was wondering how you would do it.. and i am not exactally sure if i should use PHP if some one could tell me what is the best way to make it.?
  6. Hey i was just wondering how you would make a verification code.. i really only one a text verification code so it would look like.. Your Verification Code: rhvse Please Enter The Verification Code: if you could explain to me how you would do this?
  7. i get this error this is reg.php <?php $host = "localhost"; $username = "root"; $password = ""; $db_name ="alivecsetup"; $tbl_name ="members"; @mysql_connect($host, $username, $password) or die ("Can't Connect"); @mysql_select_db($db_name) or die(mysql_error()); $username = $_POST['username']; $password = $_POST['password']; $email = $_POST['email']; $username = stripslashes($username); $email = stripslashes($email); if((!$username) || (!$password) || (!$email)){ echo '<h3>All fields are required!</h3>'; include 'register.html'; exit(); } $db_password = md5($password); $sql = mysql_query("INSERT INTO $table_name (email, username, password) VALUES('$email', '$username', '$db_password', now())") or die (mysql_error()); if(!$sql) echo "There was an error while creating you account. Please contact an admin."; else { $userid = mysql_insert_id(); //mailing time $subject = "Membership at my-website.com"; $message = "Dear $username, Thank you for registering at our website, Here is your login information: Username: $username Password: $password Thanks! The Webmaster This is an automated response, please do not reply!"; mail($email, $subject, $message, "From: E-Nuke Webmaster<admin@e-nuke.net>\n X-Mailer: PHP/" . phpversion()); echo "<meta http-equiv=\"Refresh\" content=\"0; URL=http://friiks.awardspace.com/register.htm\"/>You will be redirected to login page."; } ?> i don't know if you need this but.. <html> <head> <title>Register</title> </head> <body> <form action='reg.php' method="post" name="loginform" id="loginform"> <table> <tr> <td>Username:</td><td><input type="username" name="username" class='text'></td> </tr> <tr> <td>Password:</td><td><input type="password" name="password" class='text'> </td> </tr> <tr> <td>E-mail:</td><td><input type="email" name="email" class='text'> </td> </tr> <tr><td><input type="submit" name="Submit" class='button' value="Register"></td> </tr> </table> </form> </body> </html> now i know i should add { and } but when i do i get this error thank you for helping i hope you can figure this out i cant.
  8. if (!isset($_SESSION['myusername'])) is supposed to be it
  9. <? session_start(); if(!session_is_registerd(myusername)) { header("location:mainlogin.php"); } ?> that is login_success.php
  10. thanks but i have another error that im getting Fatal error: Call to undefined function session_is_registerd() in C:\xampp\htdocs\login\login_success.php on line 3 <? $host = "localhost"; $username = "root"; $password = ""; $db_name ="alivecsetup"; $tbl_name ="members"; mysql_connect($host, $username, $password) or die ("Can't Connect"); mysql_select_db($db_name) or die(mysql_error()); $myusername = $_POST['myusername']; $mypassword = $_POST['mypassword']; $sql = "SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result = mysql_query($sql); $count = @mysql_num_rows($result); if($count==1){ Session_register("myusername"); Session_register("mypassword"); header("location:login_success.php"); } else { Echo "wrong username or password"; } ?> thank you in advance
  11. Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\checklogin.php on line 15 i get this error when i enter this script please help.. <? $host = "localhost"; $username = ""; $password = ""; $db_name ="alivecsetup"; $tbl_name ="members"; mysql_connect($host, $username, $password) or die ("Can't Connect"); mysql_select_db($db_name) or die(mysql_error()); $myusername = $_POST['myusername']; $mypassword = $_POST['mypassword']; $sql = "SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'" $result = mysql_query($sql); $count = mysql_num_rows($result); if($count==1) { Session_register("myusername"); Sesion_register("mypassword"); header("location:login_success.php"); } else { Echo "Wrong username or password"; } ?>
×
×
  • 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.