Jump to content

Archived

This topic is now archived and is closed to further replies.

newb

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

Recommended Posts

[code]<?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
?>
[/code]

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

Share this post


Link to post
Share on other sites
Try change
[code]} else if ( mysql_num_rows ($sql1 ) == 1 & mod_active == 1 & file_exists($modpath)) {[/code]
To
[code]} else if ( mysql_num_rows ($sql1 ) == 1 && mod_active == 1 && file_exists($modpath)) {[/code]

Share this post


Link to post
Share on other sites
Well, echo the three values you are testing in the if statement and see what they are.

Share this post


Link to post
Share on other sites
oh nevermind i figured it out, i had to add $ to mod_active. works now thx.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.