Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #14606

Re: newbie

From Arno Welzel <usenet@arnowelzel.de>
Newsgroups comp.lang.php
Subject Re: newbie
Date 2014-11-18 17:48 +0100
Message-ID <546B784A.6040903@arnowelzel.de> (permalink)
References <m3o3m5$pis$1@gregory.bnet.hr>

Show all headers | View raw


Am 2014-11-09 um 17:10 schrieb Haris Bogdanovich:

> I made a tic-tac-toe in Javascript, it works OK and I want it online for 
> two players. Do I have to rewrite it in PHP or use AJAX or some other way ?

Both - you need something on the server to keep track of running games
and the connected users and you also need some code to send the player
moves to the server and transmit them to the opponent.

The server could keep track of the current status of the board and using
AJAX you could refresh the board every x seconds.

If web sockets are possible, this would enable "live" playing by sending
moves directly from one client to another - but this also involves some
server side code to handle to communication between the clients. As an
example what web sockets can do:

<https://arnowelzel.de/tools/chat/>

You can open two browser windows (or two different browsers) and play
around with it - as soon as one connected visitor enters a message, all
other visitors will get this message immediatly without polling the
server all the time.

Also see: <http://socketo.me/>


-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

newbie Haris Bogdanovich <haris.bogdanovic@gmail.com> - 2014-11-09 17:10 +0100
  Re: newbie Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-09 11:46 -0500
    Re: newbie Arno Welzel <usenet@arnowelzel.de> - 2014-11-18 17:44 +0100
      Re: newbie Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-18 16:07 -0500
  Re: newbie Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-09 18:31 +0100
    Re: newbie Luuk <luuk@invalid.lan> - 2014-11-09 18:41 +0100
      Re: newbie Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-09 16:38 -0500
  Re: newbie Arno Welzel <usenet@arnowelzel.de> - 2014-11-18 17:48 +0100
    Re: newbie "Christoph M. Becker" <cmbecker69@arcor.de> - 2014-11-18 19:00 +0100
      Re: newbie Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-18 16:06 -0500
        Re: newbie Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-18 22:54 +0000
          Re: newbie Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-18 19:18 -0500
            Re: newbie Arno Welzel <usenet@arnowelzel.de> - 2014-11-19 10:12 +0100
              Re: newbie Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-19 06:37 -0500
                Re: newbie Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-11-19 12:59 +0100
                Re: newbie Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-19 10:45 -0500
                Re: newbie Arno Welzel <usenet@arnowelzel.de> - 2014-11-19 17:18 +0100
                Re: newbie Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-19 13:23 -0500
                Re: newbie Arno Welzel <usenet@arnowelzel.de> - 2014-11-20 08:19 +0100
                Re: newbie Jerry Stuckle <jstucklex@attglobal.net> - 2014-11-20 09:01 -0500
      Re: newbie Arno Welzel <usenet@arnowelzel.de> - 2014-11-19 10:11 +0100
        Re: newbie Erwin Moller <erwinmollerusenet@xs4all.nl> - 2014-11-19 15:02 +0100

csiph-web