1 Users appreciate this thread.
Simple PHP slots
(Capt.)Orb (2012-11-12 16:13:40)looks cool! but how could it work without a html input tag?
BTW <h3> is for headers not for text sizing use
Source Code
<font size='size'>Stuff</font>
<font size='size'>Stuff</font>
2012-11-12 16:17:32
Aviation fact: The a380 is the largest commerical aircraft in service!
Go to Splashiverse! Splashiverse
Go to Splashiverse! Splashiverse
klubadmin (2012-11-12 20:05:54)Actually, the font tag is depreciated. You should use:
Source Code
<span style='font-size:16px'>Text</span>
<span style='font-size:16px'>Text</span>
And it's just an example. You can use whatever tags you want.
angelrulez7 (2012-11-12 20:46:06)[code=Fixed *php]
<?php
//pick 3 random numbers 1-9
$first=rand(1,9);
$second=rand(1,9);
$third=rand(1,9);
//display them
echo "<h1>" .$first. " | " .$second. " | " .$third. "</h1>";
//if they all match
if($first == $second && $second == $third){
//jackpot
echo "You won stuff! ";
}else{
//if they don't all match, check for just two matching
if($first == $second){
//first-second match
echo "First two match! You win a bit of stuff.";
}
if($second == $third){
//second-third match
echo "Last two match! You win a bit of stuff.";
}
if($first == $third){
//first-third match
echo "First and last match! You win a bit of stuff.";
}
//or you failed completely
if($first != $second && $second != $third && $first != $third){
//none match
echo "You failed. You lose some stuff.";
}
}
echo "<h3>Refresh to try again.</h3>";
?>[/code]
Fixed.
2013-10-20 20:11:44
a
angelrulez7 (2012-11-12 21:10:20)[IMG]http://i47.tinypic.com/2uhs1uu.png[/IMG]
I used your script. ._.
a
klubadmin (2012-11-14 19:41:56)@dimitris Actually, no you don't.
1) I'm not even sure <?session start , php ?> is a real code, but if it is, it's definitely not required.
2) This is a php snippet, not an entire web page. Also, even if it was, most browsers wouldn't care and would display it correctly anyways (though you always should include proper formatting when possible).
(Capt.)Orb (2012-11-14 20:40:37)it's SESSION_start();
but as klubadmin said,it's not needed....
Aviation fact: The a380 is the largest commerical aircraft in service!
Go to Splashiverse! Splashiverse
Go to Splashiverse! Splashiverse
klubadmin (2012-11-19 20:40:50)1) Fapka.mobi doesn't exist.
2) If you meant wapka.mobi, it's terrible and you shouldn't be using it anyways if you're even slightly serious about being a web dev, so nobody cares.
Log in to submit a comment
Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)
New registered users today: 7
Newest registered user: ElegantVulpes

You could call this a tutorial, but it's really more of a handy free example script. Here, I'll show an easy and simple way to make a basic game of slots in PHP. Warning: even though the slots are basic, the php isn't necessarily basic too. I'll add comments throughout to explain sections, but not individual codes.
Here's the code:
<?php //pick 3 random numbers 1-9 $first=rand(1,9); $second=rand(1,9); $third=rand(1,9); //display them echo "<h1>" .$first. " | " .$second. " | " .$third. "</h1>"; //if they all match if($first == $second && $second == $third){ //jackpot echo "You won stuff!
Hopefully you find this useful/interesting/helpful and maybe you even learned something new. If you want to add on to the script, simply read through the comments to find where you should place things. I don't require you to give credit if you use this script, though a little pointer to http://klub.t15.org somewhere is always nice.
Disclaimer: This script should be fully functional, though it has not been tested.
3dsklub.cf
Like what I said? +respect
>Official Trinate Spriter<