Write a cgi program that keeps a list of computers, Computer Engineering

Assignment Help:

Write a CGI program that keeps a list of computers that have contacted the server. If comp1 is contacting first time it will display the message:

"This is the first contact from comp1" else it will display the message

"Computer comp1 has requested this URL previously."

A CGI program which has a list of computers which have contacted the server is as given below:

#!/bin/sh

FILE = ipaddress

echo Content -type: text /plain

echo

# see if IP address computer appears in file ip address

if grep -s $REMOTE_ADDR $FILE>/dev/nul l 2 >&1

then

echo Computer $REMOTE_ADDR has requested this URL previously.

else

# append browser's address to the file

echo $REMOTE_ADDR >> $FILE

echo This is the first contact from computer $REMOTE_ADDR.


Related Discussions:- Write a cgi program that keeps a list of computers

Example calculation of entropy, Example Calculation: If we see an exam...

Example Calculation: If we see an example we are working with a set of examples like S = {s 1 ,s 2 ,s 3 ,s 4 } categorised with a binary categorisation of positives and negati

What is gustafsons law, Q. What is Gustafsons Law? Amdahl's law is app...

Q. What is Gustafsons Law? Amdahl's law is appropriate for applications where response time is significant. On the other hand there are numerous applications that necessitate

What is port, What is port? What are the types of port available? An I/...

What is port? What are the types of port available? An I/O interface having of circuitry needed to connect an I/O device to computer bus. One side consists of a data path with

Differentiate between sequential and combinational circuits, Problem 1 ...

Problem 1 Prove that :- x(x + y) = x by using identities 2 Write a short note on Analog to Digital Converter (ADC) 3 Differentiate between sequential and combinational ci

Explain file transfer protocol, Explain File Transfer Protocol . FTP is ...

Explain File Transfer Protocol . FTP is utilized to exchange files among computer accounts, to transfer files among an account and a desktop computer (upload) or to access softw

What is a fifo, What is a FIFO? FIFO is otherwise known as 'named pipes...

What is a FIFO? FIFO is otherwise known as 'named pipes'. FIFO (first-in-first-out) is a particular file which is said to be data transient. Once data is read from named pipe,

Explain in detail companding, Explain in detail companding. Companding...

Explain in detail companding. Companding: It is the process of compressing and expanding. This includes compressing the signal at the transmitter and expanding this at the re

Explain call by value and call by reference, Call by value and Call by refe...

Call by value and Call by reference Call by value means sending the values of the arguments- The value of each of the original arguments in the calling function is copied in

Classification according to part of instruction and data, Classification ac...

Classification according to part of instruction and data: According to the parts of instruction and data, following parts are identified under this classification: Scal

Determine the framed data including a parity bit, Determine the Framed data...

Determine the Framed data including a parity bit   For illustration when even parity is chosen, parity bit is transmitted with a value of 0 if the number of preceding

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd