January 30th, 2013, 03:49 AM
-
Display Data into website using pid
I want to display data into web page when user clicks on Menu Navigation into same web page.
I have done the following code:
Header.php where Menu Navigation bar is:
[code]
<ul id="menu">
<?php
include 'ClsDatabase.php';
include 'config.php';
$query="select * from tbl_pageinfo";
$user= new ClsDatabase();
$a=$user->selectRecord($query);
while($record=mysql_fetch_array($a))
{
?>
<li><a href="welcomepage.php?pid=<?php echo $record["page_name"];?>" ><?php echo $record["page_name"];?></a></li>
<?php } ?>
</ul>
Welcomepage.php where I want to show data when user clicks on any item on Menu.
welcomepage.php
[code]
<?php
$a=$_GET["pid"];
$link_id=mysql_connect("localhost","root","sqldb");
mysql_select_db("CMS",$link_id);
$query1="SELECT * FROM tbl_pageinfo where page_name=$a";
$res=mysql_query($query1);
?>
<!-- START .grid_9 - LEFT CONTENT -->
<div class="grid_9 cnt" id="left">
<h1>Dashboard</h1>
<div id="lipsum">
<?php
while($record=mysql_fetch_array($res))
{ ?>
<p><?php echo $record["page_desc"];?></p>
<?php } ?>
Please help!
January 30th, 2013, 04:25 AM
-