Account Register page not working

risaxseph

Member
Hi,

I downloaded the register page and have put my servers information but the page continues to state that there are php errors in the code. (Mainly that its end is unexpected). Does anyone have an updated register script? Also has anyone been working on an account control panel for TETH?

An odd question but after what to do usually focus on development-wise since I am sure most servers dont stop at the very base server; advice? Thoughts?
 

Soly

Member
Which script?
Do you have any knowledge of PHP? You might be able to fix whatever is happening.

I think I uploaded a register page long ago but Idk where that is anymore.
 

risaxseph

Member
Which script?
Do you have any knowledge of PHP? You might be able to fix whatever is happening.

I think I uploaded a register page long ago but Idk where that is anymore.
I do know PHP. The code looks like everything is closed right with the needed } or ?> but it still says the file end is unexpected. I also dont like breaking other people's code; since they wrote it they know it best. Here is a link to where I got the files.

http://www.pioneer2.net/community/i...server-setup-instructions.1/page-2#post-12303
 

risaxseph

Member
Alrighty.. so is my code xD
I'll check it out.

Edit:
Fixed, updated the original post... it should be fine now.
http://www.pioneer2.net/community/index.php?attachments/registration-7z.761/
[18-Apr-2016 17:59:35 America/New_York] PHP Warning: mysqli_connect(): (HY000/2003): Can't connect to MySQL server on 'serverhost' (4) in /home/username/public_html/psocp/mysql.php on line 15
[18-Apr-2016 17:59:35 America/New_York] PHP Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, string given in /home/username/public_html/psocp/mysql.php on line 45
[18-Apr-2016 17:59:35 America/New_York] PHP Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, string given in /home/username/public_html/psocp/mysql.php on line 45
[18-Apr-2016 17:59:35 America/New_York] PHP Warning: mysqli_real_escape_string() expects parameter 1 to be mysqli, string given in /home/username/public_html/psocp/mysql.php on line 45
[18-Apr-2016 17:59:35 America/New_York] PHP Warning: mysqli_query() expects parameter 1 to be mysqli, string given in /home/username/public_html/psocp/mysql.php on line 32

Hi,

Got the above areas when creating an account. cleared out the usernames and path.
 

Soly

Member
Is "serverhost" your username or is that what you set as hostname?
I'm fairly sure "serverhost" is not a valid address.

Be sure your mysql server has an account for the php site to use.
 

risaxseph

Member
It is not; I just cleared out my dedicated servers IP as publishing that to the world is not the greatest idea. As far as mySQL; the registration page is hosted on a cPanel server and the PSO server is hosted on a Windows dedicated server.
 

Mylandra

Member
Is the sql server on the same host as the webserver?

If yes, you should instead use the loopback ip address aka 127.0.0.1
If not, is there a firewall rule setup to allow remote port access to the host?
 

Soly

Member
I just tried it myself and it worked...
Make sure as I said, that you have
  • A working account in the database server
  • A proper connection between the register page and the database (That means the right hostname, username, password, port[I didnt use port in my example], etc)
That page I coded was used in the same host as the database so I had localhost, and that seems to be your problem.
...mysqli_connect(): (HY000/2003): Can't connect to MySQL server on 'serverhost' (4) in /home/username/public_html/psocp/mysql.php on line 15...
"serverhost" is not a valid hostname.
 

risaxseph

Member
Is the sql server on the same host as the webserver?

If yes, you should instead use the loopback ip address aka 127.0.0.1
If not, is there a firewall rule setup to allow remote port access to the host?
The webserver and dedi are separate. Windows firewall is completely disabled on our Windows Server 2008 install and as for the webserver we do not have iptables set to block anything on the VM running websites. The webserver does have rather annoying security installed in PHP though (modsecurity set very high, suhosin.... I hate suhosin; too secure)
 

Mylandra

Member
First of all, I would test port 3306 (or whatever port you set mysql to if you changed it) on that windows server 2008 box from an external ip address to determine if the port is readily available to the outside world.
You can test this via putty or some online port tester website.

If it's available, you can optionally test connecting to that very same host via some odbc/mysql client tool to determine if everything else is setup correctly on that server.

After which you should be able to isolate which server the issue comes from.

By the way, once everything is setup and working, I do not recommend leaving the box open to everyone with no firewall active for security reasons. Ideally, allowing only the combination of both ip and port.
 
Last edited:

risaxseph

Member
We do have SQL open; my staff and I use MySQL Workbench and RDP on the actual server to manage everything. We figured out it has something to do with a specific mySQL user permission value and are working on fixing it. As for the firewall; 10 other games are served publicly on that box and nothing that the public can't already find is there plus our data center has its own firewalls and does not charge for bandwidth (They also mitigate DDoS attacks for us; rather nice folks). I'll post again when my staff figure our what SQL permissions value is the issue.
 

Soly

Member
I replied a while back but idk if you checked that.
Is really "serverhost" a hostname that you can use to access the server?
 

risaxseph

Member
As I explained before that is redacted so no it is not the actual address; the address was removed when I posted here for security reasons.

Also email verification is required; how do I set that up on the PSO server; it does not appear to have SMTP set up.
 

Soly

Member
Alright...

I used a GMail account with some library (Swiftmailer), but that was just a cheap method because I was not going to actually set up a public server, but still better than nothing.
I guess you can implement your own.
 

risaxseph

Member
Alright...

I used a GMail account with some library (Swiftmailer), but that was just a cheap method because I was not going to actually set up a public server, but still better than nothing.
I guess you can implement your own.
How did you go about setting that up; I mean at this point we just need something for people to be able to verify their account.
 

Soly

Member
Well.. I used the library I named earlier which lets you send a mail like
SendMail($to, $email, $content);

You have to use some google app password stuff for it to work.
 
Top