Restricting media file play count.
I've run the wizard and added the session details - works perfectly...
I have a question that maybe someone can help with...
I have three pages - login.php, home.php and player.php... The login page is self explanatory and after the individual is logged in we return the following session variables:
ID, USER, PRODUCT, PATH, PLAYS and TOTAL
On the home page I'm returning a recordset loop filtered by the EID to display the product title, product link, plays available and total plays purchased... The recordset returns all the data correctly and even loads the flash file correctly... But when I istitute a simple math equation, e.g. PLAYS > TOTAL, it behaves correctly for an exceeded plays and behaves incorrectly for a non exceeded plays - meaning both redirect to the expired.php page.
The first question is - Does SecurityAssist (or Webassist to a greater extent) have something that can do a better job with the following equation?
<?php
$ePlays = $row_eVideo['ePlays'];
$ePlayed = $row_eVideo['ePlayed'];
if ($ePlayed > $ePlays) {
header('Location: expired.php');
}
else{
}
?>
The second question is - Is there a way to add +1 to a table on a page load versus an update form? An example would be adding 1 to 4 in ePlayed to equal 5... I would like the player.php page to add a 1 to the total 'ePlayed' for that EID...
I know I'm asking a lot - but - I'm kinda stuck!
Thanks,
Ted