Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Recomendations for troubleshooting

Posted on 2007-11-26
7
Medium Priority
?
393 Views
Last Modified: 2008-02-01
Recently, I have run into scripts that would not run using PHP and Ajax methodology.  Most of the scripts seem to fail silently for whatever reason.  I do not get an error in the firebug, apache or php error logs.  My question is how can I trouble shoot silent failing scripts?  Can anyone recommend any help?  
0
Comment
Question by:taynet29
  • 3
  • 3
7 Comments
 
LVL 27

Accepted Solution

by:
Cornelia Yoder earned 750 total points
ID: 20351392
Put echo statements into the script at various places, to see where it fails.

echo "Step 1 got to here<br>";

echo "Step 2 got to here<br>";

and then run them.  As you see which echo statements are executed, you can narrow down the problem.

Another thing to do is take out any @'s on mysql statements.  They block the error message from showing.
0
 
LVL 21

Assisted Solution

by:nizsmo
nizsmo earned 750 total points
ID: 20352610
Also it is good practice to echo out any variables which are returned from elsewhere, just to make sure that it actually returns something.
If you still cannot debug your script, an option may be to write a similar but much simpler version of your script and narrow down on exactly what the problem is.
0
 

Author Comment

by:taynet29
ID: 20353580
Mostly it revolves around verifying that the server's response to an XMLHTTPRequest is what you think it is. Firebug has a feature to display these response packets, but I often run the queries directly, either in a browser or from the command line. Doing it in a browser tends to work best when the response is something the browser knows how to display. If you need to test a POST request, a command line tool like curl or wget will probably be easier.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 27

Expert Comment

by:Cornelia Yoder
ID: 20354080
Thank you for the points, but could you tell me for future reference, what else should I have said/done to rate a grade of A?
0
 

Author Comment

by:taynet29
ID: 20354216
Well, I did not give you an "A" simply because it was a rather basic responses.  Not to say, you were completely off topic but I was looking for something a little more geared towards the topic of Ajax and PHP.  Perhaps, it was the question.  Next time I will be more specific.

FYI - The comment that I left, was some information my coworker provided me, which I felt was a little more towards Ajax.
0
 
LVL 27

Expert Comment

by:Cornelia Yoder
ID: 20354622
OK, thanks for the reply.  May I suggest in the future, you give a little more indication of your level of expertise or answer you are looking for.  We get a lot of very "basic" questions on here, and when the questioner sounds like someone who doesn't know where to start, "basic" answers are often best.  You did describe yourself as "Beginner on this subject". :)

Cheers.
0
 

Author Comment

by:taynet29
ID: 20358457
Thanks for your help.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question