dominic600 Posted August 8, 2011 Share Posted August 8, 2011 I have a javascript running my login boxes like the username and password boxes. and when i login its supposed to look like "admin | Logout" well when i log in the boxes say the same and it just gives me a readout saying i logged in. theres the javascript, eventho i dont think it is wrong with that but then again idk.. function usernamebox_focus(){ var usernameboxid = document.getElementById("usernamebox"); if (usernameboxid.value == "Username"){ usernameboxid.value = ""; usernameboxid.style.color = "#000"; } } function usernamebox_blur(){ var usernameboxid = document.getElementById("usernamebox"); if (usernameboxid.value == ""){ usernameboxid.value = "Username"; usernameboxid.style.color = "#999999"; } } function passwordbox_focus(){ var passwordboxid = document.getElementById("passwordbox"); if (passwordboxid.value == "Password"){ passwordboxid.value = ""; passwordboxid.type = "password"; passwordboxid.style.color = "#000"; } } function passwordbox_blur(){ var passwordboxid = document.getElementById("passwordbox"); if (passwordboxid.value == ""){ passwordboxid.value = "Password"; passwordboxid.type = "text"; passwordboxid.style.color = "#999999"; } } and then heres the top. <?php session_start(); $username = $_SESSION['username']; $userid = $_SESSION['userid']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>1st Gen Cummins Blog | Login</title> <link href='main.css' rel='stylesheet' type="text/css"></link> <script language="javascript" src="scripts/javascript.js"></script> </head> <body> <div id='header'><div id='headercnt'>1990 Dodge Cummins Turbo Diesel <div id='status'><?php require('scripts/status.php'); ?></div> </div> Quote Link to comment Share on other sites More sharing options...
phpSensei Posted August 8, 2011 Share Posted August 8, 2011 Hi Dom, I don't understand why you are using Javascript for this? Quote Link to comment Share on other sites More sharing options...
dominic600 Posted August 8, 2011 Author Share Posted August 8, 2011 well the tutorial im following says to cause the way it says username and password inside the box.. idk but now it worked but now when i log out it wont bring my box back. like it just did the oppsite. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted August 8, 2011 Share Posted August 8, 2011 Can you link me to the page you are editing? Quote Link to comment Share on other sites More sharing options...
dominic600 Posted August 8, 2011 Author Share Posted August 8, 2011 http://tprofiletesting.net23.net/profile.php its on everypage tho.. but up in the top right is what im talking about in the header.. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted August 8, 2011 Share Posted August 8, 2011 I know what you are referring too, however I will still don't understand what you mean by " wont bring my box back. Quote Link to comment Share on other sites More sharing options...
dominic600 Posted August 8, 2011 Author Share Posted August 8, 2011 it was the login and username text boxes. but i now solved it. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted August 8, 2011 Share Posted August 8, 2011 Ah, See you don't always need us... 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.