Jump to content

Jay2391

Members
  • Posts

    167
  • Joined

  • Last visited

    Never

Everything posted by Jay2391

  1. can you check my preavious post ...one small issue with the variable and session
  2. I had this code on session_test.php and i created a session_test2.php to check that the session will continue. The same code is on session_test and session _test2 Code: <?php session_start();     if($_SESSION['session_var'] == "skipLogin"){           echo $_SESSION['fname'];   echo "<br>--ACTIVE--";           }else{           echo "You stinky";     } ?> Error: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\XAMPP\xampp\htdocs\MDO\session_test2.php:2) in C:\XAMPP\xampp\htdocs\MDO\session_test2.php on line 3
  3. one more ? I put this on my session test ... but it won't show the name,  if I put the $_SESSION['fname'] in a variable if i do           """"       echo $_SESSION['fname'];      """""  that display the name but when i do a variable like below it just show """""   You are loged In """"" <?php session_start();         if($_SESSION['session_var'] == "skipLogin"){            $_SESSION['fname'] = $fname;            echo "You are loged In $fname";               }else{           echo "You stinky";     } ?>
  4. Good Stuff !!!! Yeah I was doing my passing variable wrong ;D
  5. okay here is my code... the Authetication page is HTML Name and password you know thw basic stuff... then you get this cheking if you indded logged-in sucessfully CODE: [code] <?php session_start(); include("LOGINFO.php"); ///////////////Variables/////////////////////////////////////////////////////// $table = 'md_user_main'; $email = $_POST['email']; $password = md5($_POST['password']); $wtd = "relogin"; ///////////////////////////////database connection and array//////////////////       $tc = mysql_connect ($host, $user, $pass);     $db = mysql_select_db ($database, $tc); $query = "SELECT * FROM $table WHERE (email=\"$email\") "; $result = mysql_query($query); $row = mysql_fetch_array($result);                 $fname= $row['first_name']; //////////////////////////Re Log In/////////////////////////////////////////////  if($_SESSION['session_var'] == "skipLogin"){     echo "$fname is Log-In"; echo "<br>If you like to end the session, Click here to Log-Off";   }else if($wtd == "relogin"){       if($password == $row['password']){           echo "You are loged In $fname";       $_SESSION['session_var'] = "skipLogin";     }else{           echo "You are not log-In try again"; //session_destroy(); //unset($_SESSION);     }     } ?> [/code] Then I created this test to check if the session and user are log-in in a 3rd page ...here is where the session is active but I can't ID the user.... before i try passing  a variable but it didn't work so this is what i have now... what i will like is to say who is Loged In [code] <?php session_start();     if($_SESSION['session_var'] == "skipLogin"){   echo "You are loged-In"; echo "<br>Session still active";   }else{     echo "You stinky";   } ?> [/code]
  6. I created a Log in with password and all that good stuff and You can log on to the web site and autheticate.... That is all cool now here is the issue.... I can Log in and I carry a variable saying display the name "John  Doe".. Then I click and  go to another page ... and i can test the session is active ... session(): that is okay ....BUT !!!!!!!! The session does not test to show that the session is "JOHN DOE" session.... Example: 1.Log in page JOHN DOE AUTHENTICATES 2.Confirmation or welcome page...         Session is True         JOHN DOE YOU ARE LOG IN 3.Page X         Session is True         "Blank - Nothing displays" you are log in So i can not probe in that page that John Doe is the one log in ???? can some one help i have check all the books and I can find a explanation .... I also try passing a variable but i guess i did it wrong.
  7. Well i took the prymary key of the Database and did this ...but if some has any ideas please shared...   $passverf = $_POST['password'];   $emailverf = $_POST['email'];       $tc = mysql_connect ($host, $user, $pass);     $db = mysql_select_db ($database, $tc); $query = "SELECT * FROM $table WHERE (email=\"$emailverf\") "; $result = mysql_query($query); $row = mysql_fetch_array($result);     if ( isset ($_POST['submit'])){     $problem = FALSE; //No Issues so far             if($emailverf == $row['email']){           $problem = TRUE;   echo "E-Mail is already register";                       }
  8. Okay I am greating a Log in form I can connect to the DB I get all the errors correct with the eception of the email wich is by the way the primary key. Right now when i try to register and i use teh same email address I get this... The query:INSERT INTO user( first_name, last_name, email, password, team, secret ) VALUES ( "Pedro", "Jose", "Cruz@vivas.com", "96e79218965eb72c92a549dd5a330112", "Cruz", "Hello")Caused the following error: Duplicate entry 'Cruz@vivas.com' for key 1 what i will like is something that will tell the customer that the email is already register ...so here is my code hope you can help... I made what i belive was the solution in red.... [table][tr][td] <?php include("db.php"); $table = 'user';   ini_set ('display_error',1);   error_reporting (E_ALL & ~E_NOTICE);   define ('Title', 'Register');   //require ('template/header.htlm');   print '<div id="leftcontent"><h1>Registration Form</1h>';   print '<p><h4>Register to check our cool stuff</h4></p>';   print '<h4><form action = "regmain.php" method="post"><p>';   print 'First Name: <input type="text" name="first_name" size"30" value="' . $_POST['first_name'] . '"/><br />';   print 'Last Name: <input type="text" name="last_name" size"30" value="' . $_POST['last_name'] . '"/><br />';   print 'E-Mail: <input type="text" name="email" size"50" value="' . $_POST['email'] . '"/><br />';   print 'Password: <input type="password" name="password" size"50" value="' . $_POST['password'] . '"/><br />';   print 'Confirmation: <input type="password" name="confirm" size"50" value="' . $_POST['confirm'] . '"/><br />';   print 'Team: <input type="text" name="team" size"30" value="' . $_POST['team'] . '"/><br />';   print 'Pin Word: <input type="password" name="secret" size"30" value="' . $_POST['secret'] . '"/><br><br />';   print '<input type="submit" name="submit" size"20" value="Register!!"/><br /></h4>';      $passverf = $_POST['password'];   [color=red]$emailverf = $_POST['email'];       $tc = mysql_connect ($host, $user, $pass);     $db = mysql_select_db ($database, $tc); $query = "SELECT * FROM $table WHERE (email=\"$email\") "; $result = mysql_query($query); $row = mysql_fetch_array($result);[/color]     if ( isset ($_POST['submit'])){     $problem = FALSE; //No Issues so far         [color=red]  [font=Verdana] if($emailverf == $row['email']){           $problem = TRUE;   echo "E-Mail is already register";           }[/font]       [/color]   if (strlen ($passverf) <=5){       $problem = TRUE;   print '<p>Your Password must be at least six(6) characters!!!</p>';     }         if (empty ($_POST['first_name'])){       $problem = TRUE;   print '<p>Please enter your First Name</p>';     }       if (empty ($_POST['last_name'])){       $problem = TRUE;   print '<p>Please enter your Last Name</p>';     }       if (empty ($_POST['email'])){       $problem = TRUE;   print '<p>Please enter your E-Mail</p>';     }     if (empty ($_POST['password'])){       $problem = TRUE;   print '<p>Please enter a Password</p>';     }         if ($_POST['password'] != $_POST['confirm']){       $problem = TRUE;   print '<p>Your Passwords did not match</p>';   }       if (empty ($_POST['confirm'])){       $problem = TRUE;   print '<p>Please enter your Password Confirmation</p>';     }       if (empty ($_POST['team'])){       $problem = TRUE;   print '<p>Please enter your Team Name</p>';     }     if (empty ($_POST['secret'])){       $problem = TRUE;   print '<p>Please enter your Secret Word</p>';     }   $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $email = $_POST['email']; $password = md5($_POST['password']); $confirm = md5($_POST['confirm']); $team = $_POST['team']; $secret = $_POST['secret'];       if(!$problem){               $tc = mysql_connect ($host, $user, $pass)or die ("Database is down, try later");                     $db = mysql_select_db ($database , $tc);                             $sql = "INSERT INTO $table ( first_name, last_name, email, password, team, secret ) VALUES ( \"$first_name\", \"$last_name\", \"$email\",                            \"$password\", \"$team\", \"$secret\")";                     $result = mysql_query($sql, $tc) OR die ("The query:".$sql."Caused the following error: ".mysql_error());     print '<p><h4>You are register!, check your E-MAIL for confirmation</h4></p>';                 }else{                 print '<p><h4>Please try again</h4></p>';   }     }       ?> [/table]
  9. I got what i was doing wrong i typed pasword on the html authentication page
  10. no all i get is not logged in ... ??? here is what i have <?php session_start(); include("loginfo.php"); $table = 'userinfo'; $email = $_POST['email']; $password = md5($_POST['password']); $wtd = "relogin";                                 if($wtd == "relogin"){   $tc = mysql_connect ($host, $user, $pass);             $db = mysql_select_db ($database, $tc); $query = "SELECT password FROM $table WHERE email='$email' "; $result = mysql_query($query); $row = mysql_fetch_array($result);     if($password == $row['password']){   echo "You sre loged In";   }else{   echo "Not loged in";   } } ?>
  11. Not working !!!! that is juat a variable.... I read that pconnect is a constant connection !!!
  12. I have a DB call " users " and i have table call "userinfo" and "email" is the primary key password is MD5 encryption before i copy the code my issue is that it dosen't authenticate i get a t_Variable error in line 10 and i enter my password and email in a hTML page that send the info to this page ... I tested that pasrt and it echos the right info... can you see what an i doing wrong... <?php session_start(); include("loginfo.php"); $table = 'userinfo'; $email = $_POST['email']; $password = md5($_POST['password']); $wtd = "relogin"; if($wtd == "relogin"){   mysql_pconnect ($host, $user, $pass);             mysql_select_db ($database); $query = "SELECT password FROM $table WHERE email='$email' "; $result = mysql_query($query); $row = mysql_fetch_array($result);     if($password == $row['password']){   echo "You sre loged In";   }else{   echo "Not loged in";   } } ?>
  13. I apreciate all the help my error is on the field where the post takes place it gives a value .... like you see below I couldn't figure out what i did wrong but i created a table and make that my input field... Thanks!!! ::) If you know a better way on how to make this two post field i will apreciate your input!!! if((!$loginName) and (!$password)){                    $form  ="Submit user";      $form.="<form action=\"$self\"";      $form.=" method=\"post\">Login Name:";                $form.="<input type=\"text\" name=\"loginName\"";      $form.=" value=\"$loginName\"> Password:";                $form.="<input type=\"text\" name=\"password\"";      $form.=" value=\"$password\"> ";      $form.="<input type=\"submit\" value=\"Submit\">";      $form.="</form>";      echo ( $form );   }
  14. I figure out the las erro i was missing a "}" but now i get this The query:INSERT INTO mdo_users ( loginName, password ) VALUES ( "", "d41d8cd98f00b204e9800998ecf8427e" )Caused the following error: Duplicate entry '' for key 1
  15. this is the error i got but line 36 is the end of the php code ??? now I am confuse Parse error: parse error, unexpected $end in C:\XAMPP\xampp\htdocs\MDO\MD_User.php on line 36
  16. This is the code....when i add the md5 to the password variable ... I get a blank page no errors... when i take it off i get a user name and password box and it adds the records but I can see the password. so the issue is not that I put it in and it dosen't come as a password is that I get a blank page with no options [attachment deleted by admin]
  17. I get all that but what I get is different .... I have my field set up as a varchar (100) and my password is just the word Hello... when i put this in $password = md5($_POST['password']); my page stops working when i take the md5 out it works but is not a password field.
  18. Any Ideas ???of why that happend ???
  19. i do not understand this .... echo bin2hex(md5($str, TRUE)); ???
  20. when I do that it stops working all toghether....I get a blank page no errors ....
  21. I am trying to imput a simple user and password but when i go to my sql i can see the name of the password... some one told me about md5 but i do not know how to use it....check my code is not all there but at least the part need noticing $self = $_SERVER['PHP_SELF']; $loginName = $_POST['loginName']; $password = $_POST['password']; if((!$loginName) and (!$password)){               $form  ="Submit user"; $form.="<form action=\"$self\""; $form.=" method=\"post\">Login Name:";             $form.="<input type=\"text\" name=\"loginName\""; $form.=" value=\"$loginName\"><br>Password:";             $form.="<input type=\"text\" name=\"password\""; $form.=" value=\"$password\"><br>"; $form.="<input type=\"submit\" value=\"Submit\">"; $form.="</form>"; echo ( $form ); }
  22. This is the table where the picture and data gets display.... <TD height="11" align="center" [color=red]valign="top"><[/[/color]font]div align="left"><span class="style1"> and as you can see is top ... that is my issue I have an array that display everything on that table cell ....I try separating the tables with colums but then I only get one listing ....check my first post and you will see how i explain the issue Still is Not working .... any new ideas
  23. does not work, i get error unespected '<'
  24. okay where do i put that atribute
×
×
  • 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.