troubleshooting Question

php to asp conversion help

Avatar of CWS (haripriya)
CWS (haripriya)Flag for India asked on
Web Languages and StandardsPHPAdobe Dreamweaver
1 Comment1 Solution264 ViewsLast Modified:
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>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros