Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-07-2009, 06:21 PM   PM User | #1
hey101
New to the CF scene

 
Join Date: Feb 2009
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
hey101 is an unknown quantity at this point
php pass variables to another php

Well basically here is what I have so far. I have a form where a user inputs things. Then It sends it to a php script which does some work with it. What I want it to do is have a user send enter the stuff in the form, it then gets submited to my script, and my script passes the variables onto another website.

Now I already have the variables sent via post to my script. I need them to be sent on to the other website using post too. I have no control over the other website. I just know what variables i have to send. And i do not want the user to have to enter his info all over again just so it gets sent to the other site.

So how can i pass along post variables?

I asked at another forum and they said i was trying to do something fishy. well im not because:

Its a guys website at my school. He just wants an extra layer of security to where u have to go through my site to get to his. Kinda weird i know but he already has it setup on his side and is reluctant to change it. So I already have everything setup accept this. cookies and all that.
hey101 is offline   Reply With Quote
Old 05-07-2009, 07:39 PM   PM User | #2
mlseim
Master Coder

 
mlseim's Avatar
 
Join Date: Jun 2003
Location: Cottage Grove, Minnesota
Posts: 9,045
Thanks: 8
Thanked 1,029 Times in 1,020 Posts
mlseim has a spectacular aura aboutmlseim has a spectacular aura aboutmlseim has a spectacular aura about
You will have to send them using $_GET ... so you attach the variables to his URL,
and he then has to read them. He cannot read your cookies or sessions and even
with $_GET and $_POST, he will need to be able to accept your variables ... so he
defines the variables that you send?

You mentioned using POST only, but forms are really the only way. You would have
to redisplay the form (with the variables in place) and ask the user to submit again
to POST to his site. Otherwise, use fsockopen() to connect with the server and construct the HTTP request yourself ... which is pretty advanced (I don't know much about it).

Who really wants the data, you or him?
Why do both of you need the form data?
mlseim is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:00 PM.


Advertisement
Log in to turn off these ads.