Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Need help to get started on PHP/FTP/MySQL server

Author
Message
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 25th Apr 2016 12:05
Hello everybody.
First of all, I have to admit that I know nothing about sending/receving data between a client and a PHP/MySQL/FTP servers, let alone setting them up.

But let's say I want to make a game where the client can upload their scores to such a server, and retrieve other player's scores,
How do I go about doing that?
Do I need to buy a domain or something? What are the tools/commands that I should use?

Please post your guidance to get me started.
Thanks in advance
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 25th Apr 2016 17:24
A domain is not required, all you need to have is a VPS or a dedicated server with apache and mysql installed, and put your php script in the www directory.
FTP will only be used to move your script from your pc to the server, using softwares like FileZilla.

You must open a socket listening to a certain port on your php script, and update the scores on the database when receiving the data.
You can use the TCP sockets from Matrix1 Utils to use sockets on the DBPro side.

If you want to make some practice before to rent a server, you can download XAMPP, this software includes phpmyadmin which is useful to manage your database without having to create and edit everything with sql commands directly.

Remember that the php script on the server must be called to start, you can do that directly from your browser calling like "http://myvps.com/MyScript.php" or calling it with a cronjob.

Warning: Calling multiple times (like every 10 minutes with a cronjob) php scripts with sockets code inside may lead to memory leaks on your server, to avoid this on the cronjob call instead a "check script" that checks if the main script is alive, if not it calls it to start it. When I did my tests, RAM was decreasing by 5MB everytime I was calling the main script.
But this is a step further so it's something you should worry about later.
dcforeman
8
Years of Service
User Offline
Joined: 3rd Feb 2016
Location:
Posted: 7th May 2016 19:32 Edited at: 7th May 2016 19:33
www.digitalocean.com

great company you can setup a small virtual server for 5 bucks a month. Great for PHP work. You will need to setup the server but honestly slapping on Apache and PHP even MSQL is easy as heck. There's plenty of tutorials teaching you how to go write simple scripts that save data, sort it, store it, whatever after that just slap in a HTTP Post command into DBPro and you're laughitng. Just make sure the PHP gives a bit of data to a HTML document or txt, whatever. And you are golden.

I made an AppGameKit toolkit for this years ago, the PHP code will work just fine.

https://forum.thegamecreators.com/thread/201406
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 7th May 2016 22:57
I use digitalocean as well, they are pretty great for the price and they've also got a bunch of pre-configured images ready to spin up including a PHP, Apache, MySql stack.
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 9th May 2016 16:23
Too bad I'm bad enough to not even sure how to set up MSQL on those servers. Trying to find a free trial one with MySQL already installed, but a lot of the free ones are bugged somehow. Still searching

Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 9th May 2016 16:27
Did you rent a server? Not understanding.
[href]www.89amstudio.com[/href]
hakimfullmetal
9
Years of Service
User Offline
Joined: 17th Feb 2015
Location:
Posted: 10th May 2016 17:57
Some website offers free trial of their servers, with MySQL pre-installed. They put limitations for amount of data transfers, and storage capacities.
But somehow they all seems bugged somehow. For example, if I create a database, I can't access them. Some can't verify my accounts.
Nothing much can be done here probably. I'll keep on searching
Cescano
9
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 11th May 2016 19:50
Even if you find a trial server obviously it will be very very limited for security reasons, a VPS from OVH costs only 2.99€ per month (1 core, 2 GB RAM, 10 GB HD SSD, 100 Mbit unlimited bandwith) and if you choose OVH Release 3 in the OS tab you have everything installed, apache, mysql with phpmyadmin, antivirus etc...
www.89amstudio.com

Login to post a reply

Server time is: 2024-03-28 19:26:53
Your offset time is: 2024-03-28 19:26:53