By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,184 Members | 1,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,184 IT Pros & Developers. It's quick & easy.

GET / POST conflict in a multi-page form.

P: n/a
Hi,

Wonder if anyone can help with this problem:

I am using an app with several pages, using a session to track vars
between the pages, and using an image map to re-direct back and
forwards between the pages.

The way I redirect is when the image map is clicked on, it posts to a
page called 'control.php' which passes the POST vars to the
corresponding SESSION variables, then redirects to another page, based
upon the co-ords of where the image map was clicked upon.

I have added text links at the bottom of the page:

i.e.

<--- previous page

----> next page

but because the image map POSTs the data to 'control.php', I can't
really add a GET query string to the link at the bottom of the page,
because nothing will be POSTed.

....But then again, I can't add a POST link to the HREF, because it
won't pass the co-ords, and I can't add a special variable to identify
the link to the control form -i.e. control.php?link=3 (as I could with
a GET) and re-direct accordingly.

So, after hours of thinking about this, I'm stumped.

The only idea I have is to hack the image map up into smaller pieces,
add ALT tags to each one, and make do with it - or add NEXT and
PREVIOUS submit images at the bottom of the page too.

If I make do one with large image map, it is no use to someone who is
visually impaired and relies on ALT wordings.

Is there any possible way to achieve what I am trying to do ?

Any ideas ?

Thanks
Neil.
Jul 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi sentinel!

On 29 Jul 2003 01:48:03 -0700, ne**@sentinel.f9.co.uk (sentinel)
wrote:
Hi,

Wonder if anyone can help with this problem:

I am using an app with several pages, using a session to track vars
between the pages, and using an image map to re-direct back and
forwards between the pages.

The way I redirect is when the image map is clicked on, it posts to a
page called 'control.php' which passes the POST vars to the
corresponding SESSION variables, then redirects to another page, based
upon the co-ords of where the image map was clicked upon.

I have added text links at the bottom of the page:

i.e.

<--- previous page

----> next page

but because the image map POSTs the data to 'control.php', I can't
really add a GET query string to the link at the bottom of the page,
because nothing will be POSTed.

...But then again, I can't add a POST link to the HREF, because it
won't pass the co-ords, and I can't add a special variable to identify
the link to the control form -i.e. control.php?link=3 (as I could with
a GET) and re-direct accordingly.

So, after hours of thinking about this, I'm stumped.

The only idea I have is to hack the image map up into smaller pieces,
add ALT tags to each one, and make do with it - or add NEXT and
PREVIOUS submit images at the bottom of the page too.

If I make do one with large image map, it is no use to someone who is
visually impaired and relies on ALT wordings.

Is there any possible way to achieve what I am trying to do ?

I understand the following: ou use the coordinates of a picture submit
button to do something. I think that is different to an imagemap,
which is a set of GET links.

Bottomline is, that if you want to submit a form, you have to put form
buttons everywhere, you cannot submit it with GET links (JS aside).
Use Pictures for your next/previous links.

HTH, Jochen
--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 16 '05 #2

P: n/a
Hi,

I don't think I explained my problem as well as I could have.

I can use a GIF file as an image map on a multi-page form, and the
form on each page calls a script called 'control.php', which deals
with a lot of session stuff, then at the bottom is the following code:

if ($submit1[0] >=0 && $submit1[0] <=97) {header ('Location:
index.php');}
if ($submit1[0] >=98 && $submit1[0] <=280) {header ('Location:
current.php');}
if ($submit1[0] >=281 && $submit1[0] <=375) {header ('Location:
income.php');}
if ($submit1[0] >=376 && $submit1[0] <=638) {header ('Location:
desired.php');}
if ($submit1[0] >=639) {header ('Location: generate.php');}

This nicely re-directs to the appropriate page, and the user does not
have to see or know about the file control.php

However, this is only one GIF, so I can only use one ALT tag at a
time, whereas the GIF is made to look like five buttons.

I tried adding a text HREF link at the bottom of the page to re-direct
to the previous and next pages, but this by-passes control.php, so had
to be got rid of.

Because this was a problem, I have tried to chop the GIF up into five
smaller GIFs, or include a GIF submit button as a link at the bottom.

However, this means that I have to include new code in control.php
such as:

if ($submit2[0] >=0....
if ($submit3[0] >=0....

Now, this creates another problem, as PHP looks at the first 'submit',
decides it is greater than 0, and usually re-directs me back to the
first page, without ever getting to $submit2

I need to figure out a way for PHP to recognise several submit buttons
on one page, tell the control script which one has been clicked (or
pass the co-ords) then re-direct to the appropriate page.

Rgds
Neil.

Jochen Daum <jo*********@cans.co.nz> wrote in message news:<62********************************@4ax.com>. ..
Hi sentinel!

On 29 Jul 2003 01:48:03 -0700, ne**@sentinel.f9.co.uk (sentinel)
wrote:
Hi,

Wonder if anyone can help with this problem:

I am using an app with several pages, using a session to track vars
between the pages, and using an image map to re-direct back and
forwards between the pages.

The way I redirect is when the image map is clicked on, it posts to a
page called 'control.php' which passes the POST vars to the
corresponding SESSION variables, then redirects to another page, based
upon the co-ords of where the image map was clicked upon.

I have added text links at the bottom of the page:

i.e.

<--- previous page

----> next page

but because the image map POSTs the data to 'control.php', I can't
really add a GET query string to the link at the bottom of the page,
because nothing will be POSTed.

...But then again, I can't add a POST link to the HREF, because it
won't pass the co-ords, and I can't add a special variable to identify
the link to the control form -i.e. control.php?link=3 (as I could with
a GET) and re-direct accordingly.

So, after hours of thinking about this, I'm stumped.

The only idea I have is to hack the image map up into smaller pieces,
add ALT tags to each one, and make do with it - or add NEXT and
PREVIOUS submit images at the bottom of the page too.

If I make do one with large image map, it is no use to someone who is
visually impaired and relies on ALT wordings.

Is there any possible way to achieve what I am trying to do ?

I understand the following: ou use the coordinates of a picture submit
button to do something. I think that is different to an imagemap,
which is a set of GET links.

Bottomline is, that if you want to submit a form, you have to put form
buttons everywhere, you cannot submit it with GET links (JS aside).
Use Pictures for your next/previous links.

HTH, Jochen

Jul 16 '05 #3

P: n/a

"sentinel" <ne**@sentinel.f9.co.uk> wrote in message
news:f1**************************@posting.google.c om...
Hi,

However, this is only one GIF, so I can only use one ALT tag at a
time, whereas the GIF is made to look like five buttons.


Incorrect.

This is more HTML than PHP, here goes.

You can have different alt-texts for different parts of the image map:

<img src="image.gif" alt="alt text for the whole image" width="200"
height="200" border="0" usemap="#Map">

<map name="Map">
<area shape="rect" coords="16,24,41,45" href="#" alt="alt text for image
area 1">
<area shape="rect" coords="83,14,112,44" href="#" alt="another alt text,
image area 2">
</map>

HTH

--
Suni
Jul 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.