/    Sign up×
Community /Pin to ProfileBookmark

Post data in PHP

Hello,

How do I post data to another website using php. Basically, here is what I want to do:

1)User fills out text fields and presses Submit button on html page A.
2)Data is posted to a php script B.
3)Data is cleaned up and additional data is added.
4)New data is automatically posted to another html page C.
5)User automatically arrives at page C and new data is displayed using php.

I need help with steps 4 and 5.

Thank you.

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@chucknasty74Aug 08.2005 — you can do all that on one page:

<html header, etc>

<body>

<?php

#take care of clean up and add data (page b)

#use if statements w/ print(); to write page c

e.g print("

well formatted info layout $data<br>

well formatted info layout $data

<tag name="escaped_name">name</tag>

etc.

");//end of print

?>

</body>
Copy linkTweet thisAlerts:
@cberg76authorAug 08.2005 — I wish it was that simple. I don't have access to specific data that I need until I get to the script page. The data is in a client side shopping cart using javascript and gets posted along with the user information. I can't access it until I get to the intermediate script page. That is the main the reason I need the intermediate script. For now, Page C is really just a page for me to see what I am really posting after the script modifies and adds data, but eventually Page C will be the payment processor at another web address.
Copy linkTweet thisAlerts:
@chucknasty74Aug 08.2005 — wait, after rereading, I get you. Can't you just post frompage b to the absolute href of page c?:

<form name=page_b_form action=http://www.c.com/page_c.php method=post>

<input type=hidden value=$php_var>

</form>

and call some javascript once all your data is stored:

function submitPartialData () {

document.<formname>.submit();

}
Copy linkTweet thisAlerts:
@cberg76authorAug 10.2005 — Hey thanks!!! That really worked great and was a better solution than trying to reinvent the wheel with a serverside form submission. I appreciate the assistance.
×

Success!

Help @cberg76 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...