Jump to content

bleured27

Members
  • Posts

    68
  • Joined

  • Last visited

Everything posted by bleured27

  1. where i can turn it on i use xampp and how to do it whit error report on?
  2. i got a session whith username in it i want to get the valeu in it in a normal variable string $username=$_SESSION['myusername']; wont WORK PLZ HELP
  3. there are loads of programms about how to add a capcha MAKING one is much WORK so i recoment to go at google serching a download.
  4. i dont have an line counter so i d K where buggs are can some 1 tell me how i find a line counter on mac for the next script Parse error: syntax error, unexpected '}', expecting ',' or ';' in /Applications/XAMPP/xamppfiles/htdocs/register2.php on line 102 <?php $host="localhost"; $username=""; $password=""; $db_name="test"; $tbl_name="userinfo"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $mypassword2=$_POST['mypassword2']; $email=$_POST['email']; $email2=$_POST['email2']; $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $mypassword2 = stripslashes($mypassword2); $email = stripslashes($email); $email2 = stripslashes($email2); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $mypassword2 = mysql_real_escape_string($mypassword2); $email = mysql_real_escape_string($email); $email2 = mysql_real_escape_string($email2); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' "; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ echo"name already used" ; } else{ if ($mypassword != $mypassword1){ echo"you filld in 2 diffrend passwords"; } else{ if ($email != $email1){ echo"you filld in 2 diffrend emails"; } else{ ini_set('display_errors', 1); // 0 = uit, 1 = aan error_reporting(E_ALL); function checkemail($email) { if(!stristr($email, '@')) { return false; } $email_split = explode("@", $email); if(count($email_split) != 2) { return false; } $email_user = $email_split[0]; $email_host = $email_split[1]; if(!getmxrr($email_host, $var)) { return false; } if(!preg_match("/^[0-9a-z]([-_.~]?[0-9a-z])*$/i", $email_user)) { return false; } return trsue; } $email = (isset($_POST['email'])) ? $_POST['email'] : ''; if(!checkemail($email)) { echo 'not failid email<br />'; } else { $sql="SELECT * FROM $tbl_name WHERE email='$email'"; $result2=mysql_query($sql2); $count2=mysql_num_rows($result2); if($count2==1){ echo"email already used" } else { mysql_query("INSERT INTO $tbl_name VALUES ( '$myusername', $mypassword, '$email','0' )"); echo"registred succesfull,you can login now"; } } } } } ?>
  5. u need login succes.php its liKe this <?php session_start(); if(!session_is_registered(myusername)){ header("location:main_login.php"); } ?> <html> <body> Login Successful </body> </html> </table> and of coure the first 1 (eddit checKlogin in the name of the file in last post! <table width="300" border="0" align="right" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form1" method="post" action="checKlogin.php"> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="3"><strong>Member Login </strong></td> </tr> <tr> <td width="78">Username</td> <td width="6">:</td> <td width="294"><input name="myusername" type="text" id="myusername"></td> </tr> <tr> <td>Password</td> <td>:</td> <td><input name="mypassword" type="password" id="mypassword"></td> </tr> <tr> <td> </td> <td> </td> <td><input type="submit" name="Submit" value="Login"></td> </tr> </table> </td> </form> </tr> </table>
  6. this worKs for me u need to eddit tbl_name in yours AND MAKE sure u have a member im worKing on a registration script now u can eddit it to this one when its finisched u need 1 member !! <?php $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name="test"; // Database name $tbl_name="userinfo"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("myusername"); session_register("mypassword"); header("location:login_success.php"); } else { echo "Wrong Username or Password"; } ?>
  7. oops i mean <?php $host="localhost"; $username=""; $password=""; $db_name="test"; $tbl_name="userinfo"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $mypassword2=$_POST['mypassword2']; $email=$_POST['email']; $email2=$_POST['email2']; $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $mypassword2 = stripslashes($mypassword2); $email = stripslashes($email); $email2 = stripslashes($email2); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $mypassword2 = mysql_real_escape_string($mypassword2); $email = mysql_real_escape_string($email); $email2 = mysql_real_escape_string($email2); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' "; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ echo"name already used" ; } else{ if ($mypassword != $mypassword1){ echo"you filld in 2 diffrend passwords"; } else{ if ($email != $email1){ echo"you filld in 2 diffrend emails"; } else{ ini_set('display_errors', 1); // 0 = uit, 1 = aan error_reporting(E_ALL); function checkemail($email) { if(!stristr($email, '@')) { return false; } $email_split = explode("@", $email); if(count($email_split) != 2) { return false; } $email_user = $email_split[0]; $email_host = $email_split[1]; if(!getmxrr($email_host, $var)) { return false; } if(!preg_match("/^[0-9a-z]([-_.~]?[0-9a-z])*$/i", $email_user)) { return false; } return trsue; } $email = (isset($_POST['email'])) ? $_POST['email'] : ''; if(!checkemail($email)) { echo 'not failid email<br />'; } else { $sql="SELECT * FROM $tbl_name WHERE email='$email'"; $result2=mysql_query($sql2); $count2=mysql_num_rows($result2); if($count2==1){ echo"email already used" } else { mysql_query("INSERT INTO $tbl_name VALUES ( '$myusername', $mypassword, '$email','0' )"); echo"registred succesfull,you can login now"; } } } } } ?> can some one eddit that?
  8. it is an old code ..try this <code> <?php $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name="test"; // Database name $tbl_name="userinfo"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("myusername"); session_register("mypassword"); header("location:login_success.php"); } else { echo "Wrong Username or Password"; } ?> </code>
  9. tnx that helped now i got this Parse error: syntax error, unexpected '}', expecting ',' or ';' in /Applications/XAMPP/xamppfiles/htdocs/register2.php on line 102 <code> <?php $host="localhost"; $username=""; $password=""; $db_name="test"; $tbl_name="userinfo"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $mypassword2=$_POST['mypassword2']; $email=$_POST['email']; $email2=$_POST['email2']; $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $mypassword2 = stripslashes($mypassword2); $email = stripslashes($email); $email2 = stripslashes($email2); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $mypassword2 = mysql_real_escape_string($mypassword2); $email = mysql_real_escape_string($email); $email2 = mysql_real_escape_string($email2); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' "; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ echo"name already used" ; } else{ if ($mypassword != $mypassword1){ echo"you filld in 2 diffrend passwords"; } else{ if ($email != $email1){ echo"you filld in 2 diffrend emails"; } else{ ini_set('display_errors', 1); // 0 = uit, 1 = aan error_reporting(E_ALL); function checkemail($email) { if(!stristr($email, '@')) { return false; } $email_split = explode("@", $email); if(count($email_split) != 2) { return false; } $email_user = $email_split[0]; $email_host = $email_split[1]; if(!getmxrr($email_host, $var)) { return false; } if(!preg_match("/^[0-9a-z]([-_.~]?[0-9a-z])*$/i", $email_user)) { return false; } return trsue; } $email = (isset($_POST['email'])) ? $_POST['email'] : ''; if(!checkemail($email)) { echo 'not failid email<br />'; } else { $sql="SELECT * FROM $tbl_name WHERE email='$email'"; $result2=mysql_query($sql2); $count2=mysql_num_rows($result2); if($count2==1){ echo"email already used" } else { mysql_query("INSERT INTO $tbl_name VALUES ( '$myusername', $mypassword, '$email','0' )"); echo"registred succesfull,you can login now"; } } } } } ?> </code>
  10. or do you mean this nothing missing here Parse error: syntax error, unexpected T_ECHO in /Applications/XAMPP/xamppfiles/htdocs/register2.php on line 47 im on a mac is that something that help you my mac SKILLS are 0
  11. can you tell me what i am totaly blind now
  12. if you are new i say: read some BOOKS that wil solve 90% of your errors
  13. help please next error Parse error: syntax error, unexpected T_ECHO in /Applications/XAMPP/xamppfiles/htdocs/register2.php on line 47 <?php $host="localhost"; $username=""; $password=""; $db_name="test"; $tbl_name="userinfo"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $mypassword2=$_POST['mypassword2']; $email=$_POST['email']; $email2=$_POST['email2']; $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $mypassword2 = stripslashes($mypassword2); $email = stripslashes($email); $email2 = stripslashes($email2); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $mypassword2 = mysql_real_escape_string($mypassword2); $email = mysql_real_escape_string($email); $email2 = mysql_real_escape_string($email2); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' "; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ echo"name already used" ; } else{ if ($mypassword != $mypassword1){ echo"you filld in 2 diffrend passwords"; } else{ if ($email != $email1{ echo"you filld in 2 diffrend emails"; } else{ ini_set('display_errors', 1); // 0 = uit, 1 = aan error_reporting(E_ALL); function checkemail($email) { if(!stristr($email, '@')) { return false; } $email_split = explode("@", $email); if(count($email_split) != 2) { return false; } $email_user = $email_split[0]; $email_host = $email_split[1]; if(!getmxrr($email_host, $var)) { return false; } if(!preg_match("/^[0-9a-z]([-_.~]?[0-9a-z])*$/i", $email_user)) { return false; } return trsue; } $email = (isset($_POST['email'])) ? $_POST['email'] : ''; if(!checkemail($email)) { echo 'not failid email<br />'; } else { $sql="SELECT * FROM $tbl_name WHERE email='$email'"; $result2=mysql_query($sql2); $count2=mysql_num_rows($result2); if($count2==1){ echo"email already used" } else { mysql_query("INSERT INTO $tbl_name VALUES ( '$myusername', $mypassword, '$email','0' )"); echo"registred succesfull,you can login now"; } } } } } ?> MOD EDIT: . . . tags added.
  14. hy tnx for the quik mssg i dont need the relevant stuf still tnx <not whole script> still i need to know how to replase the $quer or it cant becose there are 3 fields in table and only 1 accaunt?
  15. Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in G:\xampp\htdocs\checklogin.php on line 27 verkeerde naam of wachtwoord hy help needed i serched on the internet for a solution "i cant find a good 1 zo plz help me" <?php ob_start(); $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="brsgamev1.0"; // Database name $tbl_name="thegamev1.0"; // Table name // Connect to server and select databse. mysql_connect("$host", "$user", "$pass")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $user=$_POST['user']; $pass=$_POST['pass']; $user = stripslashes($user); $pass = stripslashes($pass); $user = mysql_real_escape_string($user); $pass = mysql_real_escape_string($pass); $sql="SELECT * FROM $tbl_name WHERE user='$user' and pass='$pass'"; $result=mysql_query($sql); $count=mysql_num_rows($result); if($count==1){ session_register("user"); session_register("pass"); header("location:login_success.php"); } else { echo "Wrong Username or Password"; } ob_end_flush(); ?>
×
×
  • 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.