How to pass POST data without a form?

Discussion in 'PHP' started by bobby9101, Jul 6, 2007.

  1. #1
    Hi, i am using the header() function to change the $_GET data, but I want to send some $_POST data along with it, how do I do that?
    I hope I was clear, if I wasn't I will post an example
     
    bobby9101, Jul 6, 2007 IP
    neroux likes this.
  2. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #2
    ansi, Jul 6, 2007 IP
  3. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #3
    From my experience it's nearly impossible to do it easily, and many times just impossible.

    There are ways to do it with curl, and using http streams, and a few other functions. Unfortunately, there is not any way to set a post variable with a header("... function. Since you cant use a header function, it's pretty much impossible to redirect a user and include post data with them. This only allows php to post to a page, the user would not be redirected at the same time.

    Anyway, start looking for 'curl post data', 'php http stream', and 'fsocketopen'.

    Is there no way to use the GET function for what you are trying to accomplish?
     
    jestep, Jul 6, 2007 IP
  4. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #4
    other than that you can pass the "wanna-be" post data along in a session with the redirect if it is within the constructs of your domain.
     
    ansi, Jul 6, 2007 IP
  5. Gangsta

    Gangsta Active Member

    Messages:
    145
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5
    If I undestand you correct you may use curl for this
    tell me more and I will explain you
     
    Gangsta, Jul 6, 2007 IP
  6. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Hi, I figured a workaround.
    I wrote all the data into a text file, then on the other page opened it, and read it then deleted it
     
    bobby9101, Jul 7, 2007 IP