I was hoping to create a php script that allows me to provide a person a link and give them specific login credentials. When the user goes to the page and logins I would then like it to redirect them to an https site like gmail and have it auto login with my creditials. It's kind of a round about way to allow someone to access my email without them knowing my password. I know this is probably a very dumb way of doing this but I'm new with php and am not sure how exactly I would accomplish this task or if its even php for that matter, haha.
This is the code I have to log in:
HTML:
<h1>Login</h1>
<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<p><label for="txtUsername">Username:</label>
<br /><input type="text" title="Enter your Username" name="txtUsername" /></p>
<p><label for="txtpassword">Password:</label>
<br /><input type="password" title="Enter your password" name="txtPassword" /></p>
<p><input type="submit" name="Submit" value="Login" /></p>
</form>
PHP:
<?php
// Define your username and password
$username = "admin";
$password = "password";
if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {
?>
<?php
}
else {
?>
website html
<?php
}
?>
I apologize for the horrible style and butchering the code but this is literally the first thing i've written in php. Also I've seen a good amount of posts related to what i'm asking but doesn't fully answer it. thanks!