Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jan 2005
    Posts
    93
    Thanks
    4
    Thanked 0 Times in 0 Posts

    php://input example

    hello,
    could someone show an example of how to use the php://input wrapper? couldn't find one in the manual.

    any help would be greatly appreciated.


  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts

  • #3
    New Coder
    Join Date
    Jan 2005
    Posts
    93
    Thanks
    4
    Thanked 0 Times in 0 Posts
    hi, thanks for your reply
    unfortunately, this page is at the origin of my question... so unfortunately it doesn't help, but thanks anyway

    Can something like this be done?
    PHP Code:
    $roughHTTPPOST php://input; 
    I hope you know what I'm trying to do now.


  • #4
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Yeah, had a look at the page myself and couldn't really see any examples. Can't even find any on google and I've never used it before, so unfortunately can't help you

  • #5
    Regular Coder
    Join Date
    Feb 2005
    Location
    West Midlands, UK
    Posts
    623
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can use it the same way as it shows on that page for php://filter, in other words:
    PHP Code:
    $roughHTTPPOST readfile("php://input"); 
    That works for me, anyway. Try this little script to see if it works for you:
    PHP Code:
    <?php
    if(!isset($_POST) || empty($_POST)) {
        
    ?>
        <form name="form1" method="post" action="">
          <input type="text" name="textfield"><br />
          <input type="submit" name="Submit" value="Submit">
        </form>
        <?php
    } else {
        
    $roughHTTPPOST readfile("php://input");
        echo 
    $roughHTTPPOST;
    }
    ?>

  • #6
    New Coder
    Join Date
    Jan 2005
    Posts
    93
    Thanks
    4
    Thanked 0 Times in 0 Posts
    thank you very much
    worked great


  •  

    Posting Permissions

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