/    Sign up×
Community /Pin to ProfileBookmark

Forbidden error comes when load increases, on core PHP based site

Hello Everyone,

I get the forbidden (access denied ) error , whenever the load increases on my PHP website.

With few number of users, the site works fine.

Could anyone suggest me some solution to eliminate this error.

There is no .htaccess in the root folder.

The page makes an AJAX call to a PHP page after every 1 second so as to update the timer. Can that be a reason for this error.

Please if anyone having any idea about this, your replies/suggestions are welcome.

Thanks

to post a comment
PHP

10 Comments(s)

Copy linkTweet thisAlerts:
@Nicholas_DiazJun 19.2013 — can u trouble shoot by removing the call to update timer and see if problem still exist?
Copy linkTweet thisAlerts:
@NogDogJun 19.2013 — Does your hosting plan have any limits on requests/data per unit of time?
Copy linkTweet thisAlerts:
@phpwebdevauthorJun 20.2013 — Thanks for replying Nicholas.

I did try to run the script after removing that code(to update timer), and the error did'nt appear.

So, currently i am searching for some solution to get the timer using client side coding so as to remove the AJAX call after 1 second.

Thanks
Copy linkTweet thisAlerts:
@phpwebdevauthorJun 20.2013 — Hello NogDog,

Do i have to check it from the server support or is there any way i can myself check it.

Thanks for replying.
Copy linkTweet thisAlerts:
@phpwebdevauthorJun 21.2013 — Hello everyone,

In order to remove the AJAX call to update timer after every one second. i tried to replace the code with onload AJAX call to fetch the session value once. and then using that time value in javascript code to show/update the timer.

It doesn't show the timer once the page is loaded but when i refresh it, it shows the timer good.

And if i put a refresh code line after fetching the AJAX response , then the refresh happens infinitely, because the AJAX call is on body onload.

Could anyone suggest some solution to this.

Thanks
Copy linkTweet thisAlerts:
@Nicholas_DiazJun 21.2013 — can you explain this timer a little better. is it literally like a clock? a count down> detailed description of what it does. pleae
Copy linkTweet thisAlerts:
@phpwebdevauthorJun 21.2013 — Sure, its a count down timer . there is an end time which is stored in the session variable (which is fetched from the database first).

so i need to fetch this value from the session once and after that i wish to use javascript to show the timer and update it.

For the very first time it doesnt show the timer but when i refresh it, it works fine.

The problem is, the javascript code doesnt get the value of session variable during the first time even when i try to fetch it using an AJAX call.

Thanks for following up.
Copy linkTweet thisAlerts:
@Nicholas_DiazJun 21.2013 — so why dont you try not using java script? add start session to the top of the page and then make a timer.php file and include it in the page your viewing. see if that fixes it all
Copy linkTweet thisAlerts:
@phpwebdevauthorJun 22.2013 — Hi,

i did try to use it

"[B]The problem is, the javascript code doesnt get the value of session variable during the first time when i try to fetch it using an AJAX call or directly[/B] "

Thanks
Copy linkTweet thisAlerts:
@phpwebdevauthorJul 02.2013 — Just want to thank you all who have helped me in reaching to the solution for this problem.

The forbidden error is resolved now.

The changes i made to the code are as below:

I reduced the calls to the server and the database to minimum. I used a javascript timer instead of using AJAX call for every second.

The sesison values which i was not getting on the same page, has been resolved by using an intermediate page in between to set the session variable first. And then on the second page simply get the value of that by using simple php. so no requirement for AJAX here.

Thanks Again
×

Success!

Help @phpwebdev spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...