Jump to content


Photo

HELP!!11 SCRIPT IS ACTING UP.1!1...


  • Please log in to reply
4 replies to this topic

#1 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 07 August 2006 - 05:50 AM

<?php
// Begin Default Module Code

	if ( $_GET['name'] == NULL ) 
	{ 
	$sql1 = mysql_query("SELECT * FROM p16_modules WHERE default_module = 1 LIMIT 1", $connection);   
	$row = mysql_fetch_array( $sql1 );
	
	$mod_active = $row['active_module'];
	$modtitle = $row['title'];
	$modpath .= "modules/".$modtitle."/".$file.".php";
	
	if ( mysql_num_rows( $sql1 ) < 1 ) 
	{ 
	echo "<font face='Tahoma' size='1'><b>Oh my god! No default module!!</b></font>"; 
	} else if ( mysql_num_rows ($sql1 ) == 1 & mod_active == 1 & file_exists($modpath)) {
	include($modpath);
	} else {
	include($deactive);
	}
	}
	}
// End Module Code
?>

The module is active and the file exists, yet it includes $deactive. any idea why?? please help!

#2 hackerkts

hackerkts
  • Members
  • PipPipPip
  • Advanced Member
  • 593 posts
  • LocationSingapore
  • Age:18

Posted 07 August 2006 - 06:22 AM

Try change
} else if ( mysql_num_rows ($sql1 ) == 1 & mod_active == 1 & file_exists($modpath)) {
To
} else if ( mysql_num_rows ($sql1 ) == 1 && mod_active == 1 && file_exists($modpath)) {


Regards,
hackerkts

To be a coder, you must learn how to think and not to give up so easily.


#3 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 07 August 2006 - 04:50 PM

i did doesnt help

#4 king arthur

king arthur
  • Members
  • PipPipPip
  • Advanced Member
  • 335 posts
  • LocationUK HQ

Posted 07 August 2006 - 04:55 PM

Well, echo the three values you are testing in the if statement and see what they are.
Sir Isaac Newton said "If I have seen farther, it is by standing on the shoulders of giants". But it is not recorded as to whether he said it before or after he was hit on the head by a falling apple.

#5 newb

newb
  • Members
  • PipPipPip
  • Advanced Member
  • 454 posts

Posted 07 August 2006 - 04:57 PM

oh nevermind i figured it out, i had to add $ to mod_active. works now thx.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users