I am posting here 2 wap games(1.Word Scramble n 2.Hangman). I have downloaded these from our script zone. But these game aren't working. These are here to be bugged out. Our tiger coders let's try to find the bugs and post the correct code...
Thanks.
1. Word Scramble:
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>
else if($action == "scramble")
{
addonline(getuid_sid($sid),"Playing Word Scramble","");
echo "<card id=\"main\" title=\"Word Scramble\">";
$answer = $_POST["answer"];
if (empty($_POST["answer"])) {
srand((float) microtime() * 10000000);
$input = array(
"dictionary",
"recognize",
"example",
"entertainment",
"experiment",
"appreciation",
"information",
"pronunciation",
"language",
"government",
"psychic",
"blueberry",
"selection",
"automatic",
"strawberry",
"bakery",
"shopping",
"eggplant",
"chicken",
"organic ",
"angel",
"season",
"market",
"information",
"complete",
"sunset",
"unique",
"customer"
);
$rand_keys = array_rand($input, 2);
$word = $input[$rand_keys[0]];
$Sword = str_shuffle($word);
echo "<p align=\"center\">$Sword</p>
<p align=\"center\">In the
text box below type the correct word that is scrambled above.</p>
<p align=\"center\"><input type=\"text\" name=\"answ\" size=\"20\"/>
<anchor> GO!<go href=\"games.php?action=scramble&sid=$sid\" method=\"post\">
<postfield name=\"answer\" value=\"$(answ)\"/>
<postfield name=\"correct\" value=\"$word\"/></go></anchor></p>
<p align=\"center\"><a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>
</card>";
}
else {
$answer = strtolower($answer);
if($answer == $correct){
$result = "Correct! $answer";
$uid = getuid_sid($sid);
$ugpl = mysql_fetch_array(mysql_query("SELECT gplus FROM ibwf_users WHERE id='".$uid."'"));
$ugpl = "25" + $ugpl[0];
mysql_query("UPDATE ibwf_users SET gplus='".$ugpl."' WHERE id='".$uid."'");
echo "<p align=\"center\">$result
You Have Had 25 game Plusses Added For Winning.
</p>
<p align=\"center\"><a href=\"games.php?action=scramble&sid=$sid\">Tr y Another Word?</a>
<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>
</card>";}
else { $result = "Sorry! The Correct Answer Was $correct.";
$uid = getuid_sid($sid);
$ugpl = mysql_fetch_array(mysql_query("SELECT gplus FROM ibwf_users WHERE id='".$uid."'"));
$ugpl = $ugpl[0] - "25";
mysql_query("UPDATE ibwf_users SET gplus='".$ugpl."' WHERE id='".$uid."'");
echo "<p align=\"center\">$result
You Have Had 25 game Plusses Deducted For Losing.
</p>
<p align=\"center\"><a href=\"games.php?action=scramble&sid=$sid\">Tr y Another Word?</a>
<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>
</card>";
}
}
}
</div>
2.Hangman:
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>else if($action == "hangman")
{
addonline(getuid_sid($sid),"Playing Hangman","");
echo "<card id=\"main\" title=\"Hangman\">";
if ($cat==""){
echo "<p align=\"center\">
<img src=\"../images/hang_6.gif\" alt=\"Hangman\"/>
Select a category:
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=anmls& sid=$sid\">Animals</a>
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=clrs&s id=$sid\">Colours</a>
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=comp&s id=$sid\">Computers</a>
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=frt&si d=$sid\">Fruit</a>
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=big&si d=$sid\">Big Words</a>
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=lotr&s id=$sid\">Lord Of The Rings</a>
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=mths&s id=$sid\">Months</a>
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=web&si d=$sid\">Web / Wap coding</a>
";
echo "
<a href=\"index.php?action=main&sid=$sid\">Back</a>
";
echo "</p></card></wml>";
exit();
}
if ($cat==anmls){
$category="ANIMALS";
$list = "ANIMALS
BABOON
BEAR
BULL
CAMEL
CAT
COW
CROW
DOG
DONKEY
DUCKBILL PLATYPUS
EAGLE
ELEPHANT
FISH
FOX
GIRAFFE
GOAT
GOLDFISH
HAWK
HEDGEHOG
HORSE
KANGAROO
KITTEN
MOLE
MONKEY
MOUSE
MULE
OWL
PARROT
PIG
PINK ELEPHANT
POLAR BEAR
PORCUPINE
POSSUM
PUPPY
RABBIT
RACCOON
RAT
ROBIN
SEAL
SHARK
SKUNK
SQUIRREL
STOAT
WALRUS
WEASEL
WHALE
ZEBRA";}
if ($cat==clrs){
$category="COLOURS";
$list = "BLACK
BLUE
BROWN
BUBBLEGUM PINK
COLORS
CYAN
FUCHSIA
GOLD
GREEN
GREY
INDIGO
LAVENDER
LIME GREEN
MAROON
OLIVE
ORANGE
PERIWINKLE
PINK
PURPLE
RED
ROYAL BLUE
SCARLET
TEAL
TURQUOISE
VIOLET
WHITE
YELLOW"; }
if ($cat==comp){
$category="COMPUTERS";
$list = "ACCESS
ANTI-VIRUS SOFTWARE
BASIC
CD-ROM DRIVE
CHAT
COMPUTER
CPU
DATABASE
DOS
EMAIL
EXCEL
FIREWALL
FLOPPY DRIVE
FORUMS
FRONTPAGE
GAMES
HACKER
HARD DRIVE
HTML
ICQ
INTERNET
JUNK MAIL
KEYBOARD
LINUX
LOTUS
MICROSOFT
MONITOR
MOTHER BOARD
MOUSEPAD
OPERATING SYSTEM
PARALLEL PORT
PHP
PRINTER
PUBLISHING
RAM
SERIAL PORT
SOLITARE
SPEAKERS
TECHNOLOGY
UNIX
URL
VIRUS
VISUAL BASIC
WINDOWS
WORD
WORD PROCESSING
WORLD WIDE WEB
ZIP"; }
if ($cat==frt){
$category="FRUIT";
$list = "APPLE
BANANA
BLACKBERRY
BLUEBERRY
FRUIT
GRAPE
GRAPEFRUIT
KIWI
MANGO
ORANGE
PEACH
PEAR
RASBERRY
STRAWBERRY
TANGERINE
TOMATO
UGLY FRUIT"; }
if ($cat==big){
$category="BIG WORDS";
$list = "AUSTRALOPITHECINE
DEOXYRIBONUCLEIC ACID
LARGE WORDS
MITOCHONDRIA"; }
if ($cat==lotr){
$category="LORD OF THE RINGS";
$list = "AGORNATH
ARAGORN
ARWEN
BAG END
BALIN
BALROG
BARROW DOWNS
BARROW WRIGHT
BEREN
BILBO BAGGINS
BLACK RIDERS
BOROMIR
BREE
BUCKLAND
CELEBORN
DEAD MARSHES
DWARVES
EDORAS
ELENDIL
ELFSTONE
ELROND
ELVES
ENTS
EOWYN
FANGORN FOREST
FARAMIR
FRODO BAGGINS
GALADRIEL
GANDALF
GILGALAD
GLAMDRING
GLORFINDEL
GOLDBERRY
GOLLUM
GONDOR
HALDIR
HELMS DEEP
HOBBITON
HOBBITS
ISENGARD
ISILDUR
LEGOLAS
LEMBAS BREAD
LONELY MOUNTAIN
LONELY MOUNTIAN
LORD OF THE RINGS
LOTHLORIEN
LUTHIEN
MELKOR
MEN
MERRY
MIDDLE EARTH
MINAS MORGUL
MINAS TIRITH
MIRKWOOD
MITHRANDIR
MITHRIL
MORDOR
MORIA
MT. DOOM
MY PRECIOUSSS
NAZGUL
NUMENOR
OLD FOREST
OLD MAN WILLOW
ORCS
ORTHANC
PIPE WEED
PIPPIN
PLAINTIR
RANGERS
RINGWRAITHS
RIVENDELL
ROHAN
SAMWISE GAMGEE
SARUMAN
SAURON
SHADOWFAX
SHAGRAT
SHELOB
SHIRE
SILMARILLIAN
SMAUG
SMEAGOL
STEWARD OF GONDOR
STING
STRIDER
THE FELLOWSHIP OF THE RING
THE RETURN OF THE KING
THE RING
THE TWO TOWERS
THEODIN
TOM BOMBADIL
TREEBEARD
TROLLS
UNDYING LANDS
URUK-HAI
VALINOR
WARG RIDERS
WEATHERTOP
WIZARDS
WORMTONGUE";}
if ($cat==mths){
$category="MONTHS";
$list = "APRIL
AUGUST
DECEMBER
FEBRUARY
JANUARY
JULY
JUNE
MARCH
MAY
MONTHS
NOVEMBER
OCTOBER
SEPTEMBER"; }
if ($cat==web){
$category="WEB / WAP CODING";
$list = "JAVA BEANS
PHP SCRIPTS
SOURCE CODE
JAVASCRIPT GAMES
SSI IS SERVER SIDE INCLUDES
BILL GATES
COOKIES
HTTP AUTHENTICATION
ERROR HANDLING
MANIPULATING IMAGES
FILE UPLOADS
DATABASE / CONNECTION
APACHE SERVER
ZIP FILE
TAR COMPRESSION
FUNCTIONS
ENCRYPTION
MYSQL DATABASE
INITIALIZATION
FAQ - FREQUENTLY ASKED QUESTIONS
DEBUGGING
VERIFICATION
HTML VALIDATION
CASCADING STYLE SHEETS";}
# below ($alpha) is the alphabet letters to guess from.
# you can add international (non-English) letters, in any order, such as in:
# $alpha = "????????????????????????????ABCDEFGHIJKLMNOPQRSTU VWXYZ";
$alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
# below ($additional_letters) are extra characters given in words; '?' does not work
# these characters are automatically filled in if in the word/phrase to guess
$additional_letters = " -.,;!?%& 0123456789/";
#========= do not edit below here ================================================== ====
$sid = $_GET["sid"];
$uid = getuid_sid($sid);
$len_alpha = strlen($alpha);
if(isset($_GET["n"])) $n=$_GET["n"];
if(isset($_GET["letters"])) $letters=$_GET["letters"];
if(!isset($letters)) $letters="";
if(isset($PHP_SELF)) $self=$PHP_SELF;
else $self=$_SERVER["PHP_SELF"];
$links="";
$max=6;
# error_reporting(0);
$list = strtoupper($list);
$words = explode("\n",$list);
srand ((double)microtime()*1000000);
$all_letters=$letters.$additional_letters;
$wrong = 0;
echo "<p align=\"center\">";
if (!isset($n)) { $n = rand(1,count($words)) - 1; }
$word_line="";
$word = trim($words[$n]);
$done = 1;
for ($x=0; $x < strlen($word); $x++)
{
if (strstr($all_letters, $word[$x]))
{
if ($word[$x]==" ") $word_line.=" / "; else $word_line.=$word[$x];
}
else { $word_line.="_ "; $done = 0; }
}
if (!$done)
{
for ($c=0; $c<$len_alpha; $c++)
{
if (strstr($letters, $alpha[$c]))
{
if (strstr($words[$n], $alpha[$c])) {$links .= "$alpha[$c] "; }
else { $links .= " $alpha[$c] "; $wrong++; }
}
else
{ $links .= " <a href=\"$self?action=hangman&cat=$cat&lette rs=$alpha[$c]$letters&n=$n&sid=$sid\">$alpha[$c]</a> "; }
}
$nwrong=$wrong; if ($nwrong>6) $nwrong=6;
echo "
<img src=\"../images/hang_$nwrong.gif\" alt=\"Wrong: $wrong out of $max\"/>
";
if ($wrong >= $max)
{
$n++;
if ($n>(count($words)-1)) $n=0;
echo "
$word_line";
echo "
<big>SORRY, YOU ARE HANGED!!!</big>
";
if (strstr($word, " ")) $term="answer"; else $term="word";
echo "The $term was \"$word\"
";
$sqlfetch=mysql_query("SELECT gplus FROM ibwf_users WHERE id='".$uid."'");
$sqlfet=mysql_fetch_array($sqlfetch);
$gplusnew=$sqlfet[0] - "25";
$sql="UPDATE ibwf_users SET gplus='".$gplusnew."' WHERE id='".$uid."'";
$res=mysql_query($sql);
echo "You Have Had 25 game Plusses Deducted For Losing.
";
echo "<a href=\"$self?action=hangman&cat=$cat&n=$n& amp;sid=$sid\">Play again</a>
";
echo "<a href=\"$self?action=hangman&sid=$sid\">Change category</a>";
}else{
echo " Wrong Guesses Left: ".($max-$wrong)."
";
echo "$word_line";
echo "
Choose a letter:
";
echo "$links";
}
}else{
$n++; # get next word
if ($n>(count($words)-1)) $n=0;
echo "
\n$word_line";
echo "
Congratulations!!! You win!!!
";
$sqlfetch=mysql_query("SELECT gplus FROM ibwf_users WHERE id='".$uid."'");
$sqlfet=mysql_fetch_array($sqlfetch);
$gplusnew=$sqlfet[0] + "25";
$sql="UPDATE ibwf_users SET gplus='".$gplusnew."' WHERE id='".$uid."'";
$res=mysql_query($sql);
echo "You Have Had 25 game Plusses Added For Winning.
";
echo "<a href=\"$self?action=hangman&cat=$cat&n=$n& amp;sid=$sid\">Play again</a>
";
echo "<a href=\"$self?action=hangman&sid=$sid\">Change category</a>";
}
echo "
<a href=\"index.php?action=main&sid=$sid\">Back</a>";
echo "</p></card>";
}
else
{
addonline(getuid_sid($sid),"Lost in Games lol","");
echo "<card id=\"main\" title=\"Games(error)\">";
echo "<p align=\"center\">";
echo "I don't know how did you get into here, but there's nothing to show
";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p></card>";
}
</div>
Thanks.
1. Word Scramble:
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>
else if($action == "scramble")
{
addonline(getuid_sid($sid),"Playing Word Scramble","");
echo "<card id=\"main\" title=\"Word Scramble\">";
$answer = $_POST["answer"];
if (empty($_POST["answer"])) {
srand((float) microtime() * 10000000);
$input = array(
"dictionary",
"recognize",
"example",
"entertainment",
"experiment",
"appreciation",
"information",
"pronunciation",
"language",
"government",
"psychic",
"blueberry",
"selection",
"automatic",
"strawberry",
"bakery",
"shopping",
"eggplant",
"chicken",
"organic ",
"angel",
"season",
"market",
"information",
"complete",
"sunset",
"unique",
"customer"
);
$rand_keys = array_rand($input, 2);
$word = $input[$rand_keys[0]];
$Sword = str_shuffle($word);
echo "<p align=\"center\">$Sword</p>
<p align=\"center\">In the
text box below type the correct word that is scrambled above.</p>
<p align=\"center\"><input type=\"text\" name=\"answ\" size=\"20\"/>
<anchor> GO!<go href=\"games.php?action=scramble&sid=$sid\" method=\"post\">
<postfield name=\"answer\" value=\"$(answ)\"/>
<postfield name=\"correct\" value=\"$word\"/></go></anchor></p>
<p align=\"center\"><a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>
</card>";
}
else {
$answer = strtolower($answer);
if($answer == $correct){
$result = "Correct! $answer";
$uid = getuid_sid($sid);
$ugpl = mysql_fetch_array(mysql_query("SELECT gplus FROM ibwf_users WHERE id='".$uid."'"));
$ugpl = "25" + $ugpl[0];
mysql_query("UPDATE ibwf_users SET gplus='".$ugpl."' WHERE id='".$uid."'");
echo "<p align=\"center\">$result
You Have Had 25 game Plusses Added For Winning.
</p>
<p align=\"center\"><a href=\"games.php?action=scramble&sid=$sid\">Tr y Another Word?</a>
<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>
</card>";}
else { $result = "Sorry! The Correct Answer Was $correct.";
$uid = getuid_sid($sid);
$ugpl = mysql_fetch_array(mysql_query("SELECT gplus FROM ibwf_users WHERE id='".$uid."'"));
$ugpl = $ugpl[0] - "25";
mysql_query("UPDATE ibwf_users SET gplus='".$ugpl."' WHERE id='".$uid."'");
echo "<p align=\"center\">$result
You Have Had 25 game Plusses Deducted For Losing.
</p>
<p align=\"center\"><a href=\"games.php?action=scramble&sid=$sid\">Tr y Another Word?</a>
<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a></p>
</card>";
}
}
}
</div>
2.Hangman:
<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>else if($action == "hangman")
{
addonline(getuid_sid($sid),"Playing Hangman","");
echo "<card id=\"main\" title=\"Hangman\">";
if ($cat==""){
echo "<p align=\"center\">
<img src=\"../images/hang_6.gif\" alt=\"Hangman\"/>
Select a category:
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=anmls& sid=$sid\">Animals</a>
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=clrs&s id=$sid\">Colours</a>
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=comp&s id=$sid\">Computers</a>
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=frt&si d=$sid\">Fruit</a>
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=big&si d=$sid\">Big Words</a>
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=lotr&s id=$sid\">Lord Of The Rings</a>
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=mths&s id=$sid\">Months</a>
";
echo "<a href=\"$PHP_SELF?action=hangman&cat=web&si d=$sid\">Web / Wap coding</a>
";
echo "
<a href=\"index.php?action=main&sid=$sid\">Back</a>
";
echo "</p></card></wml>";
exit();
}
if ($cat==anmls){
$category="ANIMALS";
$list = "ANIMALS
BABOON
BEAR
BULL
CAMEL
CAT
COW
CROW
DOG
DONKEY
DUCKBILL PLATYPUS
EAGLE
ELEPHANT
FISH
FOX
GIRAFFE
GOAT
GOLDFISH
HAWK
HEDGEHOG
HORSE
KANGAROO
KITTEN
MOLE
MONKEY
MOUSE
MULE
OWL
PARROT
PIG
PINK ELEPHANT
POLAR BEAR
PORCUPINE
POSSUM
PUPPY
RABBIT
RACCOON
RAT
ROBIN
SEAL
SHARK
SKUNK
SQUIRREL
STOAT
WALRUS
WEASEL
WHALE
ZEBRA";}
if ($cat==clrs){
$category="COLOURS";
$list = "BLACK
BLUE
BROWN
BUBBLEGUM PINK
COLORS
CYAN
FUCHSIA
GOLD
GREEN
GREY
INDIGO
LAVENDER
LIME GREEN
MAROON
OLIVE
ORANGE
PERIWINKLE
PINK
PURPLE
RED
ROYAL BLUE
SCARLET
TEAL
TURQUOISE
VIOLET
WHITE
YELLOW"; }
if ($cat==comp){
$category="COMPUTERS";
$list = "ACCESS
ANTI-VIRUS SOFTWARE
BASIC
CD-ROM DRIVE
CHAT
COMPUTER
CPU
DATABASE
DOS
EXCEL
FIREWALL
FLOPPY DRIVE
FORUMS
FRONTPAGE
GAMES
HACKER
HARD DRIVE
HTML
ICQ
INTERNET
JUNK MAIL
KEYBOARD
LINUX
LOTUS
MICROSOFT
MONITOR
MOTHER BOARD
MOUSEPAD
OPERATING SYSTEM
PARALLEL PORT
PHP
PRINTER
PUBLISHING
RAM
SERIAL PORT
SOLITARE
SPEAKERS
TECHNOLOGY
UNIX
URL
VIRUS
VISUAL BASIC
WINDOWS
WORD
WORD PROCESSING
WORLD WIDE WEB
ZIP"; }
if ($cat==frt){
$category="FRUIT";
$list = "APPLE
BANANA
BLACKBERRY
BLUEBERRY
FRUIT
GRAPE
GRAPEFRUIT
KIWI
MANGO
ORANGE
PEACH
PEAR
RASBERRY
STRAWBERRY
TANGERINE
TOMATO
UGLY FRUIT"; }
if ($cat==big){
$category="BIG WORDS";
$list = "AUSTRALOPITHECINE
DEOXYRIBONUCLEIC ACID
LARGE WORDS
MITOCHONDRIA"; }
if ($cat==lotr){
$category="LORD OF THE RINGS";
$list = "AGORNATH
ARAGORN
ARWEN
BAG END
BALIN
BALROG
BARROW DOWNS
BARROW WRIGHT
BEREN
BILBO BAGGINS
BLACK RIDERS
BOROMIR
BREE
BUCKLAND
CELEBORN
DEAD MARSHES
DWARVES
EDORAS
ELENDIL
ELFSTONE
ELROND
ELVES
ENTS
EOWYN
FANGORN FOREST
FARAMIR
FRODO BAGGINS
GALADRIEL
GANDALF
GILGALAD
GLAMDRING
GLORFINDEL
GOLDBERRY
GOLLUM
GONDOR
HALDIR
HELMS DEEP
HOBBITON
HOBBITS
ISENGARD
ISILDUR
LEGOLAS
LEMBAS BREAD
LONELY MOUNTAIN
LONELY MOUNTIAN
LORD OF THE RINGS
LOTHLORIEN
LUTHIEN
MELKOR
MEN
MERRY
MIDDLE EARTH
MINAS MORGUL
MINAS TIRITH
MIRKWOOD
MITHRANDIR
MITHRIL
MORDOR
MORIA
MT. DOOM
MY PRECIOUSSS
NAZGUL
NUMENOR
OLD FOREST
OLD MAN WILLOW
ORCS
ORTHANC
PIPE WEED
PIPPIN
PLAINTIR
RANGERS
RINGWRAITHS
RIVENDELL
ROHAN
SAMWISE GAMGEE
SARUMAN
SAURON
SHADOWFAX
SHAGRAT
SHELOB
SHIRE
SILMARILLIAN
SMAUG
SMEAGOL
STEWARD OF GONDOR
STING
STRIDER
THE FELLOWSHIP OF THE RING
THE RETURN OF THE KING
THE RING
THE TWO TOWERS
THEODIN
TOM BOMBADIL
TREEBEARD
TROLLS
UNDYING LANDS
URUK-HAI
VALINOR
WARG RIDERS
WEATHERTOP
WIZARDS
WORMTONGUE";}
if ($cat==mths){
$category="MONTHS";
$list = "APRIL
AUGUST
DECEMBER
FEBRUARY
JANUARY
JULY
JUNE
MARCH
MAY
MONTHS
NOVEMBER
OCTOBER
SEPTEMBER"; }
if ($cat==web){
$category="WEB / WAP CODING";
$list = "JAVA BEANS
PHP SCRIPTS
SOURCE CODE
JAVASCRIPT GAMES
SSI IS SERVER SIDE INCLUDES
BILL GATES
COOKIES
HTTP AUTHENTICATION
ERROR HANDLING
MANIPULATING IMAGES
FILE UPLOADS
DATABASE / CONNECTION
APACHE SERVER
ZIP FILE
TAR COMPRESSION
FUNCTIONS
ENCRYPTION
MYSQL DATABASE
INITIALIZATION
FAQ - FREQUENTLY ASKED QUESTIONS
DEBUGGING
VERIFICATION
HTML VALIDATION
CASCADING STYLE SHEETS";}
# below ($alpha) is the alphabet letters to guess from.
# you can add international (non-English) letters, in any order, such as in:
# $alpha = "????????????????????????????ABCDEFGHIJKLMNOPQRSTU VWXYZ";
$alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
# below ($additional_letters) are extra characters given in words; '?' does not work
# these characters are automatically filled in if in the word/phrase to guess
$additional_letters = " -.,;!?%& 0123456789/";
#========= do not edit below here ================================================== ====
$sid = $_GET["sid"];
$uid = getuid_sid($sid);
$len_alpha = strlen($alpha);
if(isset($_GET["n"])) $n=$_GET["n"];
if(isset($_GET["letters"])) $letters=$_GET["letters"];
if(!isset($letters)) $letters="";
if(isset($PHP_SELF)) $self=$PHP_SELF;
else $self=$_SERVER["PHP_SELF"];
$links="";
$max=6;
# error_reporting(0);
$list = strtoupper($list);
$words = explode("\n",$list);
srand ((double)microtime()*1000000);
$all_letters=$letters.$additional_letters;
$wrong = 0;
echo "<p align=\"center\">";
if (!isset($n)) { $n = rand(1,count($words)) - 1; }
$word_line="";
$word = trim($words[$n]);
$done = 1;
for ($x=0; $x < strlen($word); $x++)
{
if (strstr($all_letters, $word[$x]))
{
if ($word[$x]==" ") $word_line.=" / "; else $word_line.=$word[$x];
}
else { $word_line.="_ "; $done = 0; }
}
if (!$done)
{
for ($c=0; $c<$len_alpha; $c++)
{
if (strstr($letters, $alpha[$c]))
{
if (strstr($words[$n], $alpha[$c])) {$links .= "$alpha[$c] "; }
else { $links .= " $alpha[$c] "; $wrong++; }
}
else
{ $links .= " <a href=\"$self?action=hangman&cat=$cat&lette rs=$alpha[$c]$letters&n=$n&sid=$sid\">$alpha[$c]</a> "; }
}
$nwrong=$wrong; if ($nwrong>6) $nwrong=6;
echo "
<img src=\"../images/hang_$nwrong.gif\" alt=\"Wrong: $wrong out of $max\"/>
";
if ($wrong >= $max)
{
$n++;
if ($n>(count($words)-1)) $n=0;
echo "
$word_line";
echo "
<big>SORRY, YOU ARE HANGED!!!</big>
";
if (strstr($word, " ")) $term="answer"; else $term="word";
echo "The $term was \"$word\"
";
$sqlfetch=mysql_query("SELECT gplus FROM ibwf_users WHERE id='".$uid."'");
$sqlfet=mysql_fetch_array($sqlfetch);
$gplusnew=$sqlfet[0] - "25";
$sql="UPDATE ibwf_users SET gplus='".$gplusnew."' WHERE id='".$uid."'";
$res=mysql_query($sql);
echo "You Have Had 25 game Plusses Deducted For Losing.
";
echo "<a href=\"$self?action=hangman&cat=$cat&n=$n& amp;sid=$sid\">Play again</a>
";
echo "<a href=\"$self?action=hangman&sid=$sid\">Change category</a>";
}else{
echo " Wrong Guesses Left: ".($max-$wrong)."
";
echo "$word_line";
echo "
Choose a letter:
";
echo "$links";
}
}else{
$n++; # get next word
if ($n>(count($words)-1)) $n=0;
echo "
\n$word_line";
echo "
Congratulations!!! You win!!!
";
$sqlfetch=mysql_query("SELECT gplus FROM ibwf_users WHERE id='".$uid."'");
$sqlfet=mysql_fetch_array($sqlfetch);
$gplusnew=$sqlfet[0] + "25";
$sql="UPDATE ibwf_users SET gplus='".$gplusnew."' WHERE id='".$uid."'";
$res=mysql_query($sql);
echo "You Have Had 25 game Plusses Added For Winning.
";
echo "<a href=\"$self?action=hangman&cat=$cat&n=$n& amp;sid=$sid\">Play again</a>
";
echo "<a href=\"$self?action=hangman&sid=$sid\">Change category</a>";
}
echo "
<a href=\"index.php?action=main&sid=$sid\">Back</a>";
echo "</p></card>";
}
else
{
addonline(getuid_sid($sid),"Lost in Games lol","");
echo "<card id=\"main\" title=\"Games(error)\">";
echo "<p align=\"center\">";
echo "I don't know how did you get into here, but there's nothing to show
";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p></card>";
}
</div>
Comment