Results 1 to 18 of 18

Thread: Hey php folks

  1. #1
    Adminstrator of PAIN
    Norm In Norman's Avatar
    Location
    No.
    Posts
    13,371
    vCash
    500

    Hey php folks

    I'm wanting to post some form variables to another page so I don't have to change the code on the page I'm going to (since it isn't my code). I'm trying to implement this:

    http://www.zend.com/zend/spotlight/m...0&view=1#notes

    but I'm using an SSL connection. I changed the code to use https instead of http in the header and I get this back from the server:
    Bad Request
    Your browser sent a request that this server could not understand.

    The request line contained invalid characters following the protocol string.
    I assume that it's wanting encrypted data after it sends the protocol. Am I right? Is it worth it for me to try and figure out how to encypt it?

    I figure I might as well ask this here. What the hey? Someone might know.

  2. #2
    SoonerFans.com Elite Member 1stTimeCaller's Avatar
    Location
    here and there
    Posts
    13,427
    vCash
    500

    Re: Hey php folks

    yes.
    one day

  3. #3
    SoonerFans.com Elite Member 1stTimeCaller's Avatar
    Location
    here and there
    Posts
    13,427
    vCash
    500

    Re: Hey php folks

    no.
    one day

  4. #4
    SoonerFans.com Elite Member
    Location
    Norman, OK
    Posts
    23,620
    vCash
    500

    Re: Hey php folks

    Quote Originally Posted by Norm In Norman
    I assume that it's wanting encrypted data after it sends the protocol. Am I right? Is it worth it for me to try and figure out how to encypt it?
    Invalid character--maybe you just need to URL-encode the data? I think PHP has URL-encoding functions.
    I'm not happy until you're not happy.

  5. #5
    Adminstrator of PAIN
    Norm In Norman's Avatar
    Location
    No.
    Posts
    13,371
    vCash
    500

    Re: Hey php folks

    more info

    Here are the headers that link is sending:
    Code:
    POST /foo/index.php HTTP/1.1
    Host: <A HREF="http://www.zend.com:80/">www.zend.com:80</A>
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 42
    var1=Hello&var2=Zend%20Is%20Cool
    Here are the headers I am sending:
    POST /eft/menu.php HTTPS/1.1
    Host: www.server.com
    User-Agent: PostIt
    Content-Type: application/x-www-form-urlencoded
    Content-Length: 11
    pwsend=true

  6. #6
    Adminstrator of PAIN
    Norm In Norman's Avatar
    Location
    No.
    Posts
    13,371
    vCash
    500

    Re: Hey php folks

    Quote Originally Posted by mdklatt
    Invalid character--maybe you just need to URL-encode the data? I think PHP has URL-encoding functions.
    i'm not sure what that is, but I guess it gives me something to look up. I'm a bit of a noob to this stuff. Maybe not a noob, but this stuff is a bit advanced compared to what I've been doing and I know almost nothing about sending headers to a server - except to redirect which I use all the time.

  7. #7
    Adminstrator of PAIN
    Norm In Norman's Avatar
    Location
    No.
    Posts
    13,371
    vCash
    500

    Re: Hey php folks

    Ok, I see there is something called urlencode in their example. I'm looking into it.

  8. #8
    Adminstrator of PAIN
    Norm In Norman's Avatar
    Location
    No.
    Posts
    13,371
    vCash
    500

    Re: Hey php folks

    Oh - that just replaces special characters with %hexvalue.

  9. #9
    Adminstrator of PAIN
    Norm In Norman's Avatar
    Location
    No.
    Posts
    13,371
    vCash
    500

    Re: Hey php folks

    Which is what you were wanting me to do. Duh. And it makes no difference with my example.

  10. #10
    SoonerFans.com Elite Member
    Location
    Norman, OK
    Posts
    23,620
    vCash
    500

    Re: Hey php folks

    Quote Originally Posted by Norm In Norman
    Which is what you were wanting me to do. Duh. And it makes no difference with my example.
    You don't need URL-encoding in your example, so that wasn't it. I don't know much about HTTPS or sending raw headers but two things come to mind.

    1) Your Host line doesn't look like the sample Host line; your URL isn't in the same format.

    2) Does your stuff work using plain HTTP? Maybe the HTTPS is tripping it up. HTTPS doesn't use port 80--are you using the right port? There has to be some kind of authentication with HTTPS, doesn't there? Maybe your header is incomplete.
    I'm not happy until you're not happy.

  11. #11
    Adminstrator of PAIN
    Norm In Norman's Avatar
    Location
    No.
    Posts
    13,371
    vCash
    500

    Re: Hey php folks

    Maybe the port 80 thing is the problem. i changed it to port 443 and I get no errors. i get no output too.

  12. #12
    Adminstrator of PAIN
    Norm In Norman's Avatar
    Location
    No.
    Posts
    13,371
    vCash
    500

    Re: Hey php folks

    Oh, and I'm pretty sure that anchor stuff is just them forgetting that the code was in preformat tags.

  13. #13
    SoonerFans.com Elite Member NormanPride's Avatar
    Location
    :noitacoL
    Posts
    17,021
    vCash
    500

    Re: Hey php folks

    Don't you need SOAP or something to handle HTTPS? Or am I thinking of something else?
    Quote Originally Posted by badger
    I'm changing your sig while you're not looking while I borrow your computer.

  14. #14
    Adminstrator of PAIN
    Norm In Norman's Avatar
    Location
    No.
    Posts
    13,371
    vCash
    500

    Re: Hey php folks

    I think I'm giving up. It was just an enhancement anyway. Sometime when I have enough time maybe I'll learn all about headers and SSL.

  15. #15
    Adminstrator of PAIN
    Norm In Norman's Avatar
    Location
    No.
    Posts
    13,371
    vCash
    500

    Re: Hey php folks

    I think SOAP has something to do with web services - another thing I'm clueless about.

  16. #16
    SoonerFans.com Elite Member NormanPride's Avatar
    Location
    :noitacoL
    Posts
    17,021
    vCash
    500

    Re: Hey php folks

    Yeah, you need to write a webservice to handle HTTPS I think. It handles all the data transfer. But I'm pretty shady on this subject, and you know what they say about a little knowledge...
    Quote Originally Posted by badger
    I'm changing your sig while you're not looking while I borrow your computer.

  17. #17
    SoonerFans.com Elite Member
    Location
    Norman, OK
    Posts
    23,620
    vCash
    500

    Re: Hey php folks

    Quote Originally Posted by Norm In Norman
    Maybe the port 80 thing is the problem. i changed it to port 443 and I get no errors. i get no output too.
    I think you have to have a lot of extra stuff going on to get HTTPS to work. HTTPS is encrypted so you have to arrange for a key exchange. Authentication is probably involved with this.
    I'm not happy until you're not happy.

  18. #18
    SoonerFans.com Elite Member NormanPride's Avatar
    Location
    :noitacoL
    Posts
    17,021
    vCash
    500

    Re: Hey php folks

    yeah, you need a certificate written as well. There's a lot going on just to encrypt some stuff. Seems silly sometimes.
    Quote Originally Posted by badger
    I'm changing your sig while you're not looking while I borrow your computer.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •