Show/Hide
Unnamed
Friday, February 22nd, 2008 at 12:10:46pm MST

This URL: http://pastebin.ca/914248
Alternatives: Raw
Language: Raw
Age: 19 hrs 59 mins
  1. <?php
  2. $host="localhost";
  3. $username="pandemic_njit";
  4. $password="njit";
  5. $db_name="pandemic_njit";
  6. $tbl_name="njit";
  7.  
  8. mysql_connect("$host", "$username", "$password")or die("cannot connect");
  9. mysql_select_db("$db_name")or die("cannot select DB");
  10.  
  11.  
  12. $username=$_POST['username'];
  13. $password=$_POST['password'];
  14.  
  15. $sql="SELECT * FROM $tbl_name WHERE username='$username' and password='$password'";
  16. $result=mysql_query($sql);
  17.  
  18.  
  19. $count=mysql_num_rows($result);
  20.  
  21.  
  22. if($count==1){
  23.  
  24. session_register("username");
  25. session_register("password");
  26. header("location:login_success.php");
  27. }
  28. else {
  29. echo "Wrong Username or Password";
  30. }
  31. ?>

Total Paste Views: 1 — Trackback (0) — PermaLink — Remove Paste

Show/HideUpdate the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will not expire by default. If you want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords.

fantasy-obligation