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!

$_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:
    156
    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

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    3
    Trophy Points:
    68
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

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