I think u should try this logic.
(SYNTAX MAY WRONG!!!)
modify ur menu page as
---------------------------------------
<li><a href="menu.php">HISTONES</a>
<ul>
<li><a href="menuHandler.php&page=H1" target="content" >Histone
H1</a></li>
<li><a href="menuHandler.php&page=H2A" target="content" >Histone
H2A</a></li>
<li><a href="menuHandler.php&page=H2B" target="content" >Histone
H2B</a></li>
<li><a href="menuHandler.php&page=H3" target="content" >Histone
H3</a></li>
<li><a href="menuHandler.php&page=H4" target="content" >Histone
H4</a></li>
</ul></li>
---------------------------------------
Now in menuHandler.php
switch($_GET['page'])
{
case H1:
$query=buildQuery('H1');
$result = mysql_query($query) or die(mysql_error());
break;
case H2A:
$query=buildQuery('H2A');
$result = mysql_query($query) or die(mysql_error());
break;
case H2B:
$query=buildQuery('H2B');
$result = mysql_query($query) or die(mysql_error());
break;
case H3:
$query=buildQuery('H3');
$result = mysql_query($query) or die(mysql_error());
break;
case H4:
$query=buildQuery('H4');
$result = mysql_query($query) or die(mysql_error());
break;
default:
break;
}
now handle ur queryresult here....
---------------------------------------
the function buildQuery should something like this
function buildQuery($pageRef)
{
return $query = "SELECT variant, uniprotkb, description, genes
from histone where histone ='histone ".$pageRef."' group by variant";
}
---------------------------------------
Hope this logic will help u ...
FIND MORE PHP RELATED ANSWERS AT http://phpinterviewanswers.blogspot.com/
REgards,
Rider
--- In [email protected], "satyajeet_khare"
<[EMAIL PROTECTED]> wrote:
>
> i am trying to develop a web-based database of proteins. i have
> following problems...
>
> my menu page contains following code...
> ---------------------------------------
> <li><a href="menu.php">HISTONES</a>
> <ul>
> <li><a href="histone/histoneh1.php" target="content" >Histone
> H1</a></li>
> <li><a href="histone/histoneh2a.php" target="content" >Histone
> H2A</a></li>
> <li><a href="histone/histoneh2b.php" target="content" >Histone
> H2B</a></li>
> <li><a href="histone/histoneh3.php" target="content" >Histone
> H3</a></li>
> <li><a href="histone/histoneh4.php" target="content" >Histone
> H4</a></li>
> </ul></li>
> ---------------------------------------
>
> obviously i have five different pages (histoneh1.php, histoneh2a.php
> and so on) linked respectively.
>
> however code in all files remains same and is as following...
> ---------------------------------------
>
> $result = mysql_query( "SELECT variant, uniprotkb, description, genes
> from histone where histone ='histone h1' group by variant" )
> or die(mysql_error());
> ---------------------------------------
> except "where histone ='histone h1'" changes to respective protein.
>
> is there any way i can write single page instead of five different
> pages and just change the variable?
>