Advertisement
Guest User

Untitled

a guest
Apr 21st, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. ( ! ) Parse error: syntax error, unexpected ')', expecting ']' in C:\wamp\www\ADS\connectivity.php on line 17
  2.  
  3. <?php
  4. define('DB_HOST', 'localhost');
  5. define('DB_NAME', 'ADS');
  6. define('DB_USER','root');
  7. define('DB_PASSWORD','');
  8.  
  9. $con=mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die("Failed to connect to MySQL: " . mysql_error());
  10. $db=mysql_select_db(DB_NAME,$con) or die("Failed to connect to MySQL: " . mysql_error());
  11. /*
  12. $ID = $_POST['user'];
  13. $Password = $_POST['pass'];
  14. */
  15. function SignIn()
  16. {
  17. session_start(); //starting the session for user profile page
  18. if(!empty($_POST['user'])) //checking the 'user' name which is from Sign-In.html, is it empty or have some text
  19. {
  20. $query = mysql_query("SELECT * FROM userlogin where userName = '$_POST[user]' AND pass = '$_POST[pass]'") or die(mysql_error());
  21. $row = mysql_fetch_array($query) or die(mysql_error());
  22. if(!empty($row['userName']) AND !empty($row['pass']))
  23. {
  24. $_SESSION['userName'] = $row['pass'];
  25. echo "SUCCESSFULLY LOGIN TO USER PROFILE PAGE...";
  26.  
  27. }
  28. else
  29. {
  30. echo "SORRY... YOU ENTERD WRONG ID AND PASSWORD... PLEASE RETRY...";
  31. }
  32. }
  33. }
  34. if(isset($_POST['submit']))
  35. {
  36. SignIn();
  37. }
  38.  
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement