473,797 Members | 3,196 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert a smail php script in ASP

Hello,
I have this small php script

<?
$ip=getenv(REMO TE_ADDR);
$agent=getenv(H TTP_USER_AGENT) ;
{
$c_date=GetDate (time());
$x_day=$c_date["mday"];
$x_month=$c_dat e["mon"];
if ($c_date["mday"]*1<10)
{
$x_day="0".$c_d ate["mday"];
}
if ($c_date["mon"]*1<10)
{
$x_month="0".$c _date["mon"];
}
$mydate=$c_date["year"].$x_month.$x_da y;
$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("$fi lelog", "a");
if ($fic)
{
fputs($fic, $liste_valeurs . "\n");
fclose($fic);
}
}
Header("Locatio n: $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 1175
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%******** ********@TK2MSF TNGP12.phx.gbl. ..
Hello,
I have this small php script

<?
$ip=getenv(REMO TE_ADDR);
$agent=getenv(H TTP_USER_AGENT) ;
{
$c_date=GetDate (time());
$x_day=$c_date["mday"];
$x_month=$c_dat e["mon"];
if ($c_date["mday"]*1<10)
{
$x_day="0".$c_d ate["mday"];
}
if ($c_date["mon"]*1<10)
{
$x_month="0".$c _date["mon"];
}
$mydate=$c_date["year"].$x_month.$x_da y;
$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("$fi lelog", "a");
if ($fic)
{
fputs($fic, $liste_valeurs . "\n");
fclose($fic);
}
}
Header("Locatio n: $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
2283
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 -- giving the user some simple options). How can I make this happen? thanks, Harlin
2
16056
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 these scripts so that they will work with SQL Server? Anyone have any ideas (other than manually converting them)? Thanks,
2
2219
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
7061
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
8577
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 usp_generatetable(@prm_tableID int, @prm_langID int) as
9
8560
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 this script: <a href="#" onclick="MM_goToURL('parent.frames','color2.html');return document.MM_returnValue">TEST</a> ....to something that I can use within a Flash movie, which as far as I can tell means that it needs to reside in the...
5
1586
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 researching it for a few days. I feel like it's a little over my head. Or am I looking too much into it? Or maybe I'm looking in the wrong places. Is there a straightforward way to convert this script and run it on Linux? Or can anyone direct me to...
7
1689
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 components I have to install in our system to run the perl script.My operating system is Windows XP. And how to compile and run the script.Here my major problem is script is not opening.Is there any other alternative to open the script.That file is in .cgi...
2
1288
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 the KeywordToolExternal url ?
2
1682
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 text. The problem is that the code contains commands which are not recognizable as a text. Can you tell me, please, how to force python to consider code as a text. Thanks in advance. Here is my code: import os import shutil
0
9537
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10469
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10023
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9066
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7560
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2934
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.