Create a PHP Script Game

Reply

Join Date: Sep 2008
Posts: 173
Reputation: FlashCreations is an unknown quantity at this point 
Solved Threads: 13
FlashCreations's Avatar
FlashCreations FlashCreations is offline Offline
Junior Poster

Create a PHP Script Game

 
-1
  #1
Jul 9th, 2009
Here's how this one works. I'll start by posting one line of PHP script. The next person to post will add another line and copy the script into their post. You will simply add a line of PHP code to the script everyone wrote above you. Also don't forget to use CODE tags and try to write your line based on the code in the post above you.
The first line:
  1. session_start();
FlashCreations
(aka PhpMyCoder)

About Me | My Blog | Contact Me
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 949
Reputation: MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice MosaicFuneral is just really nice 
Solved Threads: 92
MosaicFuneral's Avatar
MosaicFuneral MosaicFuneral is offline Offline
Posting Shark

Re: Create a PHP Script Game

 
0
  #2
Jul 9th, 2009
  1. exit("I'm mean.");
Last edited by MosaicFuneral; Jul 9th, 2009 at 3:55 am.
"Jedenfalls bin ich überzeugt, daß der Alte nicht würfelt."
"I became very sensitive to what will happen to all this and all of us." -Two geniuses named Albert
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 462
Reputation: tiger86 is an unknown quantity at this point 
Solved Threads: 10
tiger86's Avatar
tiger86 tiger86 is offline Offline
Posting Pro in Training

Re: Create a PHP Script Game

 
0
  #3
Sep 25th, 2009
Originally Posted by FlashCreations View Post
Here's how this one works. I'll start by posting one line of PHP script. The next person to post will add another line and copy the script into their post. You will simply add a line of PHP code to the script everyone wrote above you. Also don't forget to use CODE tags and try to write your line based on the code in the post above you.
The first line:
  1. <?php
  2. session_start();
  3. $slugtalk = "I may not move fast but I can still slug you." ?>
is that how the game goes?
If I helped you I would appreciate it if you would give me some reputation.
read my actionscript to english blog
Currently developing what should be social network 2.0 offline.
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 173
Reputation: FlashCreations is an unknown quantity at this point 
Solved Threads: 13
FlashCreations's Avatar
FlashCreations FlashCreations is offline Offline
Junior Poster

Re: Create a PHP Script Game

 
0
  #4
Sep 25th, 2009
Sure. Everyone just adds a line...but after the second post, there really wasn't anything that could be done....but we can ignore that post:
[code=PHP]
<?php
session_start();
$slugtalk = "I may not move fast but I can still slug you.";
$slugtalk += " I'm a slug...\n";
?>
FlashCreations
(aka PhpMyCoder)

About Me | My Blog | Contact Me
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,449
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 135
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Nearly a Posting Virtuoso

Re: Create a PHP Script Game

 
0
  #5
Sep 27th, 2009
I have a few lines.
  1. <?php
  2. session_start();
  3. $slugtalk = "I may not move fast but I can still slug you.";
  4. $slugtalk.= " I'm a slug...\n";
  5. for ($i=0;$i<6;$i++) {
  6. if ($i==round($i/2)) {
  7. $slugtalk.=$slugtalk;
  8. } else {
  9. $slugtalk.="Hey, how about me!\n";
  10. $slugtalk.='Testing';
  11. for ($v=1;$v<=$i;$v++) {
  12. $slugtalk.=' '.$v;
  13. }
  14. $slugtalk.=".\n";
  15. }
  16. }
Not that they do much.
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 173
Reputation: FlashCreations is an unknown quantity at this point 
Solved Threads: 13
FlashCreations's Avatar
FlashCreations FlashCreations is offline Offline
Junior Poster

Re: Create a PHP Script Game

 
0
  #6
Sep 27th, 2009
  1. <?php
  2. session_start();
  3. $slugtalk = "I may not move fast but I can still slug you.";
  4. $slugtalk.= " I'm a slug...\n";
  5. for ($i=0;$i<6;$i++) {
  6. if ($i==round($i/2)) {
  7. $slugtalk.=$slugtalk;
  8. } else {
  9. $slugtalk.="Hey, how about me!\n";
  10. $slugtalk.='Testing';
  11. for ($v=1;$v<=$i;$v++) {
  12. $slugtalk.=' '.$v;
  13. }
  14. $slugtalk.=".\n";
  15. }
  16. }
  17.  
  18. $DB = mysql_connect("localhost", "user", "pass") or die("Slug Squashed!");
  19. mysql_select_db("someDB") or die("The slug was too slow!");
  20. mysql_query("SELECT id WHERE slug='{$slugtalk}'");
FlashCreations
(aka PhpMyCoder)

About Me | My Blog | Contact Me
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,449
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 135
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Nearly a Posting Virtuoso

Re: Create a PHP Script Game

 
0
  #7
