Jump to content

dezkit

Members
  • Posts

    1,236
  • Joined

  • Last visited

Posts posted by dezkit

  1. thanks guys but its not what i wanted :P

     

    here is my website

    i created a subdirectory (a)

    i made a blank index.php (so u guys can give me the code)

    i created a subdirectory (b) in that subdirectory, i made 2 random html files,

     

    how do i look whats in subdirectory(b) by the index.php in subdirectory(a) ? :)

  2. checklogin.php

     

    <?php
    ob_start();
    $host="localhost"; 
    $username="dezkit";
    $password="******"; 
    $db_name="test"; 
    $tbl_name="members"; 
    
    mysql_connect("$host", "$username", "$password")or die("cannot connect");
    mysql_select_db("$db_name")or die("cannot select DB");
    
    
    $myusername=$_POST['myusername'];
    $mypassword=$_POST['mypassword'];
    
    $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'";
    $result=mysql_query($sql);
    
    
    $count=mysql_num_rows($result);
    
    
    if($count==1){
    
    session_register("myusername");
    session_register("mypassword");
    header("location:login_success.php");
    }
    else {
    echo "Wrong Username or Password";
    }
    
    ob_end_flush();
    ?>
    
    
    

  3. how do i make multiples?

     

     

    <?php
    
    
    
    // Define your username and password
    
    $username = "someuser";
    
    $password = "somepassword";
    
    
    
    if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] != $password) {
    
    
    
    ?>
    
    
    
    <h1>Login</h1>
    
    
    
    <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    
        <p><label for="txtUsername">Username:</label>
    
        <br /><input type="text" title="Enter your Username" name="txtUsername" /></p>
    
    
    
        <p><label for="txtpassword">Password:</label>
    
        <br /><input type="password" title="Enter your password" name="txtPassword" /></p>
    
    
    
        <p><input type="submit" name="Submit" value="Login" /></p>
    
    
    
    </form>
    
    
    
    <?php
    
    
    
    }
    
    else {
    
    
    
    ?>
    
    
    
    <p>This is the protected page. Your private content goes here.</p>
    
    
    
    <?php
    
    
    
    }
    
    
    
    ?> 

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