Email and DHCP exampleI have developed code using ASP and CDONTS which will send an email to the person requesting the information. - The Site Visitor 's DHCP IP
- Date/Time
- The Region From Where The Visitor Has Made a Hit like India, US etc
- Which browser is being used
<% 'code by Manikantan 'Web Developer '3rd Agenda 'Nungambakkam 'Chennai 'India
Dim RIPAddress Dim UAgent Dim strgetTime RIPAddress = Request.ServerVariables("REMOTE_ADDR") reg=split(RIPaddress,".") 'check for American regions ' Increase The Numbers into Subdomains to Find The Exact Location if cint(reg(0))<=207 and cint(reg(0))>=204 then region="North America or South America or Caribbean or Saharan Africa" end if if reg(0)="196" or reg(0)="198" or reg(0)="199" or reg(0)="200" or reg(0)="216" or reg(0)="208" or reg(0)="209" then region="American regions Inclucding Caniberra and Saharian region" end if 'Check for Asian Regions 'Increase the Check for Accuracy if reg(0)="202" or reg(0)="203" or reg(0)="210" or reg(0)="211" or reg(0)="169" or reg(0)="61" or reg(0)="24" then region="Asian pacific region like India,Afghan" end if if region <>"Asian pacific region like India,Afghan" then if region<>"American regions Inclucding Caniberra and Saharian region" then region="European Region,North Africa,Russian region" end if end if UAgent = Request.ServerVariables("HTTP_USER_AGENT") strgetTime = FormatDateTime(Now(),vbLongDate) ' you need cdonts.dll for this ' Anyother Mailer like abmailer.dll can be used instead Dim myMail Set myMail = Server.CreateObject("CDONTS.NewMail") myMail.To = "youremail@home.com" myMail.From = "admin@yourwebsite.com" myMail.Subject = "You Have a Visitor " & strgettime Body = "A visitor had visited your site:" & vbCrlf Body = Body & "His DHCP Ip Was: " & RIPAddress & vbCrlf Body = Body & "His Agent Was: " & UAgent & vbCrlf Body = Body & "Date: " & strgetTime & vbCrlf Body = Body & "The Hit was Approximately From" & vbcrlf Body = Body & "<b>" & region & "</b>" & vbcrlf myMail.Body = Body myMail.Send Set myMail = nothing %>
|
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |
More Database Code Articles More By aspfree developerWorks - FREE Tools! | Download a free trial version of IBM Rational Software Analyzer Developer Edition V7.0 to identify bug defects earlier in the software development cycle. Rational Software Analyzer is an extensible software development solution that reduces the expense of bug-fixes by enabling static analysis code reviews and bug identification very early in the development cycle. FREE! Go There Now!
| | | | Learn how to implement a build management system that uses and extends your existing automation technologies. This tutorial shows, step-by-step, how to install and configure IBM Rational Build Forge to manage builds for Jakarta Tomcat from source code. FREE! Go There Now!
| | | | Listen to this webcast to get an overview of Info 2.0 and a technical demo of how to quickly build an enterprise mashup. IBM's Info 2.0 technology leverages emerging Web 2.0 technologies such as mashups, feeds, AJAX, and JSON in order to simplify assembly of information using feeds and services. Come learn about the technical elements of Info 2.0 including the Feed Generation framework, Mashup Engine, and mashup assembly components. Learn how to pull information from databases, departmental information, and the Web to create mashups critical to your company’s success. We will also discuss best practices to help you get started. FREE! Go There Now!
| | | | Asset Reuse is a key strategy for companies looking to create innovative solutions to solve complex software development problems. Searching for, identifying, updating, using and deploying software assets can be a difficult challenge. Listen to this webcast, to learn about strategies and tools that you can leverage for a successful project, including Rational Asset Manager, Rational Software Architect and WebSphere Service Registry and Repository. FREE! Go There Now!
| | | | Learn how to do more with your reusable assets with the free Rational Asset Manager eKit. The eKit includes demos on how Rational Asset Manager tracks and audits your assets in order to utilize them for reuse. Plus you’ll find white papers and a Webcast that discuss the challenges of a Service Oriented Architecture and how Rational Asset Manager can provide quick and effective solutions. FREE! Go There Now!
| | | | Because access to government information continues to be an area of concern for many U.S. citizens with disabilities, the U.S. government enacted Section 508 of the Rehabilitation Act in 2001 to ensure that government agencies create accessible Web content, enabling all citizens to access the information they need. A fully accessible Web site makes Web content accessible to all individuals, including those with disabilities, who may be accessing Web content via a variety of user agents. Common user agents include standard Web browsers, text-only browsers, assistive devices and mobile devices such as cell phones or personal digital assistants (PDAs). FREE! Go There Now!
| | | | Get a free trial download of the latest version of IBM Rational Functional Tester V7.0.1. Rational Functional Tester is an automated functional and regression testing solution for QA teams concerned with the quality of their Java, Microsoft Visual Studio .NET, and Web-based applications. FREE! Go There Now!
| | | | You can now evaluate IBM Rational Asset Manager V7.0 online without installing or configuring it on your own system! Rational Asset Manager helps create, modify, govern, find, and reuse any type of development assets, including SOA and systems development assets. Rational Asset Manager helps you reduce software development costs and improve quality by facilitating the reuse of all types of software development-related assets. Visit developerWorks to learn more about this product and register to explore its capabilities online. FREE! Go There Now!
| | | | Visit IBM developerWorks to try the IBM SOA Sandbox for process. The SOA Sandbox for process focuses on providing a trial environment with the necessary tooling and components required to gain a better understanding of business processes and how to best improve existing business processes to derive value quickly. FREE! Go There Now!
| | | | With IBM Rational Systems Development Solution, you can deliver products faster with higher quality. Within this kit, Read the “Model Driven Systems Development” white paper to see how to improve product quality and communication. Then check out the rest of the e-Kit to learn more about important topics that can affect the success of any software project through customer examples, tutorials, informative Webcasts, and best practices for designing, building and managing systems. From start to finish, at every stage in your projects, Rational Systems Development Solution can help your company reach its full potential. FREE! Go There Now!
| | | | All FREE IBM® developerWorks Tools! | |