www.webdeveloper.com
Results 1 to 11 of 11

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

  1. #1
    Join Date
    Jun 2013
    Posts
    7

    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

  2. #2
    Join Date
    Aug 2012
    Location
    TX
    Posts
    293
    can u trouble shoot by removing the call to update timer and see if problem still exist?

  3. #3
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,312
    Does your hosting plan have any limits on requests/data per unit of time?
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  4. #4
    Join Date
    Jun 2013
    Posts
    7
    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

  5. #5
    Join Date
    Jun 2013
    Posts
    7
    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.

  6. #6
    Join Date
    Jun 2013
    Posts
    7

    trying to use session value through AJAX call along with javascript timer

    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

  7. #7
    Join Date
    Aug 2012
    Location
    TX
    Posts
    293
    can you explain this timer a little better. is it literally like a clock? a count down> detailed description of what it does. pleae

  8. #8
    Join Date
    Jun 2013
    Posts
    7
    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.

  9. #9
    Join Date
    Aug 2012
    Location
    TX
    Posts
    293
    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

  10. #10
    Join Date
    Jun 2013
    Posts
    7
    Hi,

    i did try to use it

    "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 "

    Thanks

  11. #11
    Join Date
    Jun 2013
    Posts
    7
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles