Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Pass a variable to PHP Script when piping msg to that script?

Discussion in 'General Discussion' started by doni49, Mar 2, 2007.

  1. doni49

    doni49 Well-Known Member

    Joined:
    Oct 4, 2006
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    156
    I'm piping messages to a PHP script. So far, it's working fine. There's one thing I'd like to add and then I think I've got the whole package of what I'm trying to accomplish done (or at least the hard stuff anyway).

    When writing a PHP script that will be accessed via the browser, I'm able to pass it variables and values as part of the URL and access them via the _GET global.

    How can I pass a variable when piping a message to that script? I'm guessing that I pass it like a command line arg so I'd have something like the following (I'm new to *nix so I may be wrong here):
     
  2. doni49

    doni49 Well-Known Member

    Joined:
    Oct 4, 2006
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    156
    OK--I think I got it.

    argc is the num of args & argv is an array of args--correct?

    I'm out right now--I'll try this when I get home.
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice