Jump to content
xisto Community
Sign in to follow this  
zolacat999

Text Based Online Game

Recommended Posts

Yes, you can create a text based online game using just php. However, it is not recommended. If you need to save progress then you still need to utilize some database scheme, such as MySQL.

Share this post


Link to post
Share on other sites

Pii is correct. I will now show you how to create one without mysql though.

<html><head></head><body><form action="?" method="post">Command:<input type="text" name="command2"><?phpif(isset($_SESSION['command2']) {echo '<input type="hidden" name="command3" value=".$_SESSION['command2'].">';} else if(isset($_SESSION['command3']) {echo '<input type="hidden" name="command4" value=".$_SESSION['command3'].">';}?><input type="hidden" name="go" value="1"><input type="submit"><?phpif($_POST['go'] == 1) {// begin gameecho $_SESSION['command4'];echo $_SESSION['command3'];echo $_SESSION['command2'];//put game here$_SESSION['command3'] == $_SESSION['command2'];$_SESSION['command4'] == $_SESSION['command3']; }?></form></body></html>
Hope that helped! :)
Hannah

Share this post


Link to post
Share on other sites

Unfortunately though if you want it to be attractive, have a lot more functionality and draw more players it is recommended you have a basic knowledge of html, css (not essential but definately worth learning) and mysql queries (INSERT INTO and SELECT * FROM) and also have a good working knowledge of php. A lot of people recommend javascript as well but that's really only useful for additional aesthetics and not much else.

Share this post


Link to post
Share on other sites

Just PHP no, but that is key for it though html very basic and mysql maybe some css skills will come in veery handy. Also you need your server and what not to get it online which im guessing you know :).-PinderThe

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.