Sep 27th, 2009
Originally Posted by FlashCreations View Post
  1. <?php
  2. session_start();
  3. $slugtalk = "I may not move fast but I can still slug you.";
  4. $slugtalk.= " I'm a slug...\n";
  5. for ($i=0;$i<6;$i++) {
  6. if ($i==round($i/2)) {
  7. $slugtalk.=$slugtalk;
  8. } else {
  9. $slugtalk.="Hey, how about me!\n";
  10. $slugtalk.='Testing';
  11. for ($v=1;$v<=$i;$v++) {
  12. $slugtalk.=' '.$v;
  13. }
  14. $slugtalk.=".\n";
  15. }
  16. }
  17.  
  18. $DB = mysql_connect("localhost", "user", "pass") or die("Slug Squashed!");
  19. mysql_select_db("someDB") or die("The slug was too slow!");
  20. mysql_query("SELECT id WHERE slug='{$slugtalk}'");
OOPS - Fatal error, better fix it:
  1. <?php
  2. session_start();
  3. $slugtalk = "I may not move fast but I can still slug you.";
  4. $slugtalk.= " I'm a slug...\n";
  5. for ($i=0;$i<6;$i++) {
  6. if ($i==round($i/2)) {
  7. $slugtalk.=$slugtalk;
  8. } else {
  9. $slugtalk.="Hey, how about me!\n";
  10. $slugtalk.='Testing';
  11. for ($v=1;$v<=$i;$v++) {
  12. $slugtalk.=' '.$v;
  13. }
  14. $slugtalk.=".\n";
  15. }
  16. }
  17.  
  18. $DB = mysql_connect("localhost", "user", "pass") or die("Slug Squashed!");
  19. mysql_select_db("someDB") or die("The slug was too slow!");
  20. mysql_query("SELECT id FROM `table` WHERE slug='".mysql_real_escape_string($slugtalk)."'");
Last edited by cwarn23; Sep 27th, 2009 at 7:24 pm.
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 173
Reputation: FlashCreations is an unknown quantity at this point 
Solved Threads: 13
FlashCreations's Avatar
FlashCreations FlashCreations is offline Offline
Junior Poster

Re: Create a PHP Script Game

 
0
  #8
Sep 27th, 2009
Alright:
  1. <?php
  2. session_start();
  3. $slugtalk = "I may not move fast but I can still slug you.";
  4. $slugtalk.= " I'm a slug...\n";
  5. for ($i=0;$i<6;$i++) {
  6. if ($i==round($i/2)) {
  7. $slugtalk.=$slugtalk;
  8. } else {
  9. $slugtalk.="Hey, how about me!\n";
  10. $slugtalk.='Testing';
  11. for ($v=1;$v<=$i;$v++) {
  12. $slugtalk.=' '.$v;
  13. }
  14. $slugtalk.=".\n";
  15. }
  16. }
  17.  
  18. $DB = mysql_connect("localhost", "user", "pass") or die("Slug Squashed!");
  19. mysql_select_db("someDB") or die("The slug was too slow!");
  20. $res = mysql_query("SELECT id FROM `table` WHERE slug='".mysql_real_escape_string($slugtalk)."'");
  21. $results = new array();
  22. while($arr = mysql_fetch_array($res))
  23. {
  24. $results[] = (int)$arr['id']+count($results);
  25. }
FlashCreations
(aka PhpMyCoder)

About Me | My Blog | Contact Me
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 1,449
Reputation: cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about cwarn23 has a spectacular aura about 
Solved Threads: 135
cwarn23's Avatar
cwarn23 cwarn23 is offline Offline
Nearly a Posting Virtuoso

Re: Create a PHP Script Game

 
0
  #9
Sep 27th, 2009
Got a few more lines
  1. <?php
  2. session_start();
  3. $slugtalk = "I may not move fast but I can still slug you.";
  4. $slugtalk.= " I'm a slug...\n";
  5. for ($i=0;$i<6;$i++) {
  6. if ($i==round($i/2)) {
  7. $slugtalk.=$slugtalk;
  8. } else {
  9. $slugtalk.="Hey, how about me!\n";
  10. $slugtalk.='Testing';
  11. for ($v=1;$v<=$i;$v++) {
  12. $slugtalk.=' '.$v;
  13. }
  14. $slugtalk.=".\n";
  15. }
  16. }
  17.  
  18. $DB = mysql_connect("localhost", "user", "pass") or die("Slug Squashed!");
  19. mysql_select_db("someDB") or die("The slug was too slow!");
  20. $res = mysql_query("SELECT id FROM `table` WHERE slug='".mysql_real_escape_string($slugtalk)."'");
  21. $results = new array();
  22. while($arr = mysql_fetch_array($res))
  23. {
  24. $results[] = (int)$arr['id']+count($results);
  25. $results[((int)$arr['id']+count($results))]=true;
  26. }
  27. if (isset($results[$_GET['i']])) {
  28. die('You won. <a href="index.php">Click here</a> to play again.');
  29. } else if (isset($_GET['i']) && !empty($_GET['i'])) {
  30. die('You lost mate. <a href="index.php">Click here</a> to loose again.');
  31. } else {
  32. echo "\n<p>".'<form method="get">Enter a number in the box below<br>';
  33. echo '<input type="text" name="i">';
  34. echo '<input type="submit" value="Guess the number"></form>';
  35. }
Last edited by cwarn23; Sep 27th, 2009 at 8:39 pm.
Try not to bump 10 year old threads as it can be really annoying.
Like php then read my website at http://syntax.cwarn23.net/
Star-Trek-Atlantis - now that's what I call a movie ^_^
My favourite PC. - MacGyver Fan
Bad english note: dis-iz-2b4u
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC