General Community > Scripting Help

Error when trying to make a sub directory

(1/3) > >>

-Dave:
hi gang was hoping for a hand i have this code which i use to pull usernames to irc but when i try  make a roomslist with this code


--- Code: ---'menu_action' => array(
'title' => 'text for menu',
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
'sub_menu_action' => array(
'title' => 'text for sub-menu',
'href' => $scripturl . '?action=newaction',
'show' => true,
'is_last'=> true,
),
),
),

--- End code ---

i get a error on line 32 on my index.php this is my index.php code


--- Code: ---<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta name="language" content="en" />
 <meta name="author" content="Valentin Manthei - lightIRC.com" />
 <title>Chatterzz Client</title>
 <script type="text/javascript" src="swfobject.js"></script>
<?php
    $temp = trim($_GET['nick']);
if(!empty($temp) && ctype_alnum($temp)) {
    $nick = $temp;

$db_server = 'localhost';
$db_name = 'admin_xxx;
$db_user = 'admin_xxx';
$db_passwd = 'xxxxxxx';

$link = mysql_connect($db_server, $db_user, $db_passwd);
mysql_select_db($db_name);

$qry = "SELECT id_member FROM `smf_members` WHERE member_name = '$nick'";
$result = mysql_query($qry);

if(!mysql_num_rows($result) || mysql_num_rows($result) == 0) {
    redirectss();
}

mysql_close($link);
$bln = true;
} else {
    redirectss(); [color=red]This the trouble area  [/color]
}
?>

 <script type="text/javascript">
var nickname = "<?php echo $nick; ?>";
 </script>
 <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
 <script type="text/javascript" src="config.js"></script>
 <style type="text/css">
html { height: 100%; overflow: hidden; }
body { height:100%; margin:0; padding:0; background-color:#999; }
 </style>
</head>

<body>
<?php if($bln) { ?>
 <h1 style="margin: 0 auto; text-align:center;color:blue;">New Chatterzz Central </h1><center><a href="http://www.chatterzz.com/ncc" target="_blank">Home</a> <a href="http://www.chatterzz.com/ncc/index.php?action=forum" target="_blank">Forum</a></center>
 <div id="lightIRC" style="height:89%; text-align:center;">
  <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
 </div>
 <script type="text/javascript">
swfobject.embedSWF("lightIRC.swf", "lightIRC", "100%", "89%", "10.0.0", "expressInstall.swf", params);
 </script>
 <?php } ?>
</body>
</html>

--- End code ---

K@:
I'm no coder. So, this could be total bollox.

But, shouldn't:


--- Code: --- } else {
    redirectss(); [color=red]This the trouble area  [/color]
}
--- End code ---

be:


--- Code: --- }
else {
    redirectss(); [color=red]This the trouble area  [/color]
}

--- End code ---

 ???

Chen Zhen:
Before I post code with some fixes please give some more details..

Which smf version are you using?
Is this an actual template file or is this page being displayed within another page on your forum or from a portal?
Is the database you are accessing the same as your forum where you are attempting to display this data?
 

MrPhil:

--- Code: ---$db_name = 'admin_xxx;
--- End code ---
should be

--- Code: ---$db_name = 'admin_xxx';
--- End code ---

-Dave:
Ty for the replies

Smf version 2.02
Simple portal 2.3.4

this is  a page being displayed external
the db is the db for forum

What i am trying to do is make a heading Chatrooms then a list of 4 to 5 rooms underneath so users just click the room they need, instead of using one room to access the other rooms

Navigation

[0] Message Index

[#] Next page

Go to full version