Back to Problem Solutions forum
I'm trying to make a request with javascript:
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://codeabbey.sourceforge.net/say-100.php');
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
var token = 'token=' + input();
xhr.send(token);
xhr.onreadystatechange = function() {
console.log(xhr);
};
But I receive CORS error. How can I fix it?
http://codeabbey-games.atwebpages.com/GAME-NAME.php DOES NOT work
Yurko, Hi!
Hopefully that hosting account is re-activated now, sorry for inconvenience. Please try it and tell if anything else is missing.
Thanks a lot for your alert - it is really very lucky you noticed this before they deleted files! I read now their rules that I just need login at least once a year into their control panel. Should invent interactive problems more often, perhaps.
I'm also having an issue with this problem, but I'm not seeing "CORS" anywhere. Hopefully I'm not bumping a possibly irrelevant thread (is that still called "necroposting"?).
Anyways, I've managed to get python running locally on my computer through the windows cmd prompt and also able to install the httplib2 module. But when running the sample code provided by the relevant wiki page...
import httplib2
data = "token: abcdefghijklmnopqrstuvwx\n"
http = httplib2.Http()
response, content = http.request("http://codeabbey.sourceforge.net/say-100.php", "POST", data)
print('Status: ' + response['status'])
print(content)
Firstly I was getting errors because I was pasting this code directly instead of noticing that the url domain has changed from sourceforge.net
to atwebpages.com
, maybe we want to update that in the wiki page :)
But now with the correct domain, I'm getting error status 530, and then an HTML response of the page. Judging from the content of the HTML, and also that google says "The 530 HTTP Status Code means that the site is frozen indicates that a site has been frozen due to inactivity", it looks like the page has expired...
I did see in a previous post that apparently the site shuts down if not logged into for a year, and that post was dated early April 2023... Maybe relevant?
Kevin, Hi!
Sorry for confusion, the sourceforge.net
version stopped working long ago and codeabbey.atwebpages.com
is not releveant
to interactive problems (and anyway has expired long ago).
The working root address (mentioned in the instruction) should be this:
http://codeabbey-games.atwebpages.com/
I'll go and fix it in example right now...
P.S. not sure if httplib2
is not deprecated yet. Python evolves and seems to change the preferred built-in module for
http every few years.