Our Scripts Vault contains many game scripts that you can use to create your own game!
<?phpfunction filter ($text){$filtered = preg_replace(array('/\s\s+/','/=/','/</','/>/',), '', $text);return $filtered;}?>
$result = mysql_query ("SELECT * FROM users WHERE name = '$user' AND pass = '$pass'")
if (mysql_numrows($result) != 1) { header('Location: ./index.php?error=1');}
<?phpif(isset($_GET['error'])) {echo "bravo! you managed to input wrong password/user name";}?>
When logically is to be expected only 1 result, insert "LIMIT 1" at the end of query, otherwise MySQL will continue searching for another rows even though it already has your data and won't find any afterwards
I can send you pics of my cocks if you want reference.
I knew it, i knew it, and I KNEW it.One may think PHP is enough alone to make a decent game.Well, got bad news. It is not.What I have so far is a decent login script, checks for cookies, or submitted data, uses my patented filter technology (-don't try that if you have other methods-) but since its turn based game, something has just gotta move the game world.On the server side it is not a problem.I chosen an endless loop setup. Efficiency is not a problem, total of 2 (two) user has ever been logged in. (for what reason some visits a dead empty page, i don't know but if they think its fun them let them have it.)Would be quite idiotic to have a browser open on the server just to open the endless loop file.It would make around absolute no sense at all.I em not familiar with other language then php. Could use C, or something else, but why bother with it.I have THIS:http://www.bambalam.se/bamcompile/oo Yes, You got it, it is going to convert the server side PHP script to a nice EXE file I can start anytime.Great.but..Comes the question, hows i should supposed to make the CLIENT side update when the tick is over?http://www.quackit.com/javascript/javascript_refresh_page.cfmThats the answer.Javascript. (I don't remember why, but i hate it as it is.. But no other solution i have in my mind.)So, our main page has a timed self refresh.Our server side has a timed self refresh too.A bit of brain work, and the 2 will work towards Victory.What will happen is:Endless loop will update things from the event table. Client will refresh page.The problem is, it may happen poor client is already refreshing, while the server did not had time to finish yet.. Solution is easy, redirect client to a "please, wait till i refresh data" page, then re-redirect the client back to the game page.The time it takes for the redirects is ANNOYING , but is a solution to give time to the server to refresh data.The javascript on client side (i given a link to an example) will vait for X time to pass before refreshing the page / redirecting to please wait page. The trick is, it must not be a static value.So, i store the time stamp of the end of current tick in the database.When the page loads, it will fetch this information, and CURRENT times tamp.The difference between them is the value the javascript needs to wait before refreshing/redirecting the client. So, this heals the problems for now.I finished basic layout, now i'm off to make the refreshing thingy, so the game world can start.And then will the harder part come.
set_time_limit(0);
I don't know why, but i feel you are more experienced in coding than you want us to believe