473,385 Members | 1,712 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Convert a smail php script in ASP

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
Nov 18 '05 #1
1 1162
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" <js******@cd-soft.com> wrote in message
news:O%****************@TK2MSFTNGP12.phx.gbl...
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

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 12/2/2003
Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Harlin Seritt | last post by:
Hi, I have a script.py that is converted to .exe using py2exe. From another script I call script.exe and would like to be able to run this script.exe in the background (as well as in console --...
2
by: Wes Graves | last post by:
Hi there, I have a few MySQL scripts that I need to run in SQL Server. However the syntax is just slightly different and I was wondering if there is a tool out there that can quickly convert...
2
by: Galsaba | last post by:
How can I convert the following script to be used in access? <Html> <head> <title>Dealers</title> </head> <h5>List of Dealers Nearest to your Zip Code</h5><br><br> <? $errflag = false;
1
by: nsvmani1 | last post by:
Hi there! Does anybody know how to convert the Perl script files into a single exe file non-readable format?? regards venki
1
by: fatmapatlar | last post by:
I have to convert this script, but i didn't. This is stored procedure of sql. I need to convert to postgresql... if it is possible please help me! Thanks Fatma CREATE PROCEDURE...
9
by: whitgurley | last post by:
I've searched the web as well as I can for a solution to this problem but have found nothing and just don't know enough about JavaScript to figure out what's going. What I'm trying to do is convert...
5
by: Perl Beginner | last post by:
Hello all, I have written a pretty lengthy Perl script using Win32. Now i need to take this same script and run it on a Linux operating system. I'm not familiar with Linux at all, so I've been...
7
by: pavanip | last post by:
Hi, I am newer to Perl script.I don't know about perl. I have to do one project in perl. That is already developed.But I have to do some modifications to that.Please tell me what are the...
2
by: jeddiki | last post by:
Hello Ages ago I bought a php script that used inventory.overture.com website to get information on keywords. Now that overture has been scrapped does anyone know if I can use the script on...
2
by: Alex Ivanov | last post by:
Hi everybody! I want automatically create many folders with the python files inside. Those python files I want to fill in with the text, which is python code. So I want to insert that code as a...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.