Yeah. I've tried this about 50 different ways now. I think the real problem is that $_POST is undefined within my function, but I would really like some clarification on that.
I don't know if $_POST should be defined the instant that the user clicks "submit", or if it only becomes defined as something gets submitted to the server for processing.
In response to your comments, I've stripped out all of my SQL interaction, because that's all working fine. I basically am just trying to establish two things:
1) Can I call a function from a form in this way:
<form action="<?php return someFunction(); ?>">
2) Within said function, should I be able to access values from $_POST?
The goal of this, ultimately, would be to put together an SQL query within the function, update the database with the user supplied values, and conditionally send back a URL for the browser (that would be the return value of the function).
My reasons for this:
1) The Dreamweaver server behaviors all work through a chain of variable reassignments. As such, they execute every time a page loads if $_POST values are set.
2) This means that if you have two forms on a page, and click submit, the submission will execute ALL of the behaviors on the page, because the script will reload, and $_POST will be set.
3) If I can wrap all of these behaviors in a function, they will ONLY execute if explicitly called from the form action.
Sort of a thorny problem. I've been digging around on all the PHP forums for a couple of days now, and haven't found anything yet. I'm sure there's someone more experienced than me that can either tell me how to do this, or tell me why it won't work.
Thanks for your feedback! p r i n t e l e c t r i c