You are here:  » Code Issues - Jumps to Reviews and include problem

Support Forum



Code Issues - Jumps to Reviews and include problem

Submitted by ANDREWCX on Wed, 2008-07-02 13:30 in

Hi David,

Re: http://rewardsdb.com/product/Buy.html

I have an include in products.php that includes a file containing coupons if it is present that you provided some time ago.

<?php
if
(
("coupons/".database_safe($q).".php"!=false)
)
{
include("coupons/".database_safe($q).".php");
}
?>

I would like to put an anchor link at the top of the page to jump to the coupons if they are present, however whatever I try, the link displays whether or not there is a coupon file included. Do you have any suggestions?

Submitted by support on Tue, 2008-07-08 09:14

Hi Andrew,

The usual way to test for the existance of the coupons include is to use file_exists...

if (file_exists("coupons/".database_safe($q).".php"))
{
  // your code here
}

I'm not sure why this doesn't appear in the code you posted; but have a go with this and see if it works as expected...

Cheers,
David.