Forum Moderators: open

Message Too Old, No Replies

Form - performing action on another domain

not working - looking for a clever person

         

stavs

1:07 am on Sep 20, 2001 (gmt 0)

10+ Year Member



I'm losing sleep over this mother. Hopefully, someone else has come across this problem before.

I'm using a form to gather some information and to perform an action (as you do) as follows:

<FORM NAME="myform" ACTION="/cgi-bin/blah-blah-blah" METHOD="post">

and the following triggers the action (its not a traditional submit):

<INPUT TYPE=IMAGE NAME="Click here to get" src="/images/blah.gif">

and its working fine.

BUT...

when I try to use the same form on another domain (I am expecting the action to take the user to a page on the original domain) as follows:

<FORM NAME="myform" ACTION="http://www.original-domain.com/cgi-bin/blah-blah-blah" METHOD="post">

(notice full path added including domain name - also added to the non-trad 'submit' element)

this is where the trouble starts. The action is not being performed.

So, I am looking for a solution. The easy solution would be to have the cgi script hosted on the second domain but this is not possible for various reasons so I have to rule out this possibility. Also, I cannot send the user to the original domain to fill out the form there - also for various reasons.

To make things more difficult, I cannot access the CGI script on the original domain - not an option.

Are there any form/cgi experts amongst us that could help me?

I'm hoping that there is a quick fix....

Key_Master

1:18 am on Sep 20, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The CGI script on the original domain probably does not allow form data to be passed to it from any domain other than the one the script is located in. This is a security feature intended to prevent malicious access from not so friendly visitors. I routinely add similar security enhancements to my own scripts.

stavs

1:44 am on Sep 20, 2001 (gmt 0)

10+ Year Member



Thanks Keymaster - I would have suspected the same given the circumstances.

I am pleased to say that it is now working fine - I made a damn error in one of the options:

typed this:

<OPTION SELECTED>0

should have been:

<OPTION SELECTED VALUE="00">0

crazy mistake which took 2 hours to pick up on - nightmare, but it happens to the best of us ;)

I'm a happy man again - just a shame its nearly 3am and I've got an early start in the morning.

Good Night Keymaster & thanks again.

Marcia

5:25 am on Sep 20, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



With Matt's Formmail you can make an entry within the script itself for which domains can use it.

I once set up a site on space with a major ISP and anyone anyplace could use the "common use" script they provided.