I can't seem to get my head around this: I am trying to understand what the accepted way in elgg is to make a form, point it to some processing code, and redirect to some other page, with a message: "everything ok!".
I understand how to make the form using the template system. Everywhere in elgg there are these xxx_actions.php files. But the form action atribute points sometimes to index.php, or is empty. How does the code in xxx_actions get executed? More to the point: is that still the way we should do things?

Comments
If you're looking for the way to do things, ignore everything in /units/ - this is all code we're phasing out before version 1.0.
Generally we're avoiding action at a distance these days, and posting back to a specific page. Pointing to an index.php is fine, or an actions.php might be neater. Then you want to:
- Set $_SESSION['messages'] = $messages;
- Redirect to the page of your choice
- Stop execution here
This will eliminate the "back button problem" of yore (i.e., avoid stuff being reposted), and allows for cleaner URLs.Ok, thanks Ben. That is what I did, but when I redirect to a users profile page, using
[ocde=PHP]
$_SESSION['messages'] = $messages;
header("Location: " . redirect_url);
exit;
[/PHP]
The messages are not shown. I checked the $_SESSION variable, and my message is there. So now I have another question: how does one force the messages to get shown?