program essai
include 'cgi77.fi'
integer*4 foo,method
character addr*42, agent*60
character toto*100, host*100
character referer*200
c -------- must be first. cf CGI protocol
write(6, 1)
write(6, *)
1 format('Content-type: text/html')
call cgi77_marker('ESSAI')
call print_head
write (6,*) '
'
method = cgi77_method()
write(6,100) method
100 format('- request method = ', i2)
foo = cgi77_remaddr(addr)
if (foo .eq. 1) then
write(6,101) addr
else
write(6, *) '
- no IP addr for client ?'
endif
101 format('
- client address = ', a)
foo = cgi77_remhost(host)
if (foo .eq. 1) then
write(6,102) host
else
write(6,*) '
- no hostname for client ?'
endif
102 format('
- client hostname = ', a)
foo = cgi77_uagent(agent)
if (foo .eq. 1) then
write(6,104) agent
endif
104 format('
- user agent = ', a)
foo = cgi77_readparam('toto', toto)
if (foo .ne. 0) then
write(6, 120) toto
endif
120 format ('
- toto = ', a)
c ----- ent of list ---------
write (6,*) '
'
foo = cgi77_referer(referer)
if (foo .eq. 1) then
write(6,105) referer
else
write(6, *) 'use BACK to return to the form ?'
endif
105 format ('back to the form')
call print_end
end
c ----------------------------------------------------------------
subroutine print_head
write (6, 1)
write (6, 2)
write (6, 3)
1 format ('')
2 format ('essai CGI77')
3 format ('')
end
c ----------------------------------------------------------------
subroutine print_end
write (6, 2)
2 format ('')
end
c ----------------------------------------------------------------