Jump to content

BloodyMind

Members
  • Posts

    98
  • Joined

  • Last visited

    Never

Posts posted by BloodyMind

  1. I agree with russel:

    use fetch_assoc() and use WHERE clause because imagine this query on a million user....that would take alot of server overhead

     

    I'd recommend that you use session_start() if you didn't already

     

    also try to use any encryption function for passwords i.e. md5() or sha1()

     

    Validate both inputs if its filled in or not using

    e.g:

    if (empty(trim($user)) || empty($pass)){

    echo "please fill in your login and password";

    }

     

    I'd recommend also not to inform the user which of the fields is incorrect for security reasons. tell him invalid user/password

     

    hope that helped

     

  2. well first of all

    this line $x needs to be concatenated :    echo ">$x</option>"; should be echo ">" . $x . "</option>";

     

     

    if ($x == $yearOptions)  and other condition statements you are comparing an integer to an array which is always gonna give false

    you should use the $yearOptions[key]

    where key is the pointer key to ur array's current value

     

    I'd also recommend using foreach to loop around the array

    please tell me more about the error you receive

  3. I have this file working on differrent servers properly but why is it getting that error in the client's server, I've tried to change the permissions to 0755 and all is the same

     

    Warning: Unexpected character in input: '' (ASCII=8) state=1 in /homepages/2/d278316518/htdocs/bizlogic/phpmailer/class.phpmailer.php on line 1298

     

    Warning: Unexpected character in input: ' in /homepages/2/d278316518/htdocs/bizlogic/phpmailer/class.phpmailer.php on line 1298

     

    Warning: Unexpected character in input: '' (ASCII=1) state=1 in /homepages/2/d278316518/htdocs/bizlogic/phpmailer/class.phpmailer.php on line 1298

     

    Warning: Unexpected character in input: ' in /homepages/2/d278316518/htdocs/bizlogic/phpmailer/class.phpmailer.php on line 1298

     

    Warning: Unexpected character in input: ' in /homepages/2/d278316518/htdocs/bizlogic/phpmailer/class.phpmailer.php on line 1298

     

    Warning: Unexpected character in input: ' in /homepages/2/d278316518/htdocs/bizlogic/phpmailer/class.phpmailer.php on line 1298

     

    Warning: Unexpected character in input: '' (ASCII=1) state=1 in /homepages/2/d278316518/htdocs/bizlogic/phpmailer/class.phpmailer.php on line 1298

     

    Parse error: syntax error, unexpected '@' in /homepages/2/d278316518/htdocs/bizlogic/phpmailer/class.phpmailer.php on line 1298

     

    line1298: return true;

     

    if anyone can help that would be greatly appreciated

  4. I've googled tutorials about how to make breadcrumb navigation

    but only found ways to do this by breaking the files into directories to make a structure for the breadcrumb

    but this doesn't suite me at all

     

    here is the case:

    I have category-> sub category -> product

    which all dynamically loaded

     

    how can I do that breadcrumb navigation without doing the directories thing ?

     

    Thanks in advance

    Regards

  5. With the way you are validating the user, you are using server resources so much

     

    anyways, what you should do:

    validate once in the login page and set sessions vars instead of cookies

    like this way

    sessions_start();

    $_SESSION['login']= $login;

    $_SESSION['is_logged_in'] = true;

    .....etc

     

    with that session variable $_SESSION['is_logged_in'] you can validate if he is logged in or not and also display the box of his control panel by using an if statement...

     

     

    I also recommend you to use md5() or sha1() functions to encrypt user password, search the manual for it.

     

    hope my reply was useful

  6. This should do the trick.

     

    <?php
    
    function dateBetween( $checkDate )
    {
    $firstDate1 = strtotime( "15-Jan-2008" );
    $firstDate2 = strtotime( "15-Mar-2008" );
    $secondDate1 = strtotime( "16-Mar-2008" );
    $secondDate2 = strtotime( "15-Jun-2008" );
    
    $checkDate = strtotime( $checkDate );
    
    if( $checkDate > $firstDate1 && $checkDate < $firstDate2 )
    {
    	return "2000";
    }
    elseif( $checkDate > $secondDate1 && $checkDate < $secondDate2 )
    {
    	return "4000";
    }
    
    return "0";
    }
    
    echo dateBetween( "25-Sep-2008" );
    
    ?>

     

     

    I agree with you but you should put >= or <= operators

     

    because this way the days itself wont return anything

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