SitePoint Sponsor

User Tag List

Results 1 to 16 of 16

Thread: Error code

  1. #1
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error code

    Hi anyone know the PHP code to display errors?

  2. #2
    SitePoint Wizard cmuench's Avatar
    Join Date
    Jul 2005
    Location
    At my computer
    Posts
    2,251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    SitePoint Wizard Sillysoft's Avatar
    Join Date
    May 2002
    Location
    United States :)
    Posts
    1,691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  4. #4
    SitePoint Guru aamonkey's Avatar
    Join Date
    Sep 2004
    Location
    kansas
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://php.net/

    do a search for "error".

  5. #5
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is it supposed to work by putting error_reporting(0); at the top of the php file jsut under the php tags?

  6. #6
    SitePoint Wizard cmuench's Avatar
    Join Date
    Jul 2005
    Location
    At my computer
    Posts
    2,251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php

    // Turn off all error reporting
    error_reporting(0);

    // Report simple running errors
    error_reporting(E_ERROR E_WARNING E_PARSE);

    // Reporting E_NOTICE can be good too (to report uninitialized
    // variables or catch variable name misspellings ...)
    error_reporting(E_ERROR E_WARNING E_PARSE E_NOTICE);

    // Report all errors except E_NOTICE
    // This is the default value set in php.ini
    error_reporting(E_ALL E_NOTICE);

    // Report all PHP errors (bitwise 63 may be used in PHP 3)
    error_reporting(E_ALL);

    // Same as error_reporting(E_ALL);
    ini_set('error_reporting'E_ALL);

    ?>

  7. #7
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i did that correctly but no errors seem to be on my code :s

  8. #8
    SitePoint Guru aamonkey's Avatar
    Join Date
    Sep 2004
    Location
    kansas
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well that's too bad

  9. #9
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i jsut get a blank page, im sure there is nothign wrong with it and no errors are showing up

  10. #10
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is my code it works if i take out the include "listupdatepro thing but i need that in for my code to work properly and also there is nothing wrong with the listupdatepro file:

    <?
    include "theme.php";
    include "../db_connect.php";

    $username = $_POST['username'];
    $password = ($_POST['password']);

    $query = 'UPDATE b_users SET password="' . $password . '" WHERE username="' . $username . '"';

    if (mysql_query($query))
    include "../listupdatepro.php";
    echo "The user account $username password has now been changed.";
    else
    echo "There was an error while processing your request.";
    ?>

  11. #11
    SitePoint Addict I don`t mind's Avatar
    Join Date
    Feb 2006
    Location
    LA
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so why don't you post your code?
    Words are weapons of Mass Destruction.

  12. #12
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i just did :s

  13. #13
    SitePoint Addict I don`t mind's Avatar
    Join Date
    Feb 2006
    Location
    LA
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    include "theme.php";
    include 
    "../db_connect.php";

    $username $_POST['username'];
    $password = ($_POST['password']);

    $query 'UPDATE b_users SET password="' $password '" WHERE username="' $username '"'

    if (
    mysql_query($query))
    include 
    "../listupdatepro.php"
    echo 
    "The user account $username password has now been changed."
    else 
    echo 
    "There was an error while processing your request.";
    ?> 
    so I am getting "There was an error while processing your request." which is absolutely ok ... so did you really get a blank page or doas it say "The user account ..."
    maybe this sentence is not printed because there are brackets around the if-statement missing ... by the way if the if-statement (or for,...etc.) should do more then one action you have to put brackets around it ... without brackets it will just execute the first one
    Words are weapons of Mass Destruction.

  14. #14
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it jsuts gives me a blank page if i take off the listupdatepro part it says The user account $username password has now been changed but i know there is nothing wrong with the listupdatepro.php causei use it for different areas of my site and they havent stuuffed up

  15. #15
    SitePoint Addict I don`t mind's Avatar
    Join Date
    Feb 2006
    Location
    LA
    Posts
    218
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    if (mysql_query($query)) {
    include 
    "../listupdatepro.php"
    echo 
    "The user account $username password has now been changed."
    } else 
    echo 
    "There was an error while processing your request."
    then put the brackets {} around the if-actions and try it again
    Words are weapons of Mass Destruction.

  16. #16
    Non-Member
    Join Date
    Mar 2005
    Posts
    832
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks mate i got it working


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •