PHP 5 Sockets with Flash 8
       by obiAdmin (raymond): 30 September 2006

In the previous page, I explained how our PHP file works. There are only a few more loose ends that need to be tied up, so let's start with running the PHP script via our command prompt on this page.

Running PHP shell by Command Prompt
A batch file is just a master file of lists of commands and/or programs that need to be executed. Of course this only pertains to MS-DOS users and Windows users. To create a Batch file, all you need is Notepad. You can even use Adobe Dreamweaver, just as long as you do not add any extra markups.


So in Notepad or Dreamweaver open a new document and copy paste this coding to it.

c:/web/php/php.exe -q c:/web/Apache2/htdocs/socketTut.php

Save this file as socketRun.bat. Notice the .bat at the end? Well that will signify that this file we wrote is a batch file. When it runs, it will automatically start up in a new Command Prompt window. Now let's take a glimpse at it.

The first part just calls on the php.exe to execute and run our socket shell script. Notice the -q again? Well it also will suppress any HTTP headers.

The next part is our location to the php shell script that php.exe needs. As you can tell you will need to alter this to your needs. Where ever your php.exe and socketShell.php is, you need to supply that into the batch file. Once that is complete it is time to check out your chat room.


Open up your command prompt (start -> run -> cmd.exe). Type in the exact location to your socketRun.bat and hit enter. Yours should look something like this:

[ it should look like its thinking... ]

From here you can go ahead and run your flash.html page. If everythings golden you should be in business! In the next page I will go over some possibilities you can achieve with what you have.

Onwards to the next page!

 


1 | 2 | 3 | 4 | 5 | 6




SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple.