Getting Rid Of Errors

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

Getting Rid Of Errors

dark
Hi

Is it ok to use error-reporting(0) locally in a snippet of code that spits an undefined variable error?
I found that fix and was wondering what does everybody do about error messages that keep poping up.

Thanks

Patrick

Reply

no9t9
my scripts don't have error messages... try to find out what's wrong and fix it. or try to do it a different way. there is always more than one way to do something in programming.

Reply

OpaQue
Turnning off the error reporting function can sometimes make it hard to track the errors.. So debugging becomes extremely difficult. You can use an include file on top to set this option for all the files. So while you are debugging you can temporarily disable it.

The other option which you have is using the "@" symbol. If you preceed any function with it, the errors are suppressed but they are limited to that line of code only.

Reply

LuciferStar
try to make your codes work well,
or try '@' before every function you have to use,like

@count($emptyarray);
@fopen("","w");

if you do so,then no error message will be displayed.

Reply

dark
Hi

This is the original poster. Thanks so much for the kind answers and the @ tip, I am going to try to use it asap.
While browsing the web for answers to my problem, I came upon a snippet of code that showed how a variable that sometimes isn't defined creates an error with the parser. So including this variable code in an IF statement would prevent the error also.
Like someone said above, there are several solutions to fix that.

Thanks again

Patrick

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Similar Topics

