Jump to:

23377 Posts in 18296 Topics by 2867 members

General Questions

SilverStripe Forums » General Questions » SS 2.3 - Capture $_POST variables

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1400 Views
  • Ryan M.
    Avatar
    Community Member
    309 Posts

    SS 2.3 - Capture $_POST variables Link to this post

    I'm wondering how to capture variables posted back from an external website.

    Whenever I try, I get an error like:

    [Notice] Undefined index: customer_fname
    GET /register/approved

    Line 25 in /var/www/vhosts/domain.com/subdomains/subsite/httpdocs/mysite/code/RegistrationPage.php
    Source

    16       parent::init();
    17    }
    18
    19    static $public_actions = array (
    20       'doRegister'
    21    );
    22    
    23    public function approved() {
    24       if(isset($_POST)) {
    25          $con = "Full Name: ".$_POST["customer_fname"]." ".$_POST["customer_lname"]."<br />";
    26          $con .= "E-mail Address: ".$_POST["email"]."<br />";
    27          $con .= "Username &amp; Password: ".$_POST["username"]." / ".$_POST["password"]."<br />";
    28          $con .= "Subscription Amount: ".$_POST["recurringFormattedPrice"];
    29       } else
    30          $con = "oops!";
    31

    Am I doing it right?

  • emp4180
    Avatar
    Community Member
    5 Posts

    Re: SS 2.3 - Capture $_POST variables Link to this post

    is there no one to answer this?

    1400 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.