PHP Login Validation
<p>For some web development practice, I decided to make a dropbox-like site where users would login with a username and password and, assuming the combination is correct, would have access to a file uploader interface as well as a way to retrieve their files.  I have something that works, but I have run into one problem.  As soon as the user submits their username and password, the page is reloaded (this is fine) with the new php code, however, the URL changes slightly to where it reveals both the username and the password.  Can someone tell me how to prevent this from happening?</p>

<p>Here is the index.php file:</p>

<pre><code>&lt;?php
  function checkCredentials()
  {
    if($_GET &amp;&amp; $_GET["username"]=="kwaugh" &amp;&amp; $_GET["password"]=="password")
  {
?&gt;

    &lt;html&gt;
        &lt;head&gt;
                &lt;title&gt;File Storage&lt;/title&gt;
                    &lt;style&gt;
                        body{font-size:.85em ;font-family:Arial;}
                    &lt;/style&gt;
        &lt;/head&gt;

        &lt;body&gt;
            &lt;center&gt;
                &lt;br&gt;Please select the file that you would like to upload:&lt;br&gt;&lt;br&gt;
                    &lt;form method="post" enctype="multipart/form-data"&gt;
                        &lt;input type="file" name="filename"/&gt;
                        &lt;input type="submit" value="Upload" /&gt;
                    &lt;/form&gt;
            &lt;/center&gt;
        &lt;/body&gt;
    &lt;/html&gt;
    &lt;?php
        if ($_FILES)
        {
            $name = $_FILES['filename']['name'];
            move_uploaded_file($_FILES['filename']['tmp_name'], $name);
            if(file_exists($name))
            {
                ?&gt;
                &lt;html&gt;
                    &lt;body&gt;
                        &lt;div style="color:red; font-size:2em; font-family:Arial"&gt;
                            &lt;center&gt;The file has been successfully uploaded &lt;br /&gt;Click &lt;a href="getFiles.php"&gt;here&lt;/a&gt; to go to your uploaded files&lt;/center&gt;
                        &lt;/div&gt;
                    &lt;/body&gt;
                &lt;/html&gt;

                &lt;?php
            }
            else
            {
                    ?&gt;
                    &lt;html&gt;
                        &lt;body&gt;
                            &lt;div style="color:red; font-size:2em; font-family:Arial"&gt;
                                &lt;center&gt;Well crap, something went wrong.  The file could not be uploaded :'( &lt;/center&gt;
                            &lt;/div&gt;
                        &lt;/body&gt;
                    &lt;/html&gt;

                    &lt;?php
            }
    }
    die();
}
elseif($_GET &amp;&amp; $_GET["username"]!=="kwaugh" || $_GET &amp;&amp; $_GET["password"]!=="password")
{
    ?&gt;
    &lt;script&gt;
        alert("You have entered an incorrect username/password combination");
    &lt;/script&gt;

    &lt;?php
}
}
checkCredentials();
?&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;File Storage&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt; &lt;br /&gt;&lt;br /&gt;
    &lt;center&gt;
        &lt;img src="elephant.jpg"&gt;
        &lt;form name="credentials"&gt;
            Please enter your username and password to upload files: &lt;br     /&gt;
            Username: &lt;input type="text" name="username"&gt;&lt;br /&gt;
            Password: &lt;input type="password" name="password"&gt;&lt;br /&gt;
            &lt;input type="submit" value="Submit" &gt;
        &lt;/form&gt;
        &lt;br /&gt;Or click &lt;a href="getFiles.php"&gt;here&lt;/a&gt; to access stored files.
    &lt;/center&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
