function connect() {
$host='localhost';
$user='software_ext';
$pass='ext';
$conn=mysql_connect($host,$user,$pass);
mysql_select_db('software_ext');
return $conn;
}
function searchbox() {
echo "
";
}
function showsearch($num) {
$sql="select * from ext where id=$num";
$res=mysql_query($sql);
echo "";
echo "
Extension
.".mysql_result($res,0,'ext')."
Software / (Company Name)
".mysql_result($res,0,'descr')."
";
}
function listpage($let,$current) {
$conn=connect();
if ($let=='symbols') {
$sql="select count(id) from ext where (left(ext, 1) not between 'A' and 'Z') and (left(ext, 1) not between '0' and '9')";
}
else if ($let=='numbers') {
$sql="select count(id) from ext where left(ext, 1) between '0' and '9'";
}
else {
$sql="select count(id) from ext where left(ext, 1)='$let'";
}
$res=mysql_query($sql) or die(mysql_error());
$num=mysql_result($res,0,0);
$numpage=round($num/100);
if ($numpage*100<$num) $numpage++;
if ($numpage>0)
echo " | ";
for ($x=1;$x<=$numpage;$x++)
if ($x<>$current)
echo " $x | ";
else
echo " $x |";
echo '
';
}
function listchar($let) {
$letters='ABCDEFGHIJKLMNOPQRSTUVWXYZ';
if ($let<>'1to9')
echo " | Numbers ";
else
echo " | Numbers ";
if ($let<>'symbol')
echo "| Symbols |";
else
echo "| Symbol |";
for ($x=0;$x$letters[$x])
echo "".$letters[$x]." | ";
else
echo " ".$letters[$x]." | ";
}
$let=isset($_GET['let'])?$_GET['let']:'';
$current=(isset($_GET['page']))?$_GET['page']:1;
$lim=($current-1)*100;
$conn=connect();
if ($let<>'') {
if ($let=='symbols') {
$sql="select ext,id from ext where (left(ext, 1) not between 'A' and 'Z') and (left(ext, 1) not between '0' and '9') limit $lim,100";
}
else if ($let=='numbers') {
$sql="select ext,id from ext where left(ext, 1) between '0' and '9' limit $lim,100";
}
else {
$sql="select ext,id from ext where left(ext, 1)='$let' limit $lim,100";
}
$res=mysql_query($sql) or die(mysql_error());
/////////////////COMPANY LISTING
//YOU CAN GET THE TITLE IN VARIABLE $let
//HERE IS THE RESULT FOR THE COMPANY NAMES STARTING WITH A, B, OR C HEADER HERE
?>
echo $let ?> - List of File Extensions