Convert a smail php script in ASP

  • Thread starter Thread starter Jean Jacques Serpoul
  • Start date Start date
J

Jean Jacques Serpoul

Hello,
I have this small php script

<?
$ip=getenv(REMOTE_ADDR);
$agent=getenv(HTTP_USER_AGENT);
{
$c_date=GetDate(time());
$x_day=$c_date["mday"];
$x_month=$c_date["mon"];
if ($c_date["mday"]*1<10)
{
$x_day="0".$c_date["mday"];
}
if ($c_date["mon"]*1<10)
{
$x_month="0".$c_date["mon"];
}
$mydate=$c_date["year"].$x_month.$x_day;
$filelog="../file_logs/$mydate.log";
$liste_valeurs = date("Y/m/d H:i")."~~";
$liste_valeurs .= $lnk."~~";
$liste_valeurs .= $no."~~";
$liste_valeurs .= $userid."~~";
$liste_valeurs .= $ip."~~";
$liste_valeurs .= gethostbyaddr( $ip );
$fic=fopen("$filelog", "a");
if ($fic)
{
fputs($fic, $liste_valeurs . "\n");
fclose($fic);
}
}
Header("Location: $gourl");
?>

I want to convert into ASP and i am not at all a asp guru.
Thanks in advance for your help
PS : Don't find asp newgroup so using aspnet newsgroup.

Jean Jacques Serpoul
 
Well, ASP runs in IIS. This script looks like a log file of sorts. You
could just turn on logging in IIS and not have to port this code.

Do a search on Google for "IIS log"

Michael

Jean Jacques Serpoul said:
Hello,
I have this small php script

<?
$ip=getenv(REMOTE_ADDR);
$agent=getenv(HTTP_USER_AGENT);
{
$c_date=GetDate(time());
$x_day=$c_date["mday"];
$x_month=$c_date["mon"];
if ($c_date["mday"]*1<10)
{
$x_day="0".$c_date["mday"];
}
if ($c_date["mon"]*1<10)
{
$x_month="0".$c_date["mon"];
}
$mydate=$c_date["year"].$x_month.$x_day;
$filelog="../file_logs/$mydate.log";
$liste_valeurs = date("Y/m/d H:i")."~~";
$liste_valeurs .= $lnk."~~";
$liste_valeurs .= $no."~~";
$liste_valeurs .= $userid."~~";
$liste_valeurs .= $ip."~~";
$liste_valeurs .= gethostbyaddr( $ip );
$fic=fopen("$filelog", "a");
if ($fic)
{
fputs($fic, $liste_valeurs . "\n");
fclose($fic);
}
}
Header("Location: $gourl");
?>

I want to convert into ASP and i am not at all a asp guru.
Thanks in advance for your help
PS : Don't find asp newgroup so using aspnet newsgroup.

Jean Jacques Serpoul
 
Back
Top