Ok I posted before and you were guys were great, but when I added the fix it cause more errors, can you guys check this and let me know what is wrong with it please.

Page 1

<?php
require("./copyrightChecker.php");
$crCheck = "Your_Copyright_Goes_Here";
if ( CopyrightChecker($crCheck) == COPYRIGHT_IS_VALID ) {
} else {
if ( CopyrightChecker($crCheck) == COPYRIGHT_NOT_VALID ) {
echo "The copyright must remain intact in order for this script to work...";
exit;
}
}
?>

Page 2

<?php
      function CopyrightCheck($crCheck) {
      $crCheck = stripslashes($crCheck);
      $Copyright_Notice = "Copyright &copy; 2000-2009 YourWebsite.com (Your
      Script). All Rights Reserved";
      if ($crCheck != $Copyright_Notice)
      return COPYRIGHT_NOT_VALID;
      else
      return COPYRIGHT_IS_VALID;
	  }
?>

I just cant seem to figure out the problem any help would be great .

Thank you.

Hi there,
Where exactly is the problem? Whats happening thats not supposed to or vice versa?

Just from the code that you've posted, I'd say that your error has to do with variable naming. In your "copyrightChecker.php" file, you don't define the constant COPYRIGHT_NOT_VALID or COPYRIGHT_IS_VALID . The way you're using those two identifiers, PHP is expecting defined constants, not strings.

The easiest thing to do to make your code work would be to put single or double quotes around each occurrence of COPYRIGHT_IS_VALID and COPYRIGHT_NOT_VALID in both of your files.

Here's the PHP manual page on defining constants.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.