Jump to content

AlexejheroYTB

New Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by AlexejheroYTB

  1. this is the code that works:

    <?php
    if(isset($_POST['pin']) AND !empty($_POST['pin'])){
    $input = $_POST['pin'];
    $pinI = "6203";
    $pinII = "9471";
    if($input == $pinI){
    header("Location:pinI.html");
    }else{
    if($input == $pinII){
    header("Location:pinII.html");
    }else{
    echo "PIN INCORRECT!";
    }}
    
    }else{
    echo "PIN EMPTY!";
    }
    ?>
    
  2. the variable names are correct

    <?php
    if(isset($POST['pin']) AND !empty($POST['pin'])){
    $input = $_POST['pin'];
    $pinI = "6203";
    $pinII = "9471";
    if($input == $pinI){
    header("Location:pinI.html");
    }else{
    if($input == $pinII){
    header("Location:pinII.html");
    }else{
    echo "PIN INCORRECT!";
    }}
    
    }else{
    echo "PIN EMPTY!";
    }
    
  3. It still says PIN EMPTY!

    my code now:

    <?php
    if(isset($POST['pin']) AND !empty($POST['pin'])){
    $input = $_POST['pin'];
    $pinI = "6203";
    $pinII = "9471";
    if($input == $pinI){
    header("Location:pinI.html");
    }else{
    if($input == $pinII){
    header("Location:pinII.html");
    }else{
    echo "PIN INCORRECT!";
    }}
    
    }else{
    echo "PIN EMPTY!";
    }
    
  4. So, I am trying to create a website where you enter a pin, it redirects you to a page, enter another pin, it redirects you to another page.
    I have two files:
    th1.php   (the main file)

    <?php //require_once"app/init.php ;?>
    <!DOCTYPE HTML>
    
    <link rel="stylesheet" type="text/css" href="style.css" /> 
    
    <form action="th.php" method="POST">
    
    
      <div class="container">
    
        <input type="text" placeholder="Enter PIN" name="pin" required>
    
    
    
        <button type="submit" name="sub" value="Submit">Submit</button>
    
      </div>
    
    
    
      <div class="container" style="background-color:#f1f1f1">
    
      </div>
    
    </form>
    

    and th.php (the verification file)

    <?php
    if(isset($POST['pin']) AND !empty($POST['pin'])){
    $input = $_POST['pin'];
    $pinI = "6203";
    $pinII = "9471";
    if($input === $pinI){
    header("Location:pinI.html");
    }else{
    if($input === $pinII){
    header("Location:pinII.html");
    }else{
    echo "PIN INCORRECT!";
    }}
    
    }else{
    echo "PIN EMPTY!";
    }
    

    but any code I insert, even the correct one, it sais PIN EMPTY!

     

    can you help me please?

×
×
  • 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.