Error in T_STRING in PHP code

Discussion in 'PHP' started by achraf52, Aug 3, 2011.

  1. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #21
    You don't understand. That is not the correct way to program. You must initialize the vars before using them. They can't be empty or php will give you the error notice error. You can use php.ini to stop those notices from occurring. It isn't a error persay. Php is just telling you that you have bad programming practices.
     
    exodus, Aug 4, 2011 IP
  2. The Webby

    The Webby Peon

    Messages:
    1,852
    Likes Received:
    30
    Best Answers:
    1
    Trophy Points:
    0
    #22
    No need to change the ini file. he can stop notices and warnings to show up by setting the error reporting level to E_ERROR only.

    error_reporting(E_ERROR);


    http://php.net/manual/en/function.error-reporting.php

    But you are correct for the rest of the part, Not checking if the var is actually set before using it, is a bad practice.
     
    The Webby, Aug 4, 2011 IP
  3. exodus

    exodus Well-Known Member

    Messages:
    1,900
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    165
    #23
    exodus, Aug 4, 2011 IP
  4. achraf52

    achraf52 Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #24
    Hi, that not the current error please check the latest post by me as the error is that I do not see anything instead of "You entered a wrong password" so please look at those lines around it to see what is the error .

     
    achraf52, Aug 4, 2011 IP
  5. achraf52

    achraf52 Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #25
    Hi, that not the current error please check the latest post by me as the error is that I do not see anything instead of "You entered a wrong username" so please look at those lines around it to see what is the error .

     
    achraf52, Aug 4, 2011 IP
  6. achraf52

    achraf52 Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #26
    How I could set a value after knowing it is NULL just for preventing a error of Undefined index to be shown .
     
    achraf52, Aug 9, 2011 IP
  7. ausrixy

    ausrixy Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #27
    really horrible code use
    <?
    include_once ('blah');
    include_once ('blah2');
    include_once ('blah3');
    ?>
    instead of including them individually.
     
    ausrixy, Aug 10, 2011 IP
  8. achraf52

    achraf52 Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #28
    Hi, just stop guys I found a better way and easy way to login, and I solved the script error and now they works just fine .
     
    achraf52, Aug 11, 2011 IP
  9. JohnnySchultz

    JohnnySchultz Peon

    Messages:
    277
    Likes Received:
    4
    Best Answers:
    7
    Trophy Points:
    0
    #29

    look for this part...

    include('files/config.php";
    PHP:
    change it to...

    include('files/config.php');
    PHP:
     
    JohnnySchultz, Aug 12, 2011 IP