ncaawallpaper Posted October 15, 2009 Share Posted October 15, 2009 Hello all, please, I need a little help with this script. I am charging one credit (credits can be purchased, but that is unrelated) for view of a certain page. I need help in figuring out what php I need to add to each of the articles I want to charge for. Here is what I would like: On view, if $balance is more than 0, subtract one credit. If $balance is less than 0, have page redirect to, oh for sake of example, google.com. Also, not sure if it would change, but I would also like the code for the same thing, but instead of $balance, if it were just a variable called VBalance. Thanks it advance! Link to comment https://forums.phpfreaks.com/topic/177723-on-page-view-minus-credit/ Share on other sites More sharing options...
mrMarcus Posted October 15, 2009 Share Posted October 15, 2009 if ($VBalance > 0) { $VBalance = ($VBalance-1); } else { header ('Location: http://www.google.com'); exit (0); } Link to comment https://forums.phpfreaks.com/topic/177723-on-page-view-minus-credit/#findComment-937109 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.