Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

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

SS 2.3 - Capture $_POST variables


Reply


2 Posts   1461 Views

Avatar
Ryan M.

Community Member, 309 Posts

15 May 2010 at 4:10am

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? :p

Avatar
emp4180

Community Member, 5 Posts

28 October 2011 at 12:37am

is there no one to answer this?