rambabuforu Posted April 15, 2010 Share Posted April 15, 2010 <?php $username = "username"; $password = "password"; if(($_POST['PHP_AUTH_USER'] == $username)&& ($_POST['PHP_AUTH_PW'] == $password)) { echo apache_setenv("PHP_AUTH_USER",$username); echo apache_setenv("PHP_AUTH_PW",$password); echo putenv("PHP_AUTH_USER =$username"); echo putenv("PHP_AUTH_PW = $password"); $PHP_AUTH_USER =$username; $PHP_AUTH_PW = $password; $_SERVER['PHP_AUTH_USER'] =$username; $_SERVER['PHP_AUTH_PW'] = $password; } ?> <form method="post"> <p>Username : <input type="textbox" name="PHP_AUTH_USER" id="PHP_AUTH_USER" /><br /> <p>Password : <input type="password" name="PHP_AUTH_PW" id="PHP_AUTH_PW" /><br /> <p> <input type="submit" name="submit" /> </form> I need to set the variables $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] using php, passing form values. Please help me to sort out this...... Quote Link to comment Share on other sites More sharing options...
trq Posted April 15, 2010 Share Posted April 15, 2010 You just did, whats the problem? There not going to persist requests however which is what I assume you want to do. For that to happen you would need to store the data submitted by your form within the $_SESSION array and then use that to populate the $_SERVER array on each request. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.