Jump to:

17488 Posts in 4473 Topics by 1978 members

Archive

SilverStripe Forums » Archive » SS 2.3 - Capture $_POST variables

Our old forums are still available as a read-only archive.

Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo

Page: 1
Go to End
Author Topic: 1022 Views
  • Ryan M.
    Avatar
    Forum Moderator
    304 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
    4 Posts

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

    is there no one to answer this?

    1022 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.