I have two php pages - home.php and player.php...

home.php has a loop to show all the products EID has associated with it including TOTALPLAYS, PLAYCOUNT, USER, PASS, PRODUCT and PRODUCTPATH... player.php has a small script to find out if PLAYCOUNT > TOTALPLAYS as well as pulling in the PRODUCTPATH into the flash player.

My math script below gives me the correct 'location redirect' when it returns exceeds TOTALPLAYS, it redirects to expired.php when it does not exceed TOTALPLAYS as well.

<?php
	$ePlays = $row_eVideo['ePlays'];
	$ePlayed = $row_eVideo['ePlayed']; 

    if ($ePlayed > $ePlays) { 
		header('Location: expired.php');
	}
	else{
	}
	
?>

I have a recordset that returns the EID and I even put the EID= on the link in the home page and it still returns expired...

Any help/suggestions would be great...

Ted

Member Avatar
diafol
<?php
	$ePlays = $row_eVideo['ePlays'];
	$ePlayed = $row_eVideo['ePlayed']; 
 
    if ($ePlayed > $ePlays) { 
		[B]header("Location: expired.php?eps=$ePlays&epd=$ePlayed");[/B]
	}
	else{
	}
 
?>

Check your values to see if they're actually set properly.
You don't have to handle the querystring params - just check the values in the address bar. Equally you could echo out the vars. However, this'll cause a 'headers already sent' error, although it's still useful.

The values are being set properly... It's sort of frustrating - I can make it work with timestamp but why won't it work with actual integers?

Frustrating I tell you...

Member Avatar
diafol

How about:

<?php
	$ePlays = intval($row_eVideo['ePlays']);
	$ePlayed = intval($row_eVideo['ePlayed']); 
 
    if ($ePlayed > $ePlays) { 
		header("Location: expired.php");
	}
	else{
	}
 
?>

genius... worked like a charm!

thanks @ardav

Member Avatar
diafol

OK, are we solved?