This variable is registered in the Session, and the variable isn't active until the page refreshes. It's hard to explain. I thought I would try. There are some things you can do. If you need the variable right away, you can do this: if (isset($HTTP_SESSION_VARS["user1"])) { $user1 = $HTTP_SESSION_VARS["user1"]; } else { $user1 = $HTTP_POST_VARS["user1"]; } echo $user1;
Hope that helps. This is natural for sessions, but I have been in the situation where I needed the session variable right away, instead of the script's next activation. "Jed R. Brubaker" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I have a quirky problem that should be a breeze for someone who is smarter > than I. > > I have a script where I am registering a HTML form post variable as a > session variable and then echo it. In the real script I use it in a MySQL > query, but for the sake of this post, here is the "script": > > $user1 = $HTTP_POST_VARS["user1"]; > session_register("user1"); > echo $HTTP_SESSION_VARS["user1"]; > > This doesn't work, however, if I hit the refresh button the var miraculously > appears! > What am I doing wrong? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php