Another Error 200

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
jbraum
-


Joined: 17 Dec 2003
Posts: 4

PostPosted: Sun Aug 29, 2004 7:22 pm    Post subject: Another Error 200 Reply with quote

I went through the forum and have a understanding what a error 200. Just need a little setting straight. The likely culprit of an Error 200 is the script???

Jbraum
Back to top View user's profile Send private message
olly86
-


Joined: 25 Apr 2003
Posts: 993
Location: Wiltshire, UK

PostPosted: Mon Aug 30, 2004 11:06 am    Post subject: Reply with quote

Error 200 means that the script executed and run correctly, however there is no result to send to the browser.
_________________
Olly
Back to top View user's profile Send private message
jbraum
-


Joined: 17 Dec 2003
Posts: 4

PostPosted: Mon Aug 30, 2004 9:43 pm    Post subject: Reply with quote

Ok. So it is more than likely the there is an error in the php code rather that the webserver causing the error???

Jbraum
Back to top View user's profile Send private message
olly86
-


Joined: 25 Apr 2003
Posts: 993
Location: Wiltshire, UK

PostPosted: Mon Aug 30, 2004 11:00 pm    Post subject: Reply with quote

no, no!!

no error has occurred, the script has been run correctly and has completed what ever task it has been programed to do, but their is no end result produced to send to the browser.

for example this script detects the browser and sets variables that are used to send the correct stylesheet, however this script alone has no result to send to the browser, it's just used as a tool for other scripts which set the stylesheet.
Quote:
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) {
$stylesheet='<link rel="stylesheet" type="text/css" media="all" href="css/ie.css">';
}
elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false) {
$stylesheet='<link rel="stylesheet" type="text/css" media="all" href="css/opera.css">';
}
elseif (strpos($_SERVER['HTTP_USER_AGENT'], 'Mozilla') !== false) {
$stylesheet='<link rel="stylesheet" type="text/css" media="all" href="css/mozilla.css">';
}
else {
$stylesheet='<link rel="stylesheet" type="text/css" media="all" href="css/style.css">';
}

_________________
Olly
Back to top View user's profile Send private message
jbraum
-


Joined: 17 Dec 2003
Posts: 4

PostPosted: Wed Sep 01, 2004 1:21 am    Post subject: Reply with quote

Ok, but what can be done to resolve the issue?

Thanks,

Jbraum
Back to top View user's profile Send private message
olly86
-


Joined: 25 Apr 2003
Posts: 993
Location: Wiltshire, UK

PostPosted: Wed Sep 01, 2004 11:06 am    Post subject: Reply with quote

just add something like:
Code:
echo("this script has run correctly");


but if the script is writing to a database it could be:
Code:
echo("the information has been successfully saved");

_________________
Olly
Back to top View user's profile Send private message
jbraum
-


Joined: 17 Dec 2003
Posts: 4

PostPosted: Fri Sep 03, 2004 4:05 am    Post subject: Reply with quote

Hmm... That didn't seem to work. Any other suggestions?

Thanks

Jbraum
Back to top View user's profile Send private message
olly86
-


Joined: 25 Apr 2003
Posts: 993
Location: Wiltshire, UK

PostPosted: Tue Sep 07, 2004 9:02 pm    Post subject: Reply with quote

sorry it's taken me a while to get back to you.

i can't think of any other method to get a browser output, however if you post the script, i might be able to work something out.
_________________
Olly
Back to top View user's profile Send private message
olle
-


Joined: 17 Apr 2004
Posts: 6

PostPosted: Thu Sep 16, 2004 4:27 am    Post subject: hmms Reply with quote

i had problem with Error 200 too :P
when i switched register_globals to ON all my problems was gone :P
i dont know if its a good thing to do, or if its a terrible mistace... but it worked :P
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Thu Sep 16, 2004 5:21 am    Post subject: Reply with quote

Alot of Error 200's are usually caused by bad coding within the PHP script.
The most common mistakes are listed below , im not saying thats all of them.

01. Forgetting a ; at the end of print or echo.

02. Forgetting a { at the end of an If () else statement

03. Forgetting to add the PHP tags <?php & ?>

04. When adding HTML , make sure you use single ' quotes , this
will gurantee that no Error 200's will show up from the HTML code.
Back to top View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group