Hello,
i almost resolved my problem
here's the code:
<?
include ("page.php") ;
require_once ("mysql_connect.php");
$content="";
{ function Display()
{
echo "<html>\n<head>\n";
$this -> DisplayTitle();
$this -> DisplayKeywords();
$this -> DisplayContentdescription();
$this -> DisplayStyles();
echo "</head>\n<body
cellspacing=0 cellpadding=0 leftmargin=0
rightmargin=0 topmargin=0 marginheight=0
marginwidth=0>\n";
$this -> DisplayHeader();
$this -> DisplayMenu($this->buttons);
echo $this->content;
$this -> DisplayFooter();
echo "</body>\n</html>\n";
}
}
$stampmebaby =getdate(time()) ;
$day= $stampmebaby[mday] ;
$month=$stampmebaby[mon] ;
$year=$stampmebaby[year] ;
//echo ($month."-".$day."-".$year) ;
// convert Age1 and Age2 to date
// find out what the age is
$stampmebaby =getdate(time()) ;
$day= $stampmebaby[mday] ;
$month=$stampmebaby[mon] ;
$year=$stampmebaby[year] ;
$year1=$year-$Age1 ;
$year2=$year-$Age2 ;
$checkage="(( bday<='$day'
AND bmonth<='$month' AND byear='$year1' )
OR ( byear<'$year1' ))
AND
(( bday<='$day' AND bmonth<='$month'
AND byear='$year2' )
OR ( byear>'$year2' ))" ;
$a = "0" ;
$content .='<table width="100%"
border="0" cellspacing="0" cellpadding="0">';
$query="SELECT * FROM members, photos
WHERE ".$checkage." AND
member.members=photos.friendID
AND small='y'
AND 2nd_parameter= '".$_REQUEST['2nd_parameter']."'
order by friendID desc";
$result = mysql_query($query)
or die(mysql_error());
while ($row = mysql_fetch_array($result) ) {
if (($a==0)||($a%4)==0) {$content .='</tr><tr>'; }
$content.='<td align="center">
<BR><BR><br><a
href="profile.php?personalID='.$row['friendid'].' ">
<img src="'.$row['photo'].'" border=0
alt="' . $row['FirstName'] . '"></a><br>
<br><b>' . $row['FirstName'] . '</b> <br>
Birthdate: '.$row['birthday'].'<br>';
$a = $a +1;
}
$content.='</table>';
$homepage = new Page();
$homepage -> SetContent($content);
$homepage->Display();
?>
the only thing is that in the search page
when i choose neither 2nd_parameter1
nor 2nd_parameter2
but option"Any" - no results
and i would like to show all results in
case someone chooses
"Any" in his/her search
CAN SOMEONE HELP IN THIS?
<?
require_once ("page.php");
$content= '';
$content .= '
<table width="100%"
align="center" bgcolor="white" border="0"
cellspacing="0" cellpadding="20">
<td>
<br>
<form action="searchthem.php" method="GET">
<p class="header">Search </p>
From:
<input type="text" size="3" name="Age1" value="18">
To: <input type="text" size="3" name="Age2"
value="99">
<BR><BR>
2nd_parameter:
<select name="2nd_parameter">
<option value="Any">
Any
<option value="1" >2nd_parameter1
<option value="2" >2nd_parameter2
</select>
<br><br>
<button type="submit" value="Search">
Search</button>
</form>
</td>
</tr>
</table> ';
$homepage = new Page();
$homepage -> SetContent($content);
$homepage->Display();
?>