OtagoHarbour Posted May 11, 2011 Share Posted May 11, 2011 I use the following form to allow the user to log in.<form action="login.php" method="post"> User name: <input type="text" name="username" /> Password: <input type="password" name="pwd" /><br /> <input type="submit" value="Submit" /><br /></form>login.php includes the following code. $GivenUserName=$_POST["username"]; echo "User name:" . $GivenUserName; $result = mysql_query('SELECT * FROM SubScribers WHERE username="'.$GivenUserName.'"'); $row = mysql_fetch_array($result); mysql_close($con); if (sha1($_POST["pwd"])==$row['PassWord']) { header("Location: http://localhost/Whatever.html"); }Is there a way to pass $GivenUserName or $_POST["username"] to http://localhost/Whatever.html so thathttp://localhost/Whatever.html displays something likeWelcome [whatever the user name is]when it is opened.Also http://localhost/Whatever.html has the following line<a href="http://localhost/UploadFile.php">Upload Files</a>Is there a way to subsequently pass $GivenUserName or $_POST["username"] on to http://localhost/UploadFile.phpso that a directory with the name $GivenUserName or $_POST["username"] may be created to store the uploaded files.I guess one way is to store the user name in a file but I thought there may be a better way to do it.Many thanks in advance,Peter. Link to comment Share on other sites More sharing options...
jeffman Posted May 11, 2011 Share Posted May 11, 2011 Temporarily save data in a session. These examples illustrate the concept better than the introduction examples do. Link to comment Share on other sites More sharing options...
OtagoHarbour Posted May 13, 2011 Author Share Posted May 13, 2011 Temporarily save data in a session. These examples illustrate the concept better than the introduction examples do.That works great! Thanks very much,Peter. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.