Kurt111780
Technical User
Hello,
How could I convert this to asp.net c#?
It's only easy when you know how.
How could I convert this to asp.net c#?
Code:
<?php
$pageID = $_GET['pageID'];
// Execute Query
$msSqlQry = mssql_query("SELECT * FROM myLinks WHERE txtPageID = '$pageID'")
or die ("Unable to run query");
// Iteration loop, for each row in rowset
$lineNumber = 1;
while ($row = mssql_fetch_assoc($msSqlQry))
{
// Assigning variables from cell values
$txtFileID = $row["txtFileID"];
$txtPageID = $row["txtPageID"];
$expireTime = $row["txtExpireTime"];
$txtFileName = $row["txtFileName"];
$txtToName = $row["txtToName"];
$txtToEmail = $row["txtToEmail"];
$txtFromName = $row["txtFromName"];
$txtFromEmail = $row["txtFromEmail"];
$numDownloads = $row["numDownloads"];
//get current time
$currentTime = date("YmdHis");
//get basename
$txtBasename = basename($txtFileName);
//make sure link has not expired
if ($currentTime > $expireTime)
{
echo "<tr><td align=\"left\">";
echo $lineNumber . ") <font color=\"#FF0000\">Link Expired - </font>" . $txtBasename;
echo "</td></tr>";
}
else
{
// Outputting data to browser
echo "<tr><td align=\"left\">";
echo($lineNumber . ') <A HREF=downloadAction.php?fileID=' . $txtFileID . '>');
echo('Click to download: ' . $txtBasename .'</A>');
echo "</td></tr>";
}//end if
$lineNumber++;
$pageExists = 1;
}//end while
?>
</table>
It's only easy when you know how.