Advertisement
Guest User

Untitled

a guest
Aug 15th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. this is in a file called functions, right now it is the only thing in there besides my mysql connection.
  2.  
  3. function protect($string){
  4. $string = trim(strip_tags(addslashes($string)));
  5. return $string;
  6. }
  7.  
  8. i include it here on my other page.
  9.  
  10. <?
  11. session_start();
  12.  
  13. if(($_POST['check']) == $_SESSION['check']) {
  14. echo $_SESSION['check'];
  15. }else{
  16. echo 'Your CAPTCHA numbers are incorrect.';
  17. }
  18. include('functions.php');
  19. ?>
  20.  
  21. and this is where im using it on the same page.
  22.  
  23. if(isset($_POST['submit'])){
  24.  
  25. //protect and then add the posted data to variables
  26. $username = protect($_POST['username']);
  27. $password = protect($_POST['password']);
  28. $password2 = protect($_POST['password2']);
  29. $email = protect($_POST['email']);
  30. $permisson = protect ($_POST['permission']);
  31. $agree = protect ($_POST['agree']);
  32.  
  33. im getting this error:
  34. Fatal error: Call to undefined function protect() in C:\inetpub\wwwroot\register.php on line 69
  35.  
  36. which is this line:
  37. $username = protect($_POST['username']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement