Got a few more lines
<?php
session_start();
$slugtalk = "I may not move fast but I can still slug you.";
$slugtalk.= " I'm a slug...\n";
for ($i=0;$i<6;$i++) {
if ($i==round($i/2)) {
$slugtalk.=$slugtalk;
} else {
$slugtalk.="Hey, how about me!\n";
$slugtalk.='Testing';
for ($v=1;$v<=$i;$v++) {
$slugtalk.=' '.$v;
}
$slugtalk.=".\n";
}
}
$DB = mysql_connect("localhost", "user", "pass") or die("Slug Squashed!");
mysql_select_db("someDB") or die("The slug was too slow!");
$res = mysql_query("SELECT id FROM `table` WHERE slug='".mysql_real_escape_string($slugtalk)."'");
$results = new array();
while($arr = mysql_fetch_array($res))
{
$results[] = (int)$arr['id']+count($results);
$results[((int)$arr['id']+count($results))]=true;
}
if (isset($results[$_GET['i']])) {
die('You won. <a href="index.php">Click here</a> to play again.');
} else if (isset($_GET['i']) && !empty($_GET['i'])) {
die('You lost mate. <a href="index.php">Click here</a> to loose again.');
} else {
echo "\n<p>".'<form method="get">Enter a number in the box below<br>';
echo '<input type="text" name="i">';
echo '<input type="submit" value="Guess the number"></form>';
}
Last edited by cwarn23; Sep 27th, 2009 at 8:39 pm.
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
Offline 3,004 posts
since Sep 2007