Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Php, coding games and such

  1. Nov 24, 2004 #1
    Hi, I'm a php student, or rather I'm teaching myself php with the aid of some friends and co-workers for a project which I'm planning - to create an online game made with php and sql, I was wondering 2 things

    Firstly, would anyone be able to give me any advice on what I'm likely to need to know for it?
    Secondly, can anyone suggest any decent online games that I could take a look at to get a few ideas?

    Thanks in advance for any help you can give.

  2. jcsd
  3. Nov 24, 2004 #2
    I hadn't thought that online games can be made with PHP. PHP is a dynamic web technology that downloads a different HTML page from each request. It would be another case if you combined PHP pages with an active technology like JavaScript, Java, DreamWeaver or Shockwave. I think that a combination of PHP and SQL would be appropriate for queries, browsing, guest books, forums, etc., but not for games. Consider a Java Applet.
  4. Nov 24, 2004 #3


    User Avatar
    Staff Emeritus

    Unless your making some type of text based game php is not the right language for creating an online game. You'll want to code a code in java or actionscript (flash).
  5. Nov 24, 2004 #4
    I'm pretty sure you two seem to be forgetting database driven games.

    For instance, you could have a quiz based on a databank of questions. Or a management simulation (soccer ones are popular) involving details on the database. It's actually quite a good way of doing it - having a web-based front-end written in markup and PHP is easier in my mind than making your own GUI in programming language.

    Just Googling, I've found a page of interesting links:


    Also, a Colorado-based company called VR1 were developing an online game called Lost Continents, a massive MMORPG based around SQL and C++. I think it got shelved, but it was thought it had massive potential.
  6. Nov 24, 2004 #5
    The problem with PHP for games isn't in the PHP itself - PHP has a syntax very much like C, except that the variables are not typed - they are more like perl variables.

    The problem is with the way browsers work. They have to request a refresh from the server, and every page is a fresh start - there are no variables stored by each user, unless you use cookies, or POST or GET all the variables you wish to retain whenever a user clicks on something to request a refresh.

    So for simple question and answer games, or Adventure games where there's not much in the way of graphics, or for board games like chess or othello, PHP should be fine, but for more graphically demanding games, you need Flash or Java (Java applets, not Javascript).
  7. Nov 25, 2004 #6
    After all it will depend on what game Aria wants to develop. With PHP the scope is too limited. The screen is updated with each request sent to the server, i.e. with a new HTML page. Thus text-based games or games where there is little interactivity/animation like chess or 'hang-the-duke' can be developed with PHP and a server side database like SQL.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook