Hello, I am trying to access the admin page and there is error in the admin first page:

http://www.indonusa.net.id/IndonusaCMS/admin/

How to fix it?

admin/index.php

    <?php

    include ($include);

    ?>

    </div>

</div>

</body>

</html>

<?

}

?>

Here is like the last 20 lines of admin.

Recommended Answers

All 20 Replies

Member Avatar for diafol

Count your open and close braces

Look at all { to have a coresponding }.

Member Avatar for diafol

I think he's got the message by now. :(

I think I have just the right number of { brackets }. Here is the whole codes:

admin/index.php

<?PHP

require('../include/config.php');

if (empty($_SESSION['login'])) 

{ 

    header ("location: login.php");

}

else if ($_SESSION['level']!= 1) {

    header ("location: ../");

}

else{

include "./include/class.php";

$site = new site();

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">



<head>



<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>SCN administrator</title>





<link href="./stylesheets/master.css" media="screen" rel="stylesheet" type="text/css" />



<script type="text/javascript">

<!--

var timeout         = 500;

var closetimer      = 0;

var ddmenuitem      = 0;



// open hidden layer

function mopen(id)

{   

    // cancel close timer

    mcancelclosetime();



    // close old layer

    if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';



    // get new layer and show it

    ddmenuitem = document.getElementById(id);

    ddmenuitem.style.visibility = 'visible';



}

// close showed layer

function mclose()

{

    if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

}



// go close timer

function mclosetime()

{

    closetimer = window.setTimeout(mclose, timeout);

}



// cancel close timer

function mcancelclosetime()

{

    if(closetimer)

    {

        window.clearTimeout(closetimer);

        closetimer = null;

    }

}



// close layer when click-out

document.onclick = mclose; 

// -->

</script>



<?PHP

if (isset($_GET["page"])) 



{

    $page = $_GET["page"];

    switch ($page)

    {



    case action:

    $class1 = "active";

    $include = "action.php";

    break;



    case home:

    $class1 = "active";

    $include = "home.php";  

    break;



    case about_us:

    $class2 = "active";

    $include = "about_us.php";  

    break;



    case ikuti:

    $class2 = "active";

    $include = "ikuti.php"; 

    break;



    case fokus:

    $class3 = "active";

    $include = "fokus.php"; 

    break;



    case program:
    case voice:
    case video: 
    case building:
    case hotel:
    case call:
    case unified:   
    case microsoft:
    case connection_setup:
    case email_setup:
    case payment:
    case billing:
    case faq:
    case change_psw:
    case careers:
    case agent:
    $class3 = "active";
    $include = "dynamic.php";   
    break;

    case reg_online:
    $class3 = "active";
    $include = "reg_online.php";    
    break;

    case ceritadahsyat:
    $class3 = "active";
    $include = "dynamic.php";   
    break;



    /* case testimonial:

    $class3 = "active";

    $include = "testimonial.php";   

    break; */



    case events:

    $class3 = "active";

    $include = "dynamic.php";   

    break;



    case menu:

    $class4 = "active";

    $include = "menu.php";  

    break;


    case menu_other:

    $class4 = "active";

    $include = "menu_other.php";    

    break;



    case plugins:

    $class4 = "active";

    $include = "plugins.php";   

    break;



    case promo:

    $class4 = "active";

    $include = "promo.php"; 

    break;



    case banner:

    $class4 = "active";

    $include = "banner.php";    

    break;



    case contact:

    $class4 = "active";

    $include = "contact.php";   

    break;



    case user_admin:

    $class4 = "active";

    $include = "user_admin.php";    

    break;



    case katamutiara:

    $class4 = "active";

    $include = "kamut.php"; 

    break;



    case edituser:

    case profile:

    $class5 = "active";

    $include = "edit_profile.php";  

    break;



    case editpromo:

    $class4 = "active";

    $include = "edit_promo.php";    

    break;



    case editbanner:

    $class4 = "active";

    $include = "edit_banner.php";   

    break;



    case addbanner:

    $class4 = "active";

    $include = "add_banner.php";    

    break;



    case addpromo:

    $class9 = "active";

    $include = "add_promo.php"; 

    break;



    case addcontent:

    $class3 = "active";

    $include = "add_content.php";   

    break;



    case editcontent:

    $class3 = "active";

    $include = "edit_content.php";  

    break;



    case addstatic:

    $class2 = "active";

    $include = "add_static.php";    

    break;





    case editstatic:

    $class2 = "active";

    $include = "edit_static.php";   

    break;



    case addkamut:

    case updatekamut:

    $include = "addkamut.php";  

    break;



    case jadwal: 

    $class3 = "active";

    $include = "jadwal.php";    

    break;



    case addjadwal:

    case editjadwal:

    $class3 = "active";

    $include ="add_jadwal.php"; 

    break;



    default:

    $include = "home.php";  

    }

}

else 

{

$body = "dashboard";

$include = "home.php";

}

?>

</head>



<body class="dashboard">

<?php

include ("header.php");

$query = mysql_query("SELECT * FROM menu_order");

while ($menudata = mysql_fetch_assoc($query))

{

    $menuarray[] = $menudata;

}

$querymenu = mysql_query("SELECT COUNT(*) as total FROM menu_order");

$getmennu = mysql_fetch_assoc($querymenu);

$totalmenu = $getmennu['total'];

?>

<div id="wrap">

    <?php

    include ("sideright.php");

    ?>

    <div id="mainContent">

    <?php

    include ($include);

    ?>

    </div>

</div>

</body>

</html>

<?

}

