Jump to content
MakeWebGames

Recommended Posts

Posted

Hey guys,

One of my simplest mods, I had a bit of time to spare so here it is:

Details: All you need to do is bet up to $500,000 and choose heads or tails. If the coin lands on the correct one, you win double. If not, you lose your bet cash. No images, only text.

Version: V2 (2.0.0)

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

You must upload with any filename and add a link in casino/wherever you find appropriate.

Enjoy. No bugs so far, but if you do find any, please post.

Posted

Re: [V2]Coin Toss Modification

 

as its "one of ur simplest mods" why not make it so u bet against another user like russian roulett but without being put in hosp

Nice idea, I'll do that if I get some time. :)

Posted

Re: [V2]Coin Toss Modification

One more little thing I never messed with is_numeric before I prefer other methods but looking into it on php.net I saw the following

 

////////////the following is not mine but from php.net

Some examples. Note that leading white space is OK, but not trailing white space, and there can't be white space between the "-" and the number.

is_numeric("1,000") = F

is_numeric("1e2") = T

is_numeric("-1e-2") = T

is_numeric("1e2.3") = F

is_numeric("1.") = T

is_numeric("1.2") = T

is_numeric("1.2.3") = F

is_numeric("-1") = T

is_numeric("- 1") = F

is_numeric("--1") = F

is_numeric("1-") = F

is_numeric("1A") = F

is_numeric(" 1") = T

is_numeric("1 ") = F

Posted

Re: [V2]Coin Toss Modification

As some one mentioned you should include ctype_digit as it will check for numeric characters. As ctype_digit only functions correctly on strings. Cast your vars to string before you test them. Also, be wary and only use ctype_digit if you're sure your var contains either a string or int, as boolean true for ex will convert to int 1. To be truly safe, you need to check the type of the var first.

Also make sure you know which command to use for example is_int() returns true if the argument is an integer type, ctype_digit() takes a string argument and returns true if all the characters in the string are digits;

 

is_int: ctype_digit:

123 true false

12.3 false false

"123" false true

"12.3" false false

 

So then it is up to you to consider what is trying to be done and which one would be more useful. If you don't really care if the argument is a int type or a string with numbers, use is_numeric.

I can see a few vulnerabilities in the code... But I will leave that up to you to see and sort out. :)

Posted

Re: [V2]Coin Toss Modification

 

I just skimmed this so Im not 100% sure but are you missing a and if here if the user doesnt have enough money?

Sorry about that, I'm just changing that now.

Posted

Re: [V2]Coin Toss Modification

I also believe the PHP 6.0 release issued the removal of obsolete extensions such as ereg extensions, the others that were deprecated were 'register_globals', 'magic_quotes' and 'safe_mode'

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...