Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Comparing strings does not work php
- <?php
- $user = $_POST['myusername'];
- $pass = $_POST['mypassword'];
- $file_handle = fopen("db.txt", "rb");
- while (!feof($file_handle)){
- $line_of_text = fgets($file_handle);
- $parts = explode('=', $line_of_text);
- if($parts[0] == $user){
- echo $parts[0];
- }
- if($parts[1] == $pass){
- echo $parts[1];
- }
- }
- fclose($file_handle);
- ?>
- if(trim($parts[0]) == trim($user)){
- echo $parts[0];
- }
- if(trim($parts[1]) == trim($pass)){
- echo $parts[1];
- }
Add Comment
Please, Sign In to add comment