\ HTML5 Stock Market Simulation in PHP
| Tweet |
|
Update: Source code now available
Download the source code for this application.
HTML5 WebSocket Server in PHP
In response to the several emails I have received in the last two weeks, I have decided to take the time to post the source code for my HTML5 Stock Market simulator written in PHP. I wrote a PHP implementation of HTML5 Web Sockets, and made a simple Stock Exchange simulator application out of it with HTML5 (Javascript’s Web Socket object). While I’m at it, I’ll go ahead and post a brief explanation of what I did and how things work, so check back soon if that is of any interest to you. Here’s a link to the YouTube screen cast that I posted about it. Or if you’d like, I guess you can just watch the video right here:
The Code
For those of you who have been waiting for me to post the code for this, I apologize for the delay. Download the source code and play around with this stock simulator for yourself. I was just trying out the app a few minutes ago, and I noticed that the latest version of Chrome wasn’t connecting to the PHP server for some reason. The server recognized the connection request, and even maintained the socket opened, but the browser threw some exception. I haven’t looked into it too much due to current time constraints, so someone that finds out something about it please post. The code does work just fine in Safari, though. I have not tested it in Firefox, but I’d assume it’d work fine. If not, make sure that there’s no settings that prevent websocket connections from being established. As far as Internet Explorer 9 is concerned, I haven’t tried it either, but wouldn’t be surprised if it worked with it, too.
So there you have it. There are instructions in the zip file on how to run the application. As far as extending the app, or building different apps using the server, feel free to do whatever you want with it. Although the code was written for a networking class that I took at school, the elegance and clarity of the code was not the priority. Thus, any graphics about a CS460 class, or poor code documentation can be justified for this reason.
Leave a Reply
4 thoughts on “HTML5 Stock Market Simulation in PHP”
\ Social Media
\ Recent Posts
\ Categories
\ Popular Tags
3D
Artificial Intelligence
BYU-I
C++
C++ to Javascript port
Chromium WebGL
Debugging
demos
Discrete Math
Eclipse
Firebug
Free Download
Google Web Toolkit
GWT
HTML5 Demo
Java
Javascript Games
jQuery
Math & Programming
OBJ File
OpenGL
Papers
Parser
Plug-in
plugins
quick tip
Recurrence Relations
RokkoCode
School Projects
Screen Cast
Screencast
Sudoku
Sudoku Algorithm
The Matrix
WebGL
Web Sockets
wegbl
Writing
writting 3D (5)
Algorithms (1)
Articles (5)
BYU-I (6)
C++ (9)
Fun Projects (3)
GWT (2)
HTML5 (3)
Java (1)
Javascript (7)
PHP (1)
Web 2.0 (2)
WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

Hi,
I am very interested to learn HTML5 and javascript. I would be grateful if you could share the source code of Stock Market. I am really impressed and want to continue programming.
CU
/S.L
I would love to get the source code for this. Can you please let me know when you have it online.
Awesome work! Very nicely done. I want to implement this on my website, but i have one small problem. How do i get it to work from any other host then “localhost”. Ive tried changing $pHost in websocket.server.php and websocket.socket.php, with no success. Id just like to try this from another machine. Any suggestions? Thanks
Using Mowez Portable.. how can I run the php script .. also checked out CS460 doesnt exists usually in www folder – do we need to create it