Jump to content

Mcjohnes

Members
  • Content Count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Mcjohnes

  • Rank
    Newbie
  1. hello i need help with a simple javascript simple login form, i am building a small website for I and my classmates. i want it to be able to redirect each user to a specific page when a corresponding passcode is entered, i know its unsafe but we dont plan on keeping valuable information on the site, i dont know about MSQL and dont even wish to use it, the code works at this level but am unable to add users since i dont understand javascript if someone could help me i will be very grateful thanks in advance /*here is the code i got so far*/<tittle>Enter Passcode to proceed</title><h1 style="font-family:Comic Sans Ms;text-align="center";font-size:20pt;color:#00FF00;></h1><form name="login">Passcode: <input type="text" name="userid"/><input type="button" onclick="check(this.form)" value="Login"/><input type="reset" value="Cancel"/></form><script type="text/javascript">function check(form)/*function to check userid */{ /*the following code checkes whether the entered userid is correct*/ if(form.userid.value == "JohnDoe") { window.open("johndoe.php")/*opens the target page while Id */ } else { alert("Invalid Passcode, please try again!")/*displays error message*/ }}</script>
×
×
  • Create New...