Jump to content

Mahngiel

Newly Registered
  • Posts

    1,068
  • Joined

  • Last visited

Posts posted by Mahngiel

  1.  

            AND date BETWEEN (CURDATE() - INTERVAL 30 DAY) AND (CURDATE() - INTERVAL 10 DAY)
    

     

    I've seen you post that methodology several times before, and I'm just curious: Is there a timestamp format that must be abided by in order for that to work? a la yyyy-mm-dd hh:mm:ss ?

  2. I'm very confused. I understand your not here to for me but could you please elaborate on this?

     

    Yes, I can tell from reading your code you would be.  You've thrown so many elements at the page, if you were to ever get this working, I'm not sure you understand why.  Take a look at this code, for example:

    <div style="background-color: #FFFFFF;width: 1119px; margin: 0px auto; border-left: 1px solid #ccc; border-right: 1px solid #ccc;">
        <ul id="navlist">
            <li>
                <div class="toggle1" style="background-color: #FFFFFF; border-bottom: 1px solid #ccc;">
                    <a href="#">
                        <div align="center" style="color: #000000;"><b>DROPDOWN</b></div>
                    </a>
                </div>
                <div class="hidden1">
                    <div style="height: 50px; background-color: #FFFFFF;"></div>
                </div>
            </li>
        </ul>
    </div>
    

     

    The purpose of these elements is to create one clickable element and the corresponding show/hide div.  Validation failures aside, you've got no logic in your code. 

    [*] The UL is a block-level element which is supposed to hold a ... list or grouped items like menus

    [*] You use a div > a > div This doesn't validate because you don't wrap a block-level element (<div>) in an inline element ( <a> ).  Yes, it works, but there is a much better way to do this:  If you manipulate the stylesheet, you can turn an element block.

    [*] Your code can be minimized and more easily read with a few minutes of study and effort.

     

    Put your styles into the stylesheet, not inline. makes debugging a pain in the ass.

    http://jsfiddle.net/Mahngiel/87g2X/

  3. what i would is is why separation between controllers and models are so important.  what i would do is start with looking for a user in the table that matches the inout username  if that first step passes, you have the row's salt, right? take that salt, and use it against the same strategy you employed to creqte the hash in the first place  if that result matches the earlier query's column value, then the "passwors" matches the user and a valid login has been established

  4. Yeah, that's really the question here.

     

    You need to figure out which areas of PHP (or programming in general) you are weak in, and then research those specific topics.

     

    When you're new to any language, not knowing what you don't know that can be useful to the endeavor is one of the hardest parts.  From there, it's just googling those topics.  To that end, i think surrogategod's suggestion is a valid one.  Getting open-source frameworks / applications, playing with it, and extending it is how I learned what i know ( supplemented with shit loads of google and these boards, ofc )

  5. Linux has limitations, for example ext3 has a 32,000 subdirectory limit, while ext4 has 64,000

     

    Subdir limit != file num limit, as evidenced by this snippet:

    for ($run = 1; $run < 65000; $run++) {
        file_put_contents ($run, 'test');
    }

     

    The result:

    test$ ls -l | wc -l

    65000

    zwzS.png

  6. you should research how to use the tools and what they're for before you implement them.  a JOIN is for combining more than one table (99% of the time) into a single table instead of making successive queries.

     

    Scenario: You want a user and his rank.  The user table stores a rank_id, which relates to the rank table which stores the name of the rank.

    bad way:

    <?php
    // getting user row
    $user = select * from users where user_id = 1;
    // get rank with that info
    select * from rank where rank_id = $user[rank_id];
    

    better way

    <?php
    //get user and rank together
    SELECT * FROM users where user_id = 1 LEFT JOIN rank on rank.id = user.rank_id
    

     

  7. ^^ Furthermore

     

    'password' => $this->encrypt->sha1($salt . $this->encrypt->sha1 . $this->input->post('password'))) <- controller

    'password', $salt . $this->input->post(sha1('password'))); <- model

    the two are not the same

     

    when you hash passwords, you are comparing the stored hash to the user's input that's been hashed in the same method.

     

    If you're storing it as per the first method, your login controller should take the password input, re-perform the encrypt method and compare the re-hash to the stored value.

     

  8. You don't declare a base font-size when declaring the font family.  It has it's own base dimensions from when it was drawn.  You can, however assign the font-size based on when you use it.

     

    h4 { font-family: my-font; font-size: 1em; }

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