Advertisement
Guest User

Wordpress php include

a guest
Nov 7th, 2014
1,171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. [insert_php]
  2. include(ABSPATH.'hms_/my_utilities')
  3. // include(ABSPATH.'hms_/my_utilities'); // <--- This prints the content of the file, so path is correct
  4.  
  5. // This function, copied from my_utilities, works as expected
  6. function getUserID_($username, $password) {
  7. $connection = mysqli_connect("","root","root","hms_db");
  8. $query="select uid from users where username='$username' and password='$password'";
  9. $result=mysqli_query($connection, $query);
  10. if(mysqli_num_rows($result) == 0){
  11. mysqli_close($connection);
  12. return -1;
  13. }
  14. while($row = mysqli_fetch_array($result)) {
  15. $uid = $row['uid'];
  16. }
  17. mysqli_close($connection);
  18. return $uid;
  19. }
  20.  
  21. [/insert_php]
  22. [insert_php]
  23. echo ABSPATH.'hms_/my_utilities';
  24. echo $date;
  25. if(isset($_POST['submit1']))
  26. {
  27. $username=$_POST['username'];
  28. $password=$_POST['password'];
  29. $uid = getUserID($username, $password); <-- function in my_utilities
  30. // $uid = getUserID_($username, $password); <-- same function above
  31. .
  32. .
  33. <rest of the code>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement