Is there any way we lose the variable value after socket?

Discussion in 'PHP' started by tonyinabox, Jun 29, 2006.

  1. #1
    My friend challenge me to socket his script and grab the content inside the body tag. The page has only 5 - 6 line of html code.

    I can socket and print the result fine, but I can't do anything with the variable to modify the result because if I do something the value lose. So basically I can't grab the content inside body tag.

    I just wonder how can he protect that.

    Anyone know?
     
    tonyinabox, Jun 29, 2006 IP
  2. sgthayes

    sgthayes Peon

    Messages:
    171
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Could you clarify what you mean by "socket" ?

    If the thing is to grab a page why not use curl ? You get the results back in a php var and you can do whatever you like with it.
     
    sgthayes, Jun 29, 2006 IP
  3. tonyinabox

    tonyinabox Peon

    Messages:
    1,988
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    0
    #3
    anything to grab the content

    curl, socket, fopen, fsock

    any of them and any language... mean socket from I said.

    got the same thing,, can't do anything with the result because the result will be gone. you just can print it out.
     
    tonyinabox, Jun 29, 2006 IP
  4. sarahk

    sarahk iTamer Staff

    Messages:
    28,826
    Likes Received:
    4,540
    Best Answers:
    123
    Trophy Points:
    665
    #4
    What page are you grabbing, and what has he challenged you to do?

    I'll play...
     
    sarahk, Jun 29, 2006 IP
  5. tonyinabox

    tonyinabox Peon

    Messages:
    1,988
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    0
    #5
    ok, easy to said than done,,,

    here is his script URL. He dared my to grab the content inside <body></body> if I can. So you can try also. :)

    www . scriptdd . com / software / stop_socket . php

    I am not going to make the link so delete all spaces.
     
    tonyinabox, Jun 29, 2006 IP
  6. sgthayes

    sgthayes Peon

    Messages:
    171
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Why don't you post your code here an I'll have a look at it. If you use curl with the CURLOPT_RETURNTRANSFER option you will get it in a variable.
     
    sgthayes, Jun 29, 2006 IP
  7. sarahk

    sarahk iTamer Staff

    Messages:
    28,826
    Likes Received:
    4,540
    Best Answers:
    123
    Trophy Points:
    665
    #7
    sarahk, Jun 29, 2006 IP
  8. tonyinabox

    tonyinabox Peon

    Messages:
    1,988
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    0
    #8
    wow impressed!

    I can't use just fopen. seem curl is very good.

    No, not school things. LOL my friend just challenged me.

    I'm a poor php stuff.
     
    tonyinabox, Jun 29, 2006 IP
  9. tonyinabox

    tonyinabox Peon

    Messages:
    1,988
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    0
    #9
    doesn't work anymore... he changes something and explode does not work.
     
    tonyinabox, Jun 29, 2006 IP
  10. sarahk

    sarahk iTamer Staff

    Messages:
    28,826
    Likes Received:
    4,540
    Best Answers:
    123
    Trophy Points:
    665
    #10
    I'll have a look tonight but if he's going to challenge you then you should demand he gives you valid html ;)
     
    sarahk, Jun 29, 2006 IP