Jump to content

vengod

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

vengod's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Where i am at with my code now. <?php session_start(); $username = "admin"; $password = "password"; if ($_POST['Username'] != $username || $_POST['Password'] !=$password) { ?> <form name="form" method="post" action="<?php echo $_SERVER['PHP SELF']; ?>"> <p><label for="txtUsername">Username:</label> <input type="text" name="username" id="username" /> <p><label for="txtPassword">Password:</label> <input type="password" name="password" id="password" /> <input type="submit" name="login" value="Login" id="login" /> </form> <?php } else { ?> LOAD NEW WINDOW <?php } ?> I followed this tutorial Still not working
  2. Yeah, trying to do this with the username and password being the credentials.. My current code <form name="form1" method="post" action="welcome.html""> <p>Username <label> <input type="text" name="username" id="username"> </label> Password <label> <input type="password" name="password" id="password"> </label> <input name="login" type="submit" id="login" value="Login"> <?php if($_POST["username"] == "admin" && $_GET["password"] == "password"){ setcookie("memberlogin", "loggedin", time() + 3600); }else{ header("Location: members.html"); }?>
  3. Sorry to bug again. But The submit button works (ie takes to another page) But it does this regardless of username and password? So anyone can access the "hidden" page?
  4. That is great, thank you Learn something new everyday Many thanks
  5. Thanks, But i'd like it so if the login details are correct, when submit is clicked, it opens up a new page? I can't see that on the link you provided.
  6. Hello, Im new to website building. I have created a login system. The login system echoes some text when the username and password is correct. However, if correct i would like it to open another page on my site. <form name="form1" method="post" action=""> <p>Username <label> <input type="text" name="username" id="username"> </label> Password <label> <input type="password" name="password" id="password"> </label> <input name="login" type="submit" id="login" value="Login"> <?php $username = $_POST ["username"]; $password = $_POST ["password"]; if ($username == "admin" && $password == "password"){ echo"Logged In";} ?> </p> </form> I am a novice and learnt this via youtube. However, can't find a tutorial for what i want. Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.