Jump to content

lukeprice

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lukeprice's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Is there a document.get.elementbyid equivalent in php, also, is there any way of delaying script execution without hanging the browser?
  2. Hi, I am currently attempting to develop an online game. I have so far achieved the results I want using JavaScript but have now been informed it would be easy to cheat because JavaScript is client side. So I have now began attempting to achieve the same results using PHP. Ive started trying to rescript the countdown timer but can't seem to get a satisfactory alternative to setTimeout (in JS). I have tried sleep() and usleep() but i'm either using them incorrectly or they won't do what I need. The link to what the 'game' (in inverted commas because its far from that yet) should be like (in JS) is here: [url=http://www.bibliocommerce.com/test/chop_wood.php]http://www.bibliocommerce.com/test/chop_wood.php[/url] The code for the alternative countdown timer I have been working on is here but it will not work, it keeps reposting the same values. Like I said I tried using sleep(), but then the page doesn't even load! Here is the code: [code]PHP Code: <?php function display(){ $milisec = 0; $seconds = 5; $milisec -= 1; if ($milisec <= -1){     $milisec = 9;     $seconds -= 1;     } do { echo $seconds.".".$milisec; } while ($milisec > 0 && $seconds > 0);       } display(); ?> [/code] And a link to a working version here: [url=http://www.bibliocommerce.com/test/php_function.php]http://www.bibliocommerce.com/test/php_function.php[/url] WARNING: Don't visit the link if you don't want your browser to crash! It might not, but then again... I just need some way to pause the script for a second then execute it again, then pause, then execute and so on... Thank you in advance.
  3. Ok, thankyou. I think I need to do a few more tutorials before I attempt this then. Can anyone suggest any tutorials that are either focused on scripting for online gaming or would be useful in this area in the long run. My idea is to setup a simple text based browser game to learn a bit more about PHP, MySQL and have a bit of fun at the same time. I was thinking of something along the lines of this script, probably makes no sense though... lol: [code]<?php   $a = $_REQUEST['d2'] ; while ($a < 0.1)   header ("Location: http://localhost/offline/index.html") ;     ?>[/code] d2 is a form field containing a JavaScript counter so a can grab the integer from there and check it using the REQUEST and if its below 0.1 I refresh the page, but it only works when you press submit :(. NOTE: An example of the timer setup im looking for can be seen on the MMORPG Syrnia, if anyone has an account there, if you dont its pretty good ;)
  4. I dont know anything about AJAX but if thats the only way of doing I suppose i'll have to learn :), ty Also, the script needs to update the current page
  5. Hi, Im totally new to PHP. Im pretty sure this can be done (someone suggested sleep() function but the timer needs to be real time and visible so I think it will have to be a javascript timer) but I don't know what the best way of doing it would be. I can get the JS timer in a form field the integer in that field to do certain things with PHP when you press submit but I want it to be automatic. Countdown goes from 20 --> 0 and on 0 PHP script executes (reloads page or whatever). Any help appreciated. Thanks in advance.
  6. Thank you for the quick reply, I thought I might be chasing a red herring but I suppose thats what 80% of research is
  7. I have a brief from a dentist client who has asked me to research the possibility of automating the following scenario: 1. He speaks into a lapel mike which renders the data into text on word processing software or spreadsheet etc. 2. A programme (PHP based?) searches the text for key words which will be prompts for the same software to perform actions (open sub-categories etc. within the word processor/spreadsheet) 3. Once the checkup is complete the dentist speaks a prompt word and the software (PHP?) sends the information gathered to Excel or similar, where a copy then gets printed and emailed to the client Is this possible with PHP, I know voice recognition software is widely available and poses no problems. I am struggling to understand wether a PHP based application could work as the search facility, prompt and bridge between the different applications etc. ? Do I need to find another solution or could this be done? Thank you in advance.
×
×
  • Create New...

Important Information

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.