?>
Member Avatar for diafol

As you've neglected to properly indent your php it's almost impossible to see from scrolling through it. If the problem isn't with your visible code, check the include files.

Doesn't your IDE flag up mismatches? Consider using a different one if not.

Member Avatar for iamthwee

Good God how on earth can you code and debug anything with that style of coding.

Another thing is if you are including a shed load of other php files the issue could reside there. Either mismatch brackets or missing a semi-colon.

I do not actually program it myself. Someone else did it. I was assigned to debug the program. What's the easiest way to debug the program?

Member Avatar for diafol

I do not actually program it myself. Someone else did it

The issue is that you ask other people to look at the code. It's up to you to provide contributors with code that is readable.

I was assigned to debug the program. What's the easiest way to debug the program?

Seriously? Ask for a different assignment while you try out a bunch of quality IDEs.

Hello,

I have been trying to install Netbeans. I did it. Yet, now when I try to run PHP file - it requires PHP 5 Interpreter.

Where to find and how to install the PHP 5 Interpreter?

Internet -> PHP site.
If you have PHP 5 installed, must do some config in NetBeans to view php.exe and php path.

I use phpDesigner. Is smaller and dedicated php and web desinger.

ok, I went to Tools - Options - PHP - browse php.exe - OK

Then, I try to Debug file - then it started to look for Run Arguments & PHP Options - I do not know what to fill that with.

Run - Run File also looks for the same information. Any other idea what I should do to test my php script? If it is correct or not?

And if you fill nothing, you cant run ?

What should I fill Run File :

Run Arguments ?

PHP Options ?

I have no clue what to fill both of them with. Please help.

When I try to debug my admin/index.php page in localhost through Netbeans then:

Waiting For Connection (netbeans-xdebug) [____________________]

for a really long time.

This is the online page that I intent to debug:

http://www.indonusa.net.id/IndonusaCMS/admin/

I mean how can I use Netbeans to debug that error?

"E:\xampp\php\php.exe" "-a" "E:\xampp\htdocs\IndonusaCMS\admin\index.php" "debug=true"
Interactive mode enabled

Parse error: syntax error, unexpected end of file in E:\xampp\htdocs\IndonusaCMS\admin\index.php on line 544
Done.

The same error message that I get after debuging the file.

Netbeans suppose to show me red exclamation mark "!" if I am missing a parentheses correct?

I can see a few yellow triangle exclamation marks "!" even in the admin/index.php file.

Do I need to check all the include files as well for a red exclamation mark?

-----------------------

Also, cek the last line of my codes (line 538 - 542):

<?

}

?>

Line 542 : Unnecessary closing delimiter - if I remove it the same error still remains

Parse error: syntax error, unexpected end of file in E:xampphtdocsIndonusaCMSadminindex.php on line 544

If I add <?php to line 538 then lots of errors start appearings.

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.