l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
November 4: Social gathering
Next Installfest:
TBD
Latest News:
Oct. 24: LUGOD election season has begun!
Page last updated:
2001 Dec 30 16:59

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] cgi question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] cgi question


  • Subject: Re: [vox-tech] cgi question
  • From: Micah Cowan <micah@cowanbox.coMAPSm>
  • Date: Thu, 21 Dec 2000 11:01:14 -0800
  • References: 20001221094230.A9190@dirac.org

On Thu, Dec 21, 2000 at 09:42:30AM -0800, Peter Jay Salzman wrote:
> dear all,
> 
> i have a form page (form.html) -- the user enters data and it calls a cgi
> script (cgi1.pl).
> 
> the cgi script saves the data to a file.
> 
> at this point i would like to put up a map, have the user click on it and
> save the (x,y) value to the file that cgi1.pl just wrote.
> 
> what's the best way to do that?  at this point, i have two options:
> 
> 1. have cgi1.pl put the map up after it saves the datafile.  i'm not sure
>    how to collect the (x,y) data.

There are two ways to collect the x,y data.

1) Use a regular image map.  This means you just put the image in an
anchor ("A" element) and make sure and put the ismap attribute in (use
ismap="ismap" to be XHTML compliant - but that may break some
browsers).  The coordinates will be passed by attaching "?10,20" or
whatever to the anchor's url.

2) You can use the <input type="image"> construct in a form, in which
case the coordinates will be passed depending on the control's name.
For instance, if you do something like <input type="image"
src="foo.gif" alt="an image" name="foo"> (actually, in HTML 4.0 you
are supposed to use id="foo" rather than name="foo").  The coordinates
will be passed attaching something like foo.x=10&foo.y=20 - you get
the idea.

> 
> 2. have cgi1.pl call another webpage that puts the map up and collects the
>    (x,y) data.   the html page will have to call another cgi script to
>    write the coordinate data, but i'm not sure how to make the new cgi "know"
>    which data file we just wrote to.

You will need to generate the webpage from the cgi, rather than redirect
to another.  Put the coordinate data somewhere in hidden fields in the
form which calls the new cgi, or attach it directly as query strings
to any anchor tags which call the new cgi.

> 
> this is the first time i've ever seriously played around with cgi.  any
> guidance would be really appreciated!
> 
> pete
>  

Ciao,

Micah


LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!