Click here to Skip to main content
15,887,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
<?php
session_start();
error_reporting(0);
include "timeout.php";

if($_SESSION[login]==1){
	if(!cek_login()){
		$_SESSION[login] = 0;
	}
}
if($_SESSION[login]==0){
  header('location:logout.php');
}
else{
if (empty($_SESSION['username']) AND empty($_SESSION['passuser']) AND $_SESSION['login']==0){
  echo "<link href='style.css' rel='stylesheet' type='text/css'>
 <center>Untuk mengakses modul, Anda harus login <br>";
  echo "<a href=index.php>LOGIN</a></center>";
}
else{
?>
<html>
<head>
<title></title>
<script language="javascript" type="text/javascript">
    tinyMCE_GZ.init({
    plugins : 'style,layer,table,save,advhr,advimage, ...',
		themes  : 'simple,advanced',
		languages : 'en',
		disk_cache : true,
		debug : false
});
</script>
<script language="javascript" type="text/javascript"
src="../tinymcpuk/tiny_mce_src.js"></script>
<script type="text/javascript">
tinyMCE.init({
		mode : "textareas",
		theme : "advanced",
		plugins : "table,youtube,advhr,advimage,advlink,emotions,flash,searchreplace,paste,directionality,noneditable,contextmenu",
		theme_advanced_buttons1_add : "fontselect,fontsizeselect",
		theme_advanced_buttons2_add : "separator,preview,zoom,separator,forecolor,backcolor,liststyle",
		theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
		theme_advanced_buttons3_add_before : "tablecontrols,separator,youtube,separator",
		theme_advanced_buttons3_add : "emotions,flash",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		extended_valid_elements : "hr[class|width|size|noshade]",
		file_browser_callback : "fileBrowserCallBack",
		paste_use_dialog : false,
		theme_advanced_resizing : true,
		theme_advanced_resize_horizontal : false,
		theme_advanced_link_targets : "_something=My somthing;_something2=My somthing2;_something3=My somthing3;",
		apply_source_formatting : true
});

	function fileBrowserCallBack(field_name, url, type, win) {
		var connector = "../../filemanager/browser.html?Connector=connectors/php/connector.php";
		var enableAutoTypeSelection = true;
		
		var cType;
		tinymcpuk_field = field_name;
		tinymcpuk = win;
		
		switch (type) {
			case "image":
				cType = "Image";
				break;
			case "flash":
				cType = "Flash";
				break;
			case "file":
				cType = "File";
				break;
		}
		
		if (enableAutoTypeSelection && cType) {
			connector += "&Type=" + cType;
		}
		
		window.open(connector, "tinymcpuk", "modal,width=600,height=400");
	}
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function disableRightClick()
{
 alert("sorry can't right click");
 return false;
 }
 </script>
</head>

<body oncontextmenu= "return disableRightClick();">

 
<?php if ($_SESSION['leveluser']=='user'){ ?>
<div id="header">
	<div id="menu">
      <ul>
        <li><a href='?rajaampat'=info><img src="icon/globe.ico" border="0px" width="12px" height="13px" /> Home</a></li>
        <?php include "menu.php"; ?>
        <li><a href=logout.php><img src="icon/globe.ico" border="0px" width="12px" height="13px" /> Logout</a></li>
      </ul>
	    <p> </p>
 	</div>

  <div id="content">
		<?php include "content.php"; ?>
  </div>
  </div>
<?php }elseif ($_SESSION['leveluser']=='admin'){ ?>
<div id="header">
	<div id="menu">
      <ul>
        <li><a href='?rajaampat'=info><img src="icon/globe.ico" border="0px" width="12px" height="13px" /> Home</a></li>
        <?php include "menu2.php"; ?>
        <li><a href=logout.php><img src="icon/globe.ico" border="0px" width="12px" height="13px" > Logout</a></li>
      </ul>
	    <p> </p>
 	</div>

  <div id="content">
		<?php include "content2.php"; ?>
  </div>
  </div>
<?php }else { ?>
	<p>MAAF ANDA HARUS LOG IN do e</p>
<?php } ?> 

		
<div id="footer">
			Copyright © 2014 Kominfo Raja Ampat All rights reserved.
		</div>
</body>
</html>
<?php
}
?>


What I have tried:

i tried closed unclosed syntax but still get this error :

Parse error: syntax error, unexpected end of file in
Posted
Updated 10-Jul-18 21:49pm
v2
Comments
Mohibur Rashid 11-Jul-18 2:53am    
error in javascript or php?
Member 13906740 11-Jul-18 2:55am    
php
Mohibur Rashid 11-Jul-18 2:59am    
Another question what's in menu.php? is this correct? can you run menu.php separately and see the result without any bug?

Such errors are usually sourced by a missing end block identifier (closing brace).

To check this you can copy the code to an editor like Notepad++ that highlights matching braces and remove the HTML parts.

If have done this for you and indented the code so that it can be seen clearly:
PHP
session_start();
error_reporting(0);
include "timeout.php";

if($_SESSION[login]==1){
	if(!cek_login()){
		$_SESSION[login] = 0;
	}
}
if($_SESSION[login]==0){
  header('location:logout.php');
}
else{
    if (empty($_SESSION['username']) AND empty($_SESSION['passuser']) AND $_SESSION['login']==0){
        echo "<link href='style.css' rel='stylesheet' type='text/css'><center>Untuk mengakses modul, Anda harus login <br>";
        echo "<a href=index.php>LOGIN</a></center>";
    }
    else{
        if ($_SESSION['leveluser']=='user'){ 
            //
        }elseif ($_SESSION['leveluser']=='admin'){
            //
        }else {
            //
        }
    }
The topmost else is not terminated.
 
Share this answer
 
Quote:
Parse error: syntax error, unexpected end of file in

You get this error message because '{' and '}' are structures delimiter and must be in equal quantity in the code. In your code, you have 1 more '{' than '}'.

Professional programmer's editors have the feature of parenthesis matching and many other useful ones for a programmer.
Notepad++ Home[^]
ultraedit[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900