Page 1 of 1
PHP expert wanted 17/01/2010 at 20:35 #556 | |
GeoffM
![]() 6347 posts |
There are a couple of PHP scripts on this website, firstly to obtain your IP address, and secondly to check whether the appropriate port is open. The former works fine; the latter doesn't. It is failing to detect an open port on a machine that I know is open - and double checking with http://www.yougetsignal.com/tools/open-ports/ confirms that the port is open. If anybody can (a) fix the problem; (b) check the PHP/HTML code; (c) tidy up, then I'd be grateful. whatsmyip.php:
portcheck.php:
Result (IP masked):
If I try www.SimSig.co.uk and port 80 then it succeeds, as you'd expect. SimSig Boss Log in to reply |
PHP expert wanted 17/01/2010 at 20:35 #5950 | |
GeoffM
![]() 6347 posts |
There are a couple of PHP scripts on this website, firstly to obtain your IP address, and secondly to check whether the appropriate port is open. The former works fine; the latter doesn't. It is failing to detect an open port on a machine that I know is open - and double checking with http://www.yougetsignal.com/tools/open-ports/ confirms that the port is open. If anybody can (a) fix the problem; (b) check the PHP/HTML code; (c) tidy up, then I'd be grateful. whatsmyip.php:
portcheck.php:
Result (IP masked):
If I try www.SimSig.co.uk and port 80 then it succeeds, as you'd expect. SimSig Boss Log in to reply |
PHP expert wanted 17/01/2010 at 22:00 #5952 | |
UKTrainMan
![]() 1803 posts |
Have you closed all tags, particularly those part of portcheck.php? Just looking at your code and unless you didn't for some reason include all bits of code, I cannot see the html tag closed with </html>. Could be just taking a rough shot here but perhaps it is the problem? If this isn't the problem then please let me know and I'll take another look. Thanks. Any views and / or opinions expressed by myself are from me personally and do not represent those of any company I either work for or am a consultant for. Log in to reply |
PHP expert wanted 17/01/2010 at 22:11 #5953 | |
Sacro
![]() 1171 posts |
Code seems fine, more likely it's your server blocking outgoing connections, looks good here. I'd add some kind of validation to your $_POST variables, that script is pretty easy to hack. Log in to reply |
PHP expert wanted 19/01/2010 at 14:01 #5973 | |
GeoffM
![]() 6347 posts |
UKTrainMan said:Just looking at your code and unless you didn't for some reason include all bits of code, I cannot see the html tag closed with </html>You're right that the PHP isn't generating the closing body/html tags, but the PHP code itself isn't working. Sacro said: Code seems fine, more likely it's your server blocking outgoing connections, looks good here.Aha, Googling for that throws up loads of results, so it does look indeed like the webhost is blocking usage of fsockopen. Sacro said: I'd add some kind of validation to your $_POST variables, that script is pretty easy to hack.Can you expand on that please? What's the worst that can happen? I know I can check that the $_POST data are IP addresses/names, and numeric for the port, but what/how can it be hacked? I'm not PHP-proficient by any means. Thanks. SimSig Boss Log in to reply |
PHP expert wanted 20/01/2010 at 05:42 #5994 | |
afro09
![]() 167 posts |
Hi Geoff, As I have mentioned to you I am currently doing a Web Design and Commputer Programming Degree, and as my finacial situation stands I can not donate to the continued success of the website financial therefore I would like to donate as much of my time as possible. First bit of advice I can give you is. If you think you are having a problem with any of your code then www.w3schools.com have a validator you can run you code through and will return any discreprencies. I will run the code above through for you but I need to know what doctype is used in the HTML code for the site i.e. strict, transitional or frameset? If I cant solve the mystery, one of my lectures is a PHP expert so I will get her to scan her eyes over the code and see if she can suggest a fix to the problem. Alan. Log in to reply |
PHP expert wanted 21/01/2010 at 15:44 #6037 | |
TylerE
![]() 149 posts |
This is almost certainly NOT doing what you want. To able to open a socket to the remote host the remote host needs to actually be listening. For instance, in the case of the SimSig ports, there would need to be a SimSig multiplayer game actually being hosted. That's why it works when you run it against the web server on port 80.
Log in to reply |
PHP expert wanted 21/01/2010 at 17:03 #6038 | |
GeoffM
![]() 6347 posts |
Afro - we know the problem; it's not with the HTML nor the PHP. Tyler - have a read through the code as your concern is already handled. SimSig Boss Log in to reply |
PHP expert wanted 21/01/2010 at 22:32 #6057 | |
Sacro
![]() 1171 posts |
Geoff - not sure on whether your code specifically can be exploited but it is not recommended to use any of the $_POST or $_GET variables without checking them first.
Log in to reply |