1 Replies - 1106 Views - Last Post: 28 November 2007 - 11:37 PM Rate Topic: -----

#1 LadyMiaka86  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 30-July 07

Link page doesn't work properly

Post icon  Posted 28 November 2007 - 08:24 PM

Hi everyone.. I need some help here.. my problem is when i want to go to the one of the page in my administrator menu, such as "admin_berita.php" it doesn't work and it go to my "index.php" again...
i really don't know where is my mistake... please.. anyone could tell me what is wrong with this page...
here the code.... to make all of you understand what i mean...

index.php (main page)

<?
include('dbConn.php');
//session_start();
if(isset($_POST["B1"]))
{
	$getUser = "SELECT * FROM user WHERE username='$_POST[txtUsername]' and password='$_POST[txtPassword]'"; 
	$result = mysql_query($getUser);
	$fields = mysql_fetch_array($result, MYSQL_ASSOC);
	 if (strlen(trim($fields["username"]))>0)
{
  $_SESSION["userid"]=$fields["username"];
}
}
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>:: AFATS-16 Portal ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<style type="text/css">
<!--
td {
	text-align: left;
	vertical-align: top;
	font-family:Tahoma;
	font-size:11px;
	color:#535353;
}
a {
	text-decoration: underline;
	color:#535353;
}
a.1 {
	text-decoration: none;
	color:#000000;
}
.t11 {
	font-family: Tahoma;
	font-size: 11px;
	font-style: normal;
}
.t9 {
	font-family: Tahoma;
	font-size: 9px;
	font-style: normal;
}
.style3 {color: #FFFFFF}
.style4 {
	color: #0000CC;
	font-size: 18px;
	font-weight: bold;
}
.style5 {
	color: #000000;
	font-size: 14;
}
.style6 {font-size: 16px}

-->
</style>


</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (01_02_flatten_02.psd) -->
<div align="center">
  <table id="Table_01" width="1003" height="268" border="0" cellpadding="0" cellspacing="0">
	<tr>
	  <td colspan="5"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="1003" height="147">
		  <param name="movie" value="Images/top_banner.swf">
		  <param name=quality value=high>
		  <embed src="Images/top_banner.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="1003" height="147"></embed>
	  </object></td>
	</tr>
	<tr>
	  <td colspan="5">
	 	<?
		  if (   strlen(trim($fields["username"]))>0	) {
		
		$_SESSION["userid"]=$fields["username"];
		include "admin_left_menu.php";			
	} else {
		//include "left_menu.php";
		 
	
		?>  
		  <? 
			include "menu.php";
		?>
	  </td>
	</tr>
	<tr>
	  <td width="64" height="462" background="Images/bg_table_left.jpg"></td>
	  <td width="29" valign="top" bgcolor="#FFFFFF">
	  <? 
			if ($_SESSION['userid']<>"") { 
				  include "admin_left_menu.php";			
			  } else {
				include "left_menu.php";
				 
			}
		?>
	  </td>
	  <td width="632" valign="top" bgcolor="#FFFFFF"><table border="0" width="70%" id="table5" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="70%"></td>
		  </tr>
		  <tr>
			<td><div align="center"></div></td>
		  </tr>
		  <tr>
			<td><div align="center">
				<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="500" height="155">
				  <param name="movie" value="Images/banner_deepavali_afats.swf">
				  <param name="quality" value="high">
				  <embed src="Images/banner_deepavali_afats.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="500" height="155"></embed>
				</object>
			</div></td>
		  </tr>
		  <tr>
			<td>&nbsp;</td>
		  </tr>
		  <tr>
			<td><div align="left" class="style4">
				<div align="center"><img src="Images/berita_semasa_title_bar.jpg" width="532" height="23" alt=""></div>
			</div></td>
		  </tr>
		  <tr>
			<td rowspan="2" background="Images/big_box_03.jpg"><div align="center">
				<table width="93%" border="0" cellpadding="0" cellspacing="0">
				  <!--DWLayoutTable-->
				  <tr>
					<td width="101" height="13"></td>
					<td width="10"></td>
					<td width="360"></td>
				  </tr>
				  <tr>
				  <? 
						$getBerita = "SELECT * FROM news WHERE status=0 ORDER by date DESC, id DESC LIMIT 0,1"; 
						$result = mysql_query($getBerita);
						$fields = mysql_fetch_array($result, MYSQL_ASSOC);
						if (   strlen(trim($fields["id"]))>0	) {
						
					  ?>
					<td height="75" valign="top"><img src="berita_thumb/<? echo $fields["thumbnail"]; ?>"></td>
					<td>&nbsp;</td>
					<td valign="top"><strong><a href="berita_details.php?id=<? echo $fields["id"]; ?>"><? echo $fields["title"]; ?></a></strong> <br>
						<? echo $fields["date"]; ?> - <? echo substr(strip_tags($fields["desciption"]),0,1000); ?></td>
						<? } ?>
				  </tr>
				</table>
			</div></td>
		  </tr>
		  <tr> </tr>
		  <tr>
			<td><img src="Images/big_box_08.jpg" width="528" height="38" alt=""></td>
		  </tr>
		  <? 
						/*$getBerita = "SELECT * FROM news WHERE status=0 ORDER by date DESC, id DESC LIMIT 0,1"; 
						$rsBerita = mysql_query($getBerita);
						if ($row = mysql_num_rows($rsBerita)>0) {}*/
		  ?>
		  <tr>
			<td height="110"><div align="center">
				</div></td>
		  </tr>
	  </table></td>
	  <td width="215" valign="top" bgcolor="#FFFFFF"><? 
				include "right_menu.php";
	  ?>
	  </td>
	  <td width="90" background="Images/bg_table_right.jpg"></td>
	<tr>
	  <td background="Images/index_08.jpg"><img src="Images/index_08.jpg" width="30" height="27" alt=""></td>
	  <td colspan="3" bgcolor="#FFFFFF"><? 
			include "footer.php";
		?>
	  </td>
	  <td background="Images/index_12.jpg">&nbsp;</td>
	</tr>
	<tr>
	  <td><img src="Images/index_08.jpg" width="30" height="27" alt=""></td>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	  <td>&nbsp;</td>
	</tr>
	<tr>
	  <td colspan="5"><img src="Images/index_13.jpg" width="1030" height="38" alt=""></td>
	</tr>
  </table>
</div>
<!-- End ImageReady Slices -->
</body>
</html>
<? } ?>




admin_left_menu.php (the menu in admin_index.php)

<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0">
  <tr> 
	<td>&nbsp;</td>
  </tr>
  <tr> 
	<td>&nbsp;</td>
  </tr>
  <tr> 
	<td>&nbsp;</td>
  </tr>
  <tr> 
	<td>&nbsp;</td>
  </tr>
  <tr> 
	<td> <div align="center"> 
		<table id="table16" width="198" height="56" border="0" cellpadding="0" cellspacing="0">
		  <tr> 
			<td colspan="3"> <img src="Images/moderator_title_bar.jpg" width="198" height="21" alt=""></td>
		  </tr>
		  <tr> 
			<td background="Images/small_box_02.jpg"> <img src="Images/small_box_02.jpg" width="2" height="10" alt=""></td>
			<td> <div align="center"> 
				<table border="0" width="93%" id="table17" cellspacing="0" cellpadding="0">
				  <tr> 
					<td><p><a href="admin_berita.php">Berita</a><br>
						<a href="admin_aktiviti.php">Aktiviti</a><br>
						<a href="admin_undian.php">Undian</a><br>
						<a href="admin_pengguna_sistem.php">Pengguna Sistem</a><br>
						<a href="logout.php">Logout</a><br>
					  </p>
					  </td>
				  </tr>
				</table>
			  </div></td>
			<td background="Images/small_box_04.jpg"> <img src="Images/small_box_04.jpg" width="2" height="10" alt=""></td>
		  </tr>
		  <tr> 
			<td> <img src="Images/small_box_05.jpg" width="2" height="25" alt=""></td>
			<td> <img src="Images/small_box_06.jpg" width="194" height="25" alt=""></td>
			<td> <img src="Images/small_box_07.jpg" width="2" height="25" alt=""></td>
		  </tr>
		</table>
	  </div></td>
  </tr>
  <tr> 
	<td>&nbsp;</td>
  </tr>
  <tr> 
	<td>&nbsp;</td>
  </tr>
  <tr> 
	<td>&nbsp;</td>
  </tr>
</table>




admin_index.php (the page where it is display administrator menu)

<?
include "common.php";
include "dbConn.php";
session_start();

if ($_POST['txtUsername']<>"") {
	$getUser = "SELECT * FROM user WHERE username='$_POST[txtUsername]' and password='$_POST[txtPassword]'"; 
	$result = mysql_query($getUser);
	$fields = mysql_fetch_array($result, MYSQL_ASSOC);
	
}
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>:: AFATS-16 Portal ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<style type="text/css">
<!--
td {
	text-align: left;
	vertical-align: top;
	font-family:Tahoma;
	font-size:11px;
	color:#535353;
}
a {
	text-decoration: underline;
	color:#535353;
}
a.1 {
	text-decoration: none;
	color:#000000;
}
.t11 {
	font-family: Tahoma;
	font-size: 11px;
	font-style: normal;
}
.t9 {
	font-family: Tahoma;
	font-size: 9px;
	font-style: normal;
}
.style3 {color: #FFFFFF}
.style4 {
	color: #0000CC;
	font-size: 18px;
	font-weight: bold;
}
.style5 {
	color: #000000;
	font-size: 14;
}
.style6 {font-size: 16px}
.style8 {font-size: 14px; color: #000000; }

-->
</style>


</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (01_02_flatten_02.psd) -->
<div align="center">
  <table id="Table_01" width="994" height="268" border="0" cellpadding="0" cellspacing="0">
	<tr>
		
	  <td colspan="5"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="1003" height="147">
		  <param name="movie" value="Images/top_banner.swf">
		  <param name=quality value=high>
		  <embed src="Images/top_banner.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="1003" height="147"></embed> 
		</object></td>
	</tr>
	<tr>
		
	  <td colspan="5"> 
		<? 
			//include "menu.php";
		?>
	  </td>
	</tr>
	<tr>
		<td width="30" background="Images/bg_table_left.jpg"></td>
		
	  <td width="46" valign="top" bgcolor="#FFFFFF">
	  <? 
	  include "admin_left_menu.php";
	  ?>
	  </td>
		
	  <td width="875" valign="top" bgcolor="#FFFFFF"> 
		<table border="0" width="100%" id="table5" cellspacing="0" cellpadding="0">
		  <tr> 
			<td>&nbsp;</td>
		  </tr>
		  <tr> 
			<td><div align="center"></div></td>
		  </tr>
		  <tr> 
			<td> <div align="center">
			   
			  <p>&nbsp;</p>
			  <p>&nbsp;</p>
			  <p>&nbsp;</p>
			  <p>&nbsp;</p>
			  <p>&nbsp;</p>
			  <p>&nbsp;</p>
			</div></td>
		  </tr>
				  <tr>
			<td>&nbsp;</td>
		  </tr>
		  <tr> 
			<td><div align="left" class="style4"></div></td>
		  </tr>

		  <? 
						$getBerita = "SELECT * FROM news WHERE status=0 ORDER by date DESC, id DESC LIMIT 0,1"; 
						$rsBerita = mysql_query($getBerita);
						if ($row = mysql_num_rows($rsBerita)>0) {}
		  ?>
		  <tr> 
			<td height="144"> <div align="center"> 
				<p>&nbsp;</p>
			</div></td>
		  </tr>
		  <tr> 
			<td class="style4">			
			<td height="5" background="Images/big_box_05.jpg">&nbsp;</td>
		  </tr>
		  <tr> 
			<td>  
			<div align="left"> <br>
</div></td>
		  </tr>
		  <tr> 
			<td>&nbsp;</td>
		  </tr>
		  <tr> 
			<td height="13"><div align="center"> 
			  <p>&nbsp;</p>
			  <p>&nbsp;</p>
			</div></td>
		  </tr>
		</table>
	  </td>
		
	  <td width="28" valign="top" bgcolor="#FFFFFF"> 
		<? 
				//include "right_menu.php";
		  ?>
	  </td>
		<td width="15" background="images/bg_table_right.jpg"></td>
	</tr>
	<tr>
		
	  <td background="Images/index_08.jpg"></td>
		
	  <td colspan="3" bgcolor="#FFFFFF">
		  <? 
			include "footer.php";
		?>
	  </td>
		
	  <td background="Images/index_12.jpg"></td>
	</tr>
	<tr>
		<td>&nbsp;			</td>
		<td>&nbsp;			</td>
		<td>&nbsp;			</td>
		<td>&nbsp;			</td>
		<td>&nbsp;			</td>
	</tr>
	
</table>
</div>
<!-- End ImageReady Slices -->
</body>
</html>



Is This A Good Question/Topic? 0
  • +

Replies To: Link page doesn't work properly

#2 nav33n  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 71
  • Joined: 02-October 07

Re: Link page doesn't work properly

Posted 28 November 2007 - 11:37 PM

I dont see any error (?!?) in these scripts. Maybe you should show us what's in admin_berita.php.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1