Current location: Hot Scripts Forums » Programming Languages » PHP » PhP errors in simple script

PhP errors in simple script

Reply
  #1  
Old 07-11-09, 05:31 PM
earthone earthone is offline
Newbie Coder
 
Join Date: Jul 2009
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
PhP errors in simple script

I have been having a rough time figuring out the problem with a simple script. Can you guys help me figure it out.

Here is part of the script can you tell me what im doing wrong.

Page 1

PHP Code:
<?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 Code:
<?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;
      }
?>
any help is greatly appreciated.
Reply With Quote
  #2  
Old 07-11-09, 06:12 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 7,536
Thanks: 5
Thanked 20 Times in 18 Posts
Well what seems to be the problem?
Reply With Quote
  #3  
Old 07-11-09, 06:14 PM
earthone earthone is offline
Newbie Coder
 
Join Date: Jul 2009
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
first I get this

PHP Code:
Parse errorsyntax errorunexpected $end in 
then when I try to fix it all I get is fatal errors.
Reply With Quote
  #4  
Old 07-11-09, 07:14 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 7,536
Thanks: 5
Thanked 20 Times in 18 Posts
I don't see any obvious errors. Can you post the whole error, including the name and line number?

And tell us which code belongs to which file?
Reply With Quote
  #5  
Old 07-11-09, 08:44 PM
captcha captcha is offline
Newbie Coder
 
Join Date: Jul 2009
Posts: 24
Thanks: 0
Thanked 1 Time in 1 Post
There is a typo in the function: CopyrightChecker
But other than that and the second if being probably useless it should work.
Reply With Quote
  #6  
Old 07-11-09, 08:57 PM
job0107's Avatar
job0107 job0107 is offline
Community Liaison
 
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 2,659
Thanks: 0
Thanked 22 Times in 22 Posts
Quote:
Originally Posted by earthone View Post
I have been having a rough time figuring out the problem with a simple script. Can you guys help me figure it out.

Here is part of the script can you tell me what im doing wrong.

Page 1

PHP Code:
<?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 Code:
<?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;
      }
?>
any help is greatly appreciated.
I don't think you are getting any output.
Shouldn't your copyright notices be quoted?

page 1
PHP Code:
<?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 Code:
<?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";
      }
?>
Or are your copyright notices, functions that return a value?

page 1
PHP Code:
<?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 Code:
<?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();
       }
 
?>
And where is CopyrightChecker() all I see is CopyrightCheck($crCheck) ?
__________________
Jerry Broughton

Last edited by job0107; 07-11-09 at 09:05 PM.
Reply With Quote
  #7  
Old 07-12-09, 07:55 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 7,536
Thanks: 5
Thanked 20 Times in 18 Posts
I was assuming they're constants. Although I haven't seen them being defined anywhere.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
2 profitable script sites for sale cms-master.com General Advertisements 3 07-03-07 11:17 AM
Simple php script. Write fields to text file...append each time. WillR Script Requests 3 01-22-07 03:53 PM
Simple PHP Email Script phillyhotshots Script Requests 8 01-28-06 10:57 AM
Hi help required a fairly simple php script Newbiephp PHP 0 07-11-05 05:58 PM
In need of simple php login script asap j0e Script Requests 2 01-11-05 06:07 PM


All times are GMT -5. The time now is 02:12 AM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2 (Unregistered)