Jul 27, 2008

Getting Rid Of Errors

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

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.
Confirm Code:

Similar Topics

Keywords : rid, errors

  1. Fopen Errors :(
    grrr, i'm angry :( (6)
  2. 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']); @....
  3. 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....
  4. 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....
  5. Getting Errors On A Script
    need to know what im doing wrong (3)
    ok please help me!! im trying to get this tournamt/leage ladder script working, its with php
    but i think i put all the files in the right palces but i keep getting this error .... CODE
    Warning: main(modules/NukeLadder/admin/index.php): failed to open stream: No
    such file or directory in /home/berkolli/public_html/DjLuki/admin/case/case.php on line 77
    Warning: main(modules/NukeLadder/admin/index.php): failed to open stream: No
    such file or directory in /home/berkolli/public_html/DjLuki/admin/case/case.php on line 77 W....
  6. Problem With Headers
    setcookie errors (5)
    I'm having troubles with my authentication function, if the the users uses wrong login info, it
    works like a charm, but it gives me errors when i set the cookies, so help would be appreciated...
    CODE Function auth(){ $user=$_POST['username'];
    $pass=$_POST['password']; $qry="SELECT id from Solarity where
    username='$user' and password='$pass'";
    $result=mysql_query($qry) or die("A problem occured during authentication
    process"); $....
  7. Mysql Errors
    cant find whats wrong :( (3)
    I am working on my guestbook, better to say I am transfuring it from old to new site, but I got some
    errors now I did not had at my old hoster and I cannot figure out whats wrong: CODE
    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in
    /home/pbrugge/public_html/guest.php on line 104 Warning: mysql_fetch_array():
    supplied argument is not a valid MySQL result resource in /home/pbrugge/public_html/guest.php on
    line 110 This is the complete relevant code perhaps I overlooked something but I keep ove....

    1. Looking for rid, errors

Searching Video's for rid, errors
advertisement



Getting Rid Of Errors



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
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