21278 Posts in 5728 Topics by 2599 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 355 Views |
-
getting form data from a form

1 November 2011 at 1:51am
Hi everyone
I cant seem to find the simple to answer to getting the actual form data submitted... I think this will show what I am trying to do...
function results($data, $form){
//echo $form;
Session::set('minprice', $data->$minprice);
Session::set('maxprice', $data->$minprice);
Session::set('minbeds', $data->$minprice);
Director::redirect("properties/");
}basically i want to put into the session var the value of the form field submitted.... I cant find documentation on this anywhere!!
In asp i would do something like
MyVar = request.form("FieldName")
Any help would be great!
Thanks
-
Re: getting form data from a form

1 November 2011 at 2:02am
firstly try
Debug::show($data);
to understand what is in the var, then maybe
$vars = $data->postVars();
will provide you data int eh expected $_POST format
-
Re: getting form data from a form

1 November 2011 at 2:07am
thanks for that... however i get
Fatal error: Call to a member function postVars() on a non-object in /var/sites/t/test.jplettings.com/public_html/mysite/code/Page.php on line 61
Any ideas?
//Debug::show($data);
$vars = $data->postVars();
Debug::show($vars);
Session::set('minprice', $data->$minprice);
Session::set('maxprice', $data->$minprice);
Session::set('minbeds', $data->$minprice);
Director::redirect("properties/"); -
Re: getting form data from a form

1 November 2011 at 2:09am
ok, what about the first debug show, doesn't that let you know the class name and data?
-
Re: getting form data from a form

1 November 2011 at 2:10am
This is the data I get...
Debug (Page_Controller->results() in line 60 of Page.php)
url =
/property-holder/54-new-street/SearchForm
minprice =
0
maxprice =
0
minbeds =
1
action_results = -
Re: getting form data from a form

1 November 2011 at 2:18am
no - thats what I needed to know! Thank you
is that standard PHP or SS specific? I am on a big learning curve! cheers
| 355 Views | ||
|
Page:
1
|
Go to Top |


