SA-MP Forums Archive
HTTP Crashing server - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: HTTP Crashing server (/showthread.php?tid=432070)



HTTP Crashing server - thefatshizms - 20.04.2013

pawn Code:
format(string, 300, "username=%s&email=%s&email_confirm=%s&new_password=%s&password_confirm=%s&pf_in_game_name=%s&qa_answer=n", PlayerName(playerid), inputtext, inputtext, PlayerInfo[playerid][Ppassword], PlayerInfo[playerid][Ppassword], PlayerName(playerid));
            HTTP(playerid, HTTP_POST, "mawebsite.com/forum/ucp.php?mode=register", string, "OnForumRegister");
Crashes the server :C


Re: HTTP Crashing server - Faisal_khan - 21.04.2013

What does the server log says?


Re: HTTP Crashing server - Ash. - 21.04.2013

I'm unsure as to whether this is related to the crash, but as far as I'm aware the function adds its parameter with a preceding question mark, so already having a pre-existing URL parameter will cause some problems.

Try this:
pawn Code:
format(string, 300, "?mode=register&username=%s&email=%s&email_confirm=%s&new_password=%s&password_confirm=%s&pf_in_game_name=%s&qa_answer=n", PlayerName(playerid), inputtext, inputtext, PlayerInfo[playerid][Ppassword], PlayerInfo[playerid][Ppassword], PlayerName(playerid));
HTTP(playerid, HTTP_POST, "mawebsite.com/forum/ucp.php", string, "OnForumRegister");
Possible PHP Issue: In "ucp.php", if it checks for "$_GET['mode'] == register" through a $_GET variable, replace $_GET with $_REQUEST and it will still work as intended.


Re: HTTP Crashing server - thefatshizms - 21.04.2013

Quote:
Originally Posted by Ash.
View Post
...
Just tried that, still crashes :/
My forum system is phpbb so I'm not sure what's in the ucp.php but i'll have a look


Re: HTTP Crashing server - Ash. - 21.04.2013

Quote:
Originally Posted by thefatshizms
View Post
Just tried that, still crashes :/
My forum system is phpbb so I'm not sure what's in the ucp.php but i'll have a look
Try printing out what 'string' becomes, it could be that it becomes too large for the 300 cell size you've given it!


Re: HTTP Crashing server - thefatshizms - 21.04.2013

I've made the size bigger, it now doesn't crash the server but doesn't sign me up on the forum


Re: HTTP Crashing server - Ash. - 21.04.2013

Quote:
Originally Posted by thefatshizms
View Post
I've made the size bigger, it now doesn't crash the server but doesn't sign me up on the forum
What data is returned from the registration page? You might need to create your own PHP script to do this for you, considering I can't imagine the PHPBB boards to be designed for this... (though, I can't say I've checked either)