Jump to content


Photo

Help with posting data to another page.


  • Please log in to reply
4 replies to this topic

#1 bigtamt

bigtamt
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 20 April 2006 - 09:07 PM

Hello

I am looking for some help with headers.

I need to open a new web page and “post” data to it. I think I have to use the header commands but I am a bit unsure.

Can any one suggest some basic code to allow me to set up a header (or whatever) that would allow me to do this.

I am know that I could set the location to point to the url and add the different elements (data) onto the end of it but I need to make it private so that people don’t know what data I am posted to the other site.

Any help would be great.

Thanks


#2 insrtsnhere13

insrtsnhere13
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts

Posted 20 April 2006 - 09:55 PM

i think what you want to do is basically type some text into a text box, and have that be outputted onto a different page?

if you want it temporarily im pretty sure headers are the way to go

if you want it permanently youll want to store the text in a database

#3 bigtamt

bigtamt
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 20 April 2006 - 10:06 PM

Hi

Thanks for the info.

Thats what I am doing.

What is happening is a checkout page, the user confirms the amount of goods to buy and then I need to open a new page posting the data from the user and an mysql database.

The problem I am facing is that I need to post all the gather data (user input/mysql) over to paypal so that all the date will not apper in the address bar. ie allow the user to change the data.

so far I ve got something like


[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]header("Location: [MY URL]");[/quote]
I know that using something like
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]header("Location: [MYURL]?current=34&user=66");[/quote]
would work but it would also show the data in the url allowing people to change it.

Any ideas.

Thanks

#4 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 20 April 2006 - 10:55 PM

My terminology is going to be off here -- so if there is a real expert out there, feel free to correct me.

Basically, there are two headers, a request header (like what your browser sends to a) and the HTTP header a website sends back to the browser.

the PHP header is for the latter. To accomplish the former, you'd probably have to create the form and then use a javascript onload method to post that form (Oh, and cross your fingers that the user has javascript on in their browser.)

There are ways to accommodate users who don't have javascript -- like including a "SUBMIT" button they can click on. You could also use an onload method to disable the submit button, (if javascript won't automatically submit the form, it also won't automatically disable the submit button).

#5 michaellunsford

michaellunsford
  • Members
  • PipPipPip
  • Advanced Member
  • 1,023 posts
  • LocationLouisiana, USA

Posted 20 April 2006 - 11:21 PM

if you still want to experiment, I found this neat site that might help:

[a href=\"http://web-sniffer.net/\" target=\"_blank\"]http://web-sniffer.net/[/a]

you can "post" data just like you would using the get method -- at the end of the URL -- just be sure to select the "POST" method on the page.

[a href=\"http://www.example.com?name=bob&address=123%20easy%20street\" target=\"_blank\"]http://www.example.com?name=bob&address=123%20easy%20street[/a]






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users