Keywords : rid, errors

  1. Trap17 Registration Page Linkage Errors
    (2)
  2. Is The Database System Gone Again? [resolved]
    Errors on PHPMyAdmin again (12)
    I wonder if there is a problem with the PHPMyAdmin system again? When trying to get into it, I once
    again get the following: QUOTE Warning: session_write_close() : SQLite: session write query
    failed: database is full in /usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php on line 42
    Warning: session_write_close() : Failed to write session data (sqlite). Please verify that the
    current setting of session.save_path is correct
    (/var/cpanel/userhomes/cpanelphpmyadmin/sessions/phpsess.sdb) in
    /usr/local/cpanel/base/3rdparty/phpMyAdmin/index.php on line 42 Warning: Ca....
  3. Fopen Errors :(
    grrr, i'm angry :( (6)
    Okay, i've made a very, very simple PHP counter for my site, i've set up all the permissions
    and everything (triple checked permissions are right); CODE <?php $hits =
    file_get_contents("/home/tracdoor/public_html/hitcounter.txt"); $hits =
    $hits + 1;    $handle = fopen("hitcounter.txt", "w");
    fwrite($handle, $hits); fclose($handle); print $hits;
    ?> Now that works fine on my homepage, or any page in the /public_html/ directory, but if i
    in....
  4. How To Get Rid Of Cyclic Redunduncy Check(crc) Errors From Cd/dvd's
    (5)
    Lost MANY CD's and DVD's due to that.Precious lots of data perished for no fault of
    ours.What causes this error in CD/DVD's and how do we get rid of it?Making an image is
    impossible ,same with trying to extract data using IsoBuster.Evn brand new scratch fre discs show
    this error sometimes.....
  5. New Found Php Coding Errors
    I always thought these worked, but suddenly they no longer do?! (5)
    Hi i'm dan from new zealand, right next to my home land australia. I have been writing php
    scripts for two years now and just recently none of them have been working. Please help me out as
    best as you can, i'm sure it is only something simple. CODE ----------------Form
    1-------------------------- <?php // ---- Customized form script for the HBRC---------------
    // Receiving variables ----------------------------------- @$fn =
    addslashes($_POST['fn']); @$ln =
    addslashes($_POST['ln']); @....
  6. Giving A Flash Button A Link
    i get errors (3)
    oke well i made my button and i addet the actionscript to give the button an url,see the screenshot
    below now for some reason it gives me errors,and i don't know what i did wrong to be
    honest,so can some one help me out with this p.s i do use flash cs3 so i dunno maybe its another
    way to put an url on ur button with this version cause with flash pro8 and mx i never had a problem
    with this....
  7. Menu Errors In Internet Explorer
    (4)
    I am not sure if this is the correct section, but this is related to HTML. I have some menus at the
    top of my forum, which work perfectly in Firefox. But my members started complaining that they were
    not working correctly, and when I tested it in Internet Explorer, I found that only two of the menus
    show up, and the others show up as plain text below. Here is a screenshot of what the menus look
    like in the two browsers: I have thought of something though. The HTML i used for my menus was
    the only code I could find for to make some menus. But I noticed that this forum....
  8. Two Errors I Get.
    On my phpBB2 forums. (1)
    One is one I think everyone is getting. I tried to submit a support request but it says I have to
    define a language. I click the button and I get a WHW error or something. Then it redirects me back
    to the main page. Then at the bottom of the sumbit request page is says that this feature has not
    been set up by a admin yet. I think everyone is getting this one. If so please say you are or if I
    am alone. QUOTE Warning: mysql_connect() : Can't connect to local MySQL server through
    socket '/var/lib/mysql/mysql.sock' (2) in /home/damen/public_html/phpBB/db/m....
  9. Database Errors!
    Started after HDD change.. (5)
    Hello, I am having database errors. They started after yesterdays HDD change. Its all fine when i
    refresh site, they not that often but still i get them. It says "could not connect to database". And
    i also received mail from gamma.xisto.com which says: QUOTE There has been a problem with the
    database! This is a notice email to let you know that SMF could not connect to the database,
    contact your host if this continues. so i am contacting my host......
  10. Google China
    Errors with Google (13)
    For about one or two weeks my browsers(both internet explorer and firefox) were hijacked to some
    degree by google. No matter what web address I would put in to either of them be it something like
    www.yahoo.com or www.msn.com or anything at all I kept getting sent to an error page for Google
    China and the only other page I could access was the Google China home page. Anyone else have this
    problem or heard of it? I'm really interested in knowing wtf google screwed up on the internet,
    or was this just a forceful advertising scheme by the Search Giant.....
  11. Qupis Hosting Module Errors. Fixed Now!
    (0)
    Hi Members, We had some module ERRORS yesterday as a result, There was a brief downtime. The ads
    were not being displayed properly and some members reported duplicate ads. The errors have been
    fixed. Within this span, any accounts which were ordered might have hosting activation problems. We
    estimate around 6-7 accounts with these errors. We are extremely sorry for the inconvenience.
    Thank You....
  12. Major Dns Errors
    (10)
    A bit of info that might be needed first: -I go to college, the only time I can go to or
    work on my site is at that college usually and once in a while at a friend's house. -I don't
    have administrative access at the college. -Nothing has changed with the Network at the college
    since December. -My problem started maybe last week or it may have started weeks ago I don't
    remember using my site much before a week ago, but I highly doubt the problem started then.
    Problem: -After 5-30minutes of being on my site usually I can no longer go to it. It hap....
  13. Parse Errors While Installing Smf Board
    (3)
    I seem to be getting a LOT of parse errors with my php scripts. there are two things they have in
    common: 1. they are downloaded and uploaded without modifying them. 2. they all seem to have
    "unexpected $end" e.g QUOTE Parse error: syntax error, unexpected $end in
    /home/random1/public_html/hsp/forum/webinstall.php on line 271 that example for webinstall.php, a
    script used to install SMF. I know that trap17 provides fantastico to install SMF, but I want to
    install SMF1.1RC3 to use with joomla-smf, which fantastico doesn't support. if I upload and ins....
  14. Header Redirect Errors
    (5)
    Hi, I am using the header function to redirect after the processing of the form. I have to specify
    a internal link using '#link'. This works in Firefox and opera. But in Internet Explorer
    internal linking when done from a redirect is not working for somewhat reasons. e.g.
    header("Location: http://www.example.com/index.php#link"); this works in Firefox and Opera but
    not in Internet Explorer . IE just accepts 'http://www.example.com/index.php' instead of
    http://www.example.com/index.php#link Please help me if you know anything about this. Well ther....
  15. Errors With Php Setcookie() And Headers! Please Help!
    Having header errors when I try to set a cookie with PHP function setc (2)
    Hey guys, I'm having a problem setting cookies with PHP. I am trying to implement a script that
    will allow someone to log in and access members only pages on my website. One of the aspects is that
    I have to place a cookie on that persons computer. I know that you can use the PHP function
    setcookie() to place it on your computer. The problem is that wherever i have setcookie() in my PHP
    code I get an error: " Warning: Cannot modify header information - headers already sent by (output
    started at /home/runeco/public_html/cookie.php:6) in /home/runeco/public_html/cooki....
  16. Sites Disapeard, Mysql Errors? Also Server Folders Deleted
    (18)
    Hello its 15:40 and I login see if everything runs oke, and I see numerus things deleted my mysql is
    working again. Whats going on? My Webpage couple websites got deleted, and server folder files now
    whats going on? /sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> my
    forum also give errors but mysql db stil there /sad.gif" style="vertical-align:middle" emoid=":("
    border="0" alt="sad.gif" />.......
  17. Script Not Working :s
    mysql errors (5)
    process_login.php: Process the login. $host = "localhost";// the host that u are connecting
    $username = "root";// user name $password = ""; // passworld $basedatos =
    "forum"; //Dont change this1. $db = mysql_connect($host, $username, $password);
    mysql_select_db($basedatos, $db); $user= $_REQUEST ; $pass=
    md5($_REQUEST ); $query1= "SELECT * FROM smf_members WHERE
    memberName='$user'"; $mkquery= mysql_query($query1,$db); $row1=
    mysql_fetch_assoc($mkqu....
  18. Why Are There Errors?
    Why are there errors in some topics I post? (2)
    Why is it that when I view some of my posts it says error? Cant these topics by me be viewed by
    other users? I was wondering if this error is on the database of trap17.com forums. Ive had this
    problem also in my WAP community site some months ago. It was due to the quotes and double quotes
    people post. But Im not sure what is the problem in here. Invision Power Board should have fixed
    this bug before. What do you think?....
  19. Internal Server Errors With Phpmyadmin
    (0)
    Receive Internal Server Error message in the following circumstances: 1) I try to insert data by
    writing a MySQL query (rather than by using the insert button). The reason I wish to do this, btw,
    is to enable me to copy data from another MySQL database without making individual inserts -
    There's no import function in phpMyAdmin in Trap17.net. NB If I copy and paste a table creation
    query, it works. 2) I try making individual inserts using the insert button. The screen now
    suggests that data is present in the fields where I have inserted, but if I try to browse, I ....
  20. Errors,errors,errors!
    (5)
    Sometimes I keep getting the same errors when i open a program. I get an error like : {Insert
    Program Name} has done an illegal operation and is now being shutting down. i dont know wut that
    means and y it keeps doing this but it keeps happening and its driving me
    insane!!!!!....
  21. [solved]dsn Help (errors)
    (3)
    Solved....
  22. Why Is Php All Of A Sudden Spitting Errors At Me?
    (7)
    hi, I have a problem with my PHP on my site. It just started happening now but i think the PHP
    database some how corrupted its self. How can i reinstall the PHP or upgrade it to the latest PHP
    version, please respond back as this is effecting alot of my PHP scripts. Thanks....
  23. My 1st Tabbed Browser
    Has Few Errors Help Me Spot It (9)
    Hey here this is a browser made by me Includes google search bar and tabbed browsing cool?? its
    better than IE 6.0 But mine has a few runtime errors if a debug msg comes press NO This one cool
    always same the two + and - buttons r for tab browsing click the + to open another tab and - to
    close the tab This browser was made by me and its free to distribube Pls report errors in this
    thread Download Link Click Here Edit: Runtime error only happens when going to my website Renders
    IE Still in BETA - need u to test it too Screenshot: ....
  24. Computer Errors
    (9)
    Well, first I will start with the basics. My computer is a 1 ghz amd processor. 640mb ram 32mb
    nvidia graphics card running windows 2000 What my problem is, is that I have been getting blue
    screen of death errors, with the following message. (its not always the same, but similar) CODE
    *** STOP: 0x0000004E (0x00000099, 0x00FFFFFF, 0x00000000, 0x00000000) PFN_LIST_CORRUPT
    Beginning dumb of physical memory Physical memory dumb complete.  Contact your system administrator
    or technical support group. What is this message saying? I have been occasiona....
  25. Frontpage Server Extentions Errors
    any one else had these? (0)
    Hi all, im haveing some trouble with the frontpage extentions on trap17 or on my computer. Does
    anyone know how to fix them because its becoming a pain to not be able to publish correctly!
    Everytime i attempt to publish i get this error message: "The server sent a response which
    FrontPage could not parse. If you are trying to connect to a Windows SharePoint Services server,
    check with the server's administrator to make sure Windows SharePoint Services is installed
    properly." I already have the port unblocked in my firewall and in my router. But anyways i w....
  26. Errors Trying To Access Website
    along with cpanel access (2)
    My website, http://morosophos.trap17.com/ doesn't work as http://www.morosophos.trap17.com/ .
    Why is this? I can no longer use 99% of the functions on cpanel, and wordpress (which I installed)
    is also no longer working correctly. Does anyone know why this is happening? Topic title and
    description are very important. Editing. ....
  27. Errors Setting Up Hosting
    can't setup account (1)
    just tried setting up hosting, wouldn't let me post in the free web hosting help section so
    posted here Processing.. Please wait!. Do not hit RELOAD or BACK.. Username Validated.
    Connecting to Database... Database Connection Established. Validating username and password..
    Username Validated. Checking permissions.. Permission granted. Preparing data for Creating Account..
    Approved for trap17_Beta.. Checking, if username is unique. Username seems to be unique. All Data
    Confirmed. Account information Ready. Stand-by, Trying to connect to server and create account......
  28. Internet Errors
    Uggh! (8)
    Okay, so you are on the computer one day, gladly increasing your posts on Trap17.com or playing your
    favourite online Role Playing Game (RPG), and suddenly, you receive that eternal error from your
    browser and from Microsoft..." has encountered an error and needs to unexpectedly close" So you,
    yelling with all of your gut out, "WHY DID IT HAVE AN ERROR WHEN I WAS AT A WORLD HIGH SCORE?" for
    example...honestly, Microsoft has tons of bugs and the websites we visit are not to blame (well,
    some of them are...). What is the meaning of this? Honestly! I was typing up an i....
  29. View The Errors In Your Html!
    (14)
    Did you ever do a script and think... How do I know if it is going to display right for everyone....
    How do I know my HTML is pure 100% clean, well, think no more... http://validator.w3.org/ - on
    that URL, you can put in your URL and it tells you how many errors and it displays the errors in
    your coding!! example: http://validator.w3.org/check?uri=http%3A%...&doctype=Inline
    Displays 51 errors! Enjoy /wink.gif' border='0' style='vertical-align:middle' alt='wink.gif'
    /> Jack....
  30. Understanding Html Validation Errors
    (4)
    Hello to you all not been here before but hear ed good things and pointed here as I have a problem.
    Briefly I have a site I am in the process of building based on a borrowed structure which I have
    slowly dismantled and am putting back together. I took this on knowing very little about HTML but
    believe you have to try. The site is now around 10 pages and I was advised to put it through the W3
    verifier to see how it looked. Well it looks fine until I put it through... the verifier is not too
    keen it would seam . My problem is that I am not conversant enough to understand ....

    1. Looking for rid, errors

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for rid, errors

*MORE FROM TRAP17.COM*
advertisement



Getting Rid Of Errors



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE