Professional Web Applications Themes

pipe to a script hint - PHP Development

Hi I can feed an email to a php script but am having problems figuring out how to grab the incoming data. At a guess a while loop reading stdin is what i need bit have hit a brick wall. Kram...

  1. #1

    Default pipe to a script hint

    Hi

    I can feed an email to a php script but am having problems figuring out how
    to grab the incoming data.

    At a guess a while loop reading stdin is what i need bit have hit a brick
    wall.

    Kram


    Kram Guest

  2. #2

    Default Re: pipe to a script hint

    *** Kram wrote/escribió (Mon, 30 Aug 2004 11:49:39 GMT):
    > I can feed an email to a php script but am having problems figuring out how
    > to grab the incoming data.
    You have to read it from standard input. Check manual chapter "Using PHP
    from the command line". To sum up, you can use a special URL to open it
    like any other file:

    <?php

    $data=file('php://stdin'); // or fopen() or whatever
    print_r($data);

    ?>



    --
    -- Álvaro G. Vicario - Burgos, Spain
    -- Questions sent to my mailbox will be billed ;-)
    --
    Alvaro G Vicario Guest

  3. #3

    Default Re: pipe to a script hint

    "Alvaro G Vicario" <alvaro_QUITAR_REMOVEtelecomputeronline.com> wrote in
    message news:gj2ht5owuuj4.trshny643ow5$.dlg40tude.net...
    > *** Kram wrote/escribió (Mon, 30 Aug 2004 11:49:39 GMT):
    > > I can feed an email to a php script but am having problems figuring out
    how
    > > to grab the incoming data.
    >
    > You have to read it from standard input. Check manual chapter "Using PHP
    > from the command line". To sum up, you can use a special URL to open it
    > like any other file:
    >
    > <?php
    >
    > $data=file('php://stdin'); // or fopen() or whatever
    > print_r($data);
    >
    > ?>
    >
    >
    >
    > --
    > -- Álvaro G. Vicario - Burgos, Spain
    > -- Questions sent to my mailbox will be billed ;-)
    > --
    Hi

    I found Example 39-1 which works on shell but by changing the code to get
    $data as your example and write out to a file nothing happens when called as
    a pipe from a sendmail alias.

    Kram


    Kram Guest

Similar Threads

  1. code hint javascript api
    By V Gary Nelson in forum Adobe Dreamweaver & Contribute
    Replies: 2
    Last Post: April 2nd, 11:15 AM
  2. ksh script, exit status and pipe
    By Ian Wilson in forum Linux / Unix Administration
    Replies: 1
    Last Post: August 25th, 12:49 PM
  3. A little hint
    By Gustavo Perez in forum Informix
    Replies: 3
    Last Post: August 24th, 12:10 AM
  4. pipe a file to a perl script
    By Asif Iqbal in forum PERL Beginners
    Replies: 0
    Last Post: August 13th, 05:53 AM
  5. Replies: 2
    Last Post: July 2nd, 02:10 PM

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
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139