403 - forbidden

Hi

I’m using this code in the Unity Wiki, (to write high scores to a remote MySQL database):
http://wiki.unity3d.com/index.php?title=Server_Side_Highscores

When I run the code (within my Unity project) to write a row to the database, I get an error “403 - forbidden”, and the row does NOT get written into my database. BUT, if I include a debug line to print (to the console) the HTML that is being generated and copy and paste this into the address bar of a browser, the database row gets written successfully.

The HTML that gets generated looks like this:

http://mydomain.com/highscores/addscore.php?name=Tom&score=1&hash=c28ba70be9bf46a921d8fb1c78858efe

So, the code generates working HTML, which writes successfully to my remote database, but ONLY when copied from a Print (to console) command and pasted into a browser address bar, BUT the exact same HTML does not work when executed within Unity.

Can someone help please?

Kind Regards

Jeff

After continuing research, I found that my free web space provider, does not allow writing to databases other than via a web browser, they specifically filter out non browser based access, which will include Unity, as they check the type of access, by requiring cookies.

This error indicates that the server has determined that you are not allowed access to the thing you’ve requested, either on purpose or due to a misconfiguration . It’s probably because the site owner has limited access to it and you don’t have permission to view it. The vast majority of the time, there’s not much you can do to fix things on your (*client) end. There are four common causes for 403 Forbidden error (server side) . Here they are listed from most likely to least likely:

  • An empty website directory
  • No index page
  • Incorrect settings in the .htaccess file
  • Permission / Ownership error

If authentication credentials were provided in the request, the server considers them insufficient to grant access. The client SHOULD NOT automatically repeat the request with the same credentials. The client MAY repeat the request with new or different credentials. However, a request might be forbidden for reasons unrelated to the credentials.