Jump to content

fugix

Members
  • Posts

    1,483
  • Joined

  • Last visited

Posts posted by fugix

  1. Try

    <html>
    <body>
    <?php
    $hashtocrack = $_GET['crackme'];
    $file = fopen("dictionary.txt","r");
    if(isset($file)){
    while($hash = fgets($file)){
    $md5check = md5($hash);
    if($md5check == $hashtocrack){
    echo "Hash found! -> ", $hash;
    exit(1);
    }
    }
    }
    ?>
    </body>
    </html>

  2. If you are storing your user data into a database, which it sounds like you are, you can create a field as an int, primary key and auto-increment, and set that as your user id which will be unique

  3. I will elaborate on what abra posted in case you don't understand what he is trying to say. You need to use the correct operator when comparing the $username variable to 'admin'

    if ($username == 'admin'){
    header("Location: ./admin.php");
    }
    else
    

  4. The single quote in your user data is ending your query prematurely. You will need to use mysql_real_escape_string() before inserting the data into your db

     

    Edit: saw your new post, did you just add mysql_real_escape_string or was it there prior?

  5. So you are trying to grab the username from either a form or a query string in this line

    $username =  preg_replace('#[^0-9]#i', '', $_GET['username']); 

    But it is not correctly grabbing the data? Do I understand you correctly

  6. Can you use $_SESSION function differently in another page and it will pick up the other registered variable if it has not been used before. :o

    $_SESSION is a predefined superglobal array, not a function. Also, I don't quite understand what it is that you are trying to ask here. Please be more clear with your question

  7. With mysql_fetch_array() you can either use the row integer value, or the associative value. Soulessj, since I see that this problem still has not been solved for you, I will jump in on this one. Can you briefly describe what exactly is going wrong for you now so that I may help

  8. Instead of using another preg_match() etc to try and compare your email value to your text file, why not use the function in_array() which compares the value of mixed types of data to a value in an array.

     

            if (in_array($cities[1], $citiesArray) {

                     echo "this one!";

                   }

            else {

                     echo "not this one";

                   }

  9. You'll want to use the sha1() function before insertion into your database. Since sha1 is 160, and depending on how many bits pwr character, would effect the length of the value, 20 or 40. So I recommend using BINARY(20) and the UNHEX function to convert the SHA1 value to binary.

     

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