data passing between sites.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rubberjohn
Forum Contributor
Posts: 193
Joined: Fri Feb 25, 2005 4:03 am

data passing between sites.

Post by rubberjohn »

Hi,

What's the best way to pass form data from one site to another? I have a database attached to one site but my host doesn't allow remote connections (I beleive this is pretty standard) from my other site.

Any help would be great.

Cheers
jothirajan
Forum Commoner
Posts: 69
Joined: Tue Jan 27, 2009 12:06 am

Re: data passing between sites.

Post by jothirajan »

Hey John..

Explain me if the two sites that you have mentioned are yours.

For example if my first site is http://www.test.com with a form

<form action="https://www.test2/com" method="post" name="get_name">
<input type="hidden" name="cmd" value="10909090909">
<input type="hidden" name="cmd11" value="bnnn">
</form>

when you just submit this form from this site http://www.test.com, it will redirect you to the http://www.test2.com

There in the test2.com you can receive this values by simply request the values.

Thanks
JOE...
Get me ... if you want more to make a move
rubberjohn
Forum Contributor
Posts: 193
Joined: Fri Feb 25, 2005 4:03 am

Re: data passing between sites.

Post by rubberjohn »

Hi jothirajan,

Thanks for your reply.

Yes both sites are mine, well as good as.

I cannot use a redirect, the whole process must be transparent to the user - would the post-redirect-pattern work?

Thanks

John
jothirajan
Forum Commoner
Posts: 69
Joined: Tue Jan 27, 2009 12:06 am

Re: data passing between sites.

Post by jothirajan »

See how a shopping cart site works

From a site ex http://www.test.com "some amount of money is transfered" to PayPal or anything else.
correct?

This is taking place due to the hidden text prompt. So

For example if my first site is http://www.test.com and it is coded with the following

<form action="https://www.test2/com" method="post" name="get_name">
<input type="hidden" name="cmd" value="10909090909">
<input type="hidden" name="cmd11" value="bnnn">
</form>

it will submit the form to http://www.test2.com without showing anything transparent to the user


so in the test2.com/inde.html - php or anything else...
request the "cmd" and the cmd value 10909090909 will be declared .........try this.............
good luck
rubberjohn
Forum Contributor
Posts: 193
Joined: Fri Feb 25, 2005 4:03 am

Re: data passing between sites.

Post by rubberjohn »

Hi jothirajan,

Thanks for that mate.

So I can have a form that submits to another site without the user being aware as long as the form elements are hidden. Thanks again I'll give it a go.

J
Post Reply