Link to home
Start Free TrialLog in
Avatar of CWS (haripriya)
CWS (haripriya)Flag for India

asked on

php to asp conversion help

I want to convert this php page to asp. Can anybody convert this to me or atleast explain what is happening in this page. I know only asp. I don't know php. I have converted all the php files, but this one seems to be very complicated. I need your help in this:

Any help is appreciated.
Thank you.
--------------------------------------------------------------------------------------------------------------------


<html>
<body>
<div style="width:905px;">
<div style="width:900px;clear:both;">
<p><a href="login.php">Add your own links!</a></p>
<p>
<?php
include 'database.php';
$id=mysql_query('Select * from link order by time limit 360');
print '<table cellpadding="2">';
$cnt=1;
while ($cnt!=120)
{
  $rez=mysql_fetch_assoc($id);
  if ($cnt%30==0) {print'<tr><td colspan="3">&nbsp</td></tr>';}
  print '<tr>
       <td width="300">
       <a href="'.$rez['href'].'">'.$rez['name'].'</a>
       </td></tr>';
   $cnt++;
}  
while ($cnt!=120)
{
   $rez=mysql_fetch_assoc($id);
  if ($cnt%30==0) {print'<tr><td colspan="3">&nbsp</td></tr>';}
  print '<tr>
       <td width="300">
       <a href="'.$rez['href'].'">'.$rez['name'].'</a>
       </td></tr>';
   $cnt++;
}
while ($cnt!=120)
{
   $rez=mysql_fetch_assoc($id);
  if ($cnt%30==0) {print'<tr><td colspan="3">&nbsp</td></tr>';}
  print '<tr>
       <td width="300">
       <a href="'.$rez['href'].'">'.$rez['name'].'</a>
       </td></tr>';
   $cnt++;
}

print'</table>
<br>
<br>
Arhive:
<br>
'
?>
</p>
</div>
<div style="width:300px;float:left">
<?php
 
 include 'color.inc';
 $id=mysql_query('Select * from dir order by dir');
 $nr=mysql_num_rows($id);
 $NrCol1=(int) $nr/3;
 $NrCol2=(int) $nr/3;
 $NrCol3=(int) $nr/3;
 if ($nr%3!=0) {$NrCol1++;}
 if ($nr%3!=2) {$NrCol2++;}
 
 $rez=mysql_fetch_assoc($id);
 $rez2=mysql_fetch_assoc($id);      
 for ($i=1;$i<=$NrCol1;$i++)
 {
   if ($rez['dir'][0]!=$rez2['dir'][0]) {print'<br>';}
   print '<span>'.$rez['dir'].': </span><a href="showlink.php?cat='.$rez['id'].'&tp=0" style="color:'.$img.';">images</a><span>~</span><a href="showlink.php?cat='.$rez['id'].'&tp=1" style="color:'.$vid.';">videos</a><br>';
   $rez2=$rez;
   $rez=mysql_fetch_assoc($id);
 }
 
 ob_start();
 for ($i=1;$i<=$NrCol2;$i++)
 {
   if ($rez['dir'][0]!=$rez2['dir'][0]) {print'<br>';}
   print '<span>'.$rez['dir'].': </span><a href="showlink.php?cat='.$rez['id'].'&tp=0" style="color:'.$img.';">images</a><span>~</span><a href="showlink.php?cat='.$rez['id'].'&tp=1" style="color:'.$vid.';">videos</a><br>';
   $rez2=$rez;
   $rez=mysql_fetch_assoc($id);
 }
 $center=ob_get_clean();
?>
</div>
<div style="width:300px;float:right;">
<?php

 for ($i=1;$i<$NrCol3;$i++)
 {
   if ($rez['dir'][0]!=$rez2['dir'][0]) {print'<br>';}
   print '<span>'.$rez['dir'].': </span><a href="showlink.php?cat='.$rez['id'].'&tp=0" style="color:'.$img.';">images</a><span>~</span><a href="showlink.php?cat='.$rez['id'].'&tp=1" style="color:'.$vid.';">videos</a><br>';
   $rez2=$rez;
   $rez=mysql_fetch_assoc($id);
 }

?>
</div>
<div style="width:300px;margin-left:300px;margin-right:300px;">
<?php print $center ?>
</div>

</div>

</body>
</html>
ASKER CERTIFIED SOLUTION
Avatar of netmunky
netmunky
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial