SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist N9ne's Avatar
    Join Date
    Aug 2002
    Location
    UK
    Posts
    596
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    cURL / PHP Question - How to stop output to browser?

    I have a PHP script setup using cURL to SEND POST DATA to a remote form. Now the problem is after it sends the data, it also follows the POST url so that I get the page I'm POSTing to put out into my browser.

    How do I stop this and simply, say, just echo a message 'done' or something along those lines?

  2. #2
    Romans 12:2 codyrockx's Avatar
    Join Date
    Jul 2003
    Location
    Newberg, Oregon
    Posts
    422
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Small tweak there When using curl, the default setup is so that once the send is done, it outputs the results to the page. Add the following line before your curl_exec, this tells curl to return the page in the form of a variable, which is returned when you run the statement curl_exec.
    PHP Code:
    curl_setopt($chCURLOPT_RETURNTRANSFER,1); 
    Codyrobert.com - Designer and Developer

  3. #3
    SitePoint Wizard Sillysoft's Avatar
    Join Date
    May 2002
    Location
    United States :)
    Posts
    1,691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually if you dont want to store it in a string, just not show it then:

    PHP Code:
     curl_setopt($chCURLOPT_NOBODY,1); 
    Silly


Bookmarks

Posting Permissions

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