The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

$_GET and $_POST in Live PHP plugins

Discussion in 'cPanel Developers' started by timdorr, Jul 21, 2011.

  1. timdorr

    timdorr Well-Known Member
    PartnerNOC

    Joined:
    Jul 9, 2002
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Atlanta, GA
    I've got a Live PHP plugin that's expecting input from a form. However, when I look in $_GET, $_POST, $_REQUEST, or anywhere (even $GLOBALS), I don't see my input. Am I looking in the wrong place?

    I've hacked around it by using a GET form and this code:

    PHP:
    parse_str$_SERVER['QUERY_STRING'], $input );
    But I don't consider that ideal. I must be missing something.
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi timdorr,

    I can't reproduce your problem. Maybe I'm mis-interpreting your issue. The following was my test:

    form.live.php:
    PHP:
    <html>
    <
    form method="get" action="formrender.live.php">
      <
    input type="text" name="myvar" id="myvar" />
      <
    input type="submit" value="Submit"/>
    </
    form>
    </
    html>
    formrender.live.php
    PHP:
    <html>
    <pre>
    <?php
    var_dump
    ($_GET);
    ?>
    </pre>
    </html>
    1) Adding those files to /usr/local/cpanel/base/frontend/x3/
    2) in a browser, login to cPanel and navigate to $server:$port/$cpssession/frontend/x3/form.live.php
    3) enter some text in the input field and hit submit
    4) should load the formrender.live.php and have a dump of the input_varname=>text_you_typed

    Best Regards,
    -David
     

Share This Page