Can anyone point me in the right direction? I'm not even sure what to google here . . .
I have a module I built that's working. It's a block form that has two data items: say "amount" and "number."
These data are used as variables in some if/elseif code I have going that then sends the user to a particular page conditioned on the data inputs. Great.
But I also want to echo back those two pieces of data in that page--since these pages are views displays, I'd put the echo code in the header area of the view display using, I assume, some combination of HTML and PHP.
But I have no idea where to look for guidance on this matter. Is it a function? Are my $amount and $number variables in any way available to that view display that comes up? I just want the data entered echoed back to the user to confirm what he or she used as input in the block form. Note the page display is not the form. The form is a block positioned in Sidebar First.
Any help?
Dan

Comments
Dan, glad you got your form
Dan, glad you got your form working! Unfortunately you won't be able to reference your variables from the view, but in your form submit handler, you can use drupal_set_message() to have them included in a message on the next page the user visits, in this case your views page.
Oh, thanks Sam. Yes, the set
Oh, thanks Sam. Yes, the set message could be sufficient.
I guess you are saying that even if I used PHP in the global text area, I can't get to those variables. OK. You saved me hours of looking! I might have thought that I could save to the database somehow and then draw out? But I can see where that would create all kinds of complications if many users did this at once and so forth.
I'll use the _message idea.
Thanks so much!
function
function propertyfilter_form_submit ($form, &$form_state) {$amount = $form_state['values']['annual_income'];
$number = $form_state['values'] ["number_in_family"];
drupal_set_message ($amount, $type = 'status', $repeat = TRUE);
In this one, I am seeing the value of $amount appear in the message, but would love to have some text or HTML around it. So it displays
Your annual amount is: $amount.
I've been looking under the set_message instructions, but perhaps this is a more general issue related to text strings and variables combined?
Dan, you can concatenate two
Dan, you can concatenate two values together with a period. So here is one way you achieve what you want:
$message = 'Your annual amount is: ';drupal_set_message ($message . $amount, $type = 'status', $repeat = TRUE);
Or you can concatenate $amount when you create $message like this:
$message = 'Your annual amount is: ' . $amount;drupal_set_message ($message, $type = 'status', $repeat = TRUE);
Ah, very cool! That works
Ah, very cool! That works well.
And I tried adding multiple messages and that worked too.
$message = 'Your annual amount is: ';drupal_set_message ($message . $amount, $type = 'status', $repeat = TRUE);
$message2 = 'The number in your household is: ';
drupal_set_message ($message2 . $number, $type = 'status', $repeat = TRUE);
I'm just learning PHP. So thanks for the help!
Now I'll figure out how to perhaps add some HTML or .class or something so I might theme it easier. :)
Dan