codexx Posted June 15, 2007 Share Posted June 15, 2007 Hey Everyone, Working on a script where everytime a user gets 1000 views they get 1$. Everything works except the if for the amount of views.. How can I make it so it will see if the views is a thouand.. ie.. 1000, 2000, 3000 etc. I don't want to manually have to type 1000 - 500,000! lol ie. <? php if($views = 1000 || $views = 2000 || $views = 3000){ givemoney($user); } ?> Thanks in Advance! Quote Link to comment https://forums.phpfreaks.com/topic/55679-solved-every-1000-views-give-1/ Share on other sites More sharing options...
trq Posted June 15, 2007 Share Posted June 15, 2007 <?php if (($views % 1000) ? false : true) { givemoney($user); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/55679-solved-every-1000-views-give-1/#findComment-275131 Share on other sites More sharing options...
ShoeLace1291 Posted June 15, 2007 Share Posted June 15, 2007 Couldn't he also do if($views > 999){ givemoney($user); } Quote Link to comment https://forums.phpfreaks.com/topic/55679-solved-every-1000-views-give-1/#findComment-275133 Share on other sites More sharing options...
codexx Posted June 15, 2007 Author Share Posted June 15, 2007 Thanks Thorpe! Hyrbid, I wouldn't be able to do that because it needs to give a dollar for every thousand views.. so if it was was > 999 then everytime it was viewed after 999 it would give them a $ Quote Link to comment https://forums.phpfreaks.com/topic/55679-solved-every-1000-views-give-1/#findComment-275135 Share on other sites More sharing options...
ShoeLace1291 Posted June 15, 2007 Share Posted June 15, 2007 aahhh ok i guess i got confused by your question. Quote Link to comment https://forums.phpfreaks.com/topic/55679-solved-every-1000-views-give-1/#findComment-275138 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.