PHP 404 and 406 error while using jquery ajax - php

I'm going to be mad with this problem. It's really weird that how I can explain.
I was doing jquery GET ajax request to a php file to submit comment in my website. The weird thing is I get the following error for some comments(not all) in the response:
Not Acceptable
An appropriate representation of the requested resource /ajax.php could not be found on this server.
Additionally, a 406 Not Acceptable error was encountered while trying to use an ErrorDocument to handle the request.
The error occurs only for some comments. I get this error while I was testing in live server whether the comment system works or not and checking TTFB in chrome developer tools. In my local server with xampp everything works fine and nice.
Now it's time to say the weirdest thing. The error occurs for comment "sdfgsdfg"; I was just randomly making comments to test and I get the error for this comment.
And I get the same error for another similar comment "sdfkjlkjlsdf". I can not test all comments in the world!
But works fine for comments like "fkjlkjf", "fghsdkjfdksfgh", etc. No one's going to add a comment like "sdfgsdfg" in my website but I need to fix this as well.
One more thing is I get the same error even when I go directly to the ajax page with some comments but for other comments everything works fine. Do not say that I didn't search online for this problem and couldn't find any solution.

Related

Copy as Curl in Chrome with POST says error 302 moved temporarily

I'm trying this out in shell with Curl before developing a full app. I need to obtain information from a public site where I input in two lines of info and it returns a one-line response in the browser. When I enter in the data in chrome, then under the chrome Developer Tools under Network it shows the POST command but with status as '302 moved temporarily.' When I run the 'copy as curl' data from Curl directly in the shell I receive "This document you requested has moved temporarily.
It's now at a href="http.......
The URL its sending me to is the same except that its http instead of https. Is there any way I can use Curl for this? If not is there another tools I should be examining? I need to do this for dozens of similar sites. I can do it using human emulation commands but I'd prefer something much more stealthy that doesn't launch browser windows.
Since this hasn't been answered yet, and I got here looking for a solution to my problem which had me stumped for a good while maybe this helps someone:
I was getting a '302 moved temporarily' and re-direct to GET on the same resource trying to POST a form which had been populated for editing. I had set an email input to required, and on editing set it to disabled in the html (as the user was not allowed to change it once stored).
The problem (after much studying of the headers, which seemed fairly identical) was solved by changing the html disabled attribute to readonly. The difference this made was that the email appeared in the POST string.
Now I'm no expert on http, but as I understand it, the server must somehow have known (perhaps cache?) that the html5 boolean attribute 'required' had been set when it didn't receive the field by POST. Perhaps someone who knows can explain because it still baffles me, but anyway there's my solution.
This was on a PHP script on IIS 8 (I know, but it's for work!) although the problem had nothing to do with PHP.

500 internal server error - seen in firebug

From what I know, a 500 error means the server has problems accessing the given URL. I have a domain, let's call it domain.org, and I have a bunch of AJAX calls on this domain which used to work, but they stopped working all of a sudden this morning without my changing anything in the code.
That was weird but what is weirder, when I turned on Firebug, it keeps showing a 500 error for the URL I'm currently visiting.
So if I have the URL www.subdomain.domain.org/product.php open, it will show NetworkError: 500 Internal Server Error - http://subdomain.domain.org/product.php which is very confusing for me, since the page opens properly, all the content is there, and there are no other errors reported on the page.
So, I assume some server setting was changed - can someone tell me what this setting could be, or which configuration files to look at? The site is built on Smarty and, again, there were no 500 error yesterday, they just appeared today for no apparent reason. Should I just contact my hosting provider with this?
I know the question is broad, but I don't know how to specify it further since this goes against my understanding of this error.
This class of codes are used to indicate a server failure while processing the request. It means error in your server side coding . If everything is perfect at your coding side then please visit below link
http://www.cyberciti.biz/tips/http-error-500-internal-server-for-php-pages-and-solution.html

Why a Dojo app could be trying to retrieve files erroneously from googleapis in Firefox and not in Chrome?

I'm maintaining an old PHP app that is using Dojo. On Chrome all load well but on Firefox four "404 Not Found" error happened in a loop. The error happens while Firefox try to get the following files:
http://ajax.googleapis.com/ajax/libs/dojo/1.5.1/src/namespaces/dojo.js
http://ajax.googleapis.com/ajax/libs/dojo/1.5.1/src/namespaces.js
http://ajax.googleapis.com/ajax/libs/dojo/1.5.1/src/__package__.js
http://ajax.googleapis.com/ajax/libs/dojo/1.5.1/src.js
I said a loop because after the last error, Firefox try to get the first one again, then the second one again and so on infinitely.
What can be causing such estrange behavior?
I know that this could sound odd, but after disable the Awesome Screenshot Plus Firefox Add-On the problem disappear.
I get to this solution because beside this strange problem, I saw some request to superfish.com while accessing to the pages of this application, and that hasn't sense. Some guys over there said that such requests to superfish.com could related with the presence of some Add-On, then, I begin to disable Add-On until find out what was the problematic Add-On.
I hope this can help some body that get in my same situation.

Browser compatibility issues with PHP website

I have a website called www.kratosguide.com.
The site works as expected for approximately 90% of users, however, I have been getting a LOT of complaints recently that the page doesn't load completely in certain browsers such as chrome/firefox/opera.
Here is a screenshot that someone sent me of how the page loads: http://i.imgur.com/sqNX4.jpg
It appears that only the header and footer is loading and the content from index.php is not.
http://www.reddit.com/r/productivity/comments/w1y30/16_habits_you_should_do_everyday/
Here is a link that demonstrates a user stating the issue above -- (4th comment down).
My host is unable to replicate the issue on their end and they say it works fine. My friend kept refreshing his page cache and he could replicate the error but only intermittently.
Thanks in advance.
***EDIT: I forgot to mention the site runs on WordPress, also the site works fine for me in every browser, which makes it hard for me to see where the problem is coming from.
Check the console. You have some errors
Uncaught ReferenceError: jQuery is not defined - 068690ea.84e407.js:24
Probably caused by this script being called before the jquery library.
It's difficult to tell what is causing the error without being able to replicate it. I'd try to load it in various browsers and see if I can get it to do that. Then take a look at the console for any errors and inspect the DOM to see if the content even loads.
Yes, I still see the errors in the log.
Let me be clearer.
For me the web page loads and is visible 100%, but when I look at the console I see what is shown below. This is an indication you have a problem. My personal settings allow me to see the page but with different settings or plugins I would not be able to see the page. You need to fix your XSS error.
You can reproduce the problem yourself!
Download chrome (or firefox) and then load the page, look at the console, see the error.
Then fix it.
Original answer below
First step, fix these errors shown by chrome. Looks like you have a XSS error.
I saw over 1200 unused CSS element on your page. Try to optimize the amount of data a user has to download to see your website. I had similar issues with my site and I realized how much stuff users had to load to see my website.
I tested it under Firefox, Chrome, IE7+. I didn't get any issues.
You seems to be using WordPress so you might want to check the WordPress community for similar problem.

Zend: HTTP Error 500

I have one Zend project developed on my server (where everything works fine), but when i transferred it to production server I keep getting the Internal Server Error message and the website won't work.
What I can't understand is that the admin part (www.mysite.com/admin) works fine, but when I try to access website (www.mysite.com) it interrupts.
I know this is a really long shot, but does anyone have any suggestion where to start searching for the cause of the problem?
Up to my knowledge the 500 error is generated when the web server does not get an answer back from scripting engine in time, which would be PHP in case of Zend. It would be interesting to know if you receive this error immediately or after some time. If it takes some time your application may be hanging in a loop.

Categories