I have a selection form and I want the input type to be a button that calls a PHP function. I need the PHP function to know what the selection value is for the form and I also need to have the variable for the database connection that I opened previously.
I think that the database connection variable should be sent as a parameter, and the selection value should probably not be sent as a param but be retrievable from within the PHP function. I can’t figure out how to do either of these things though, from online examples.
EDIT – Actually, it doesn’t even seem to be calling my function even without arguments.
<input type=”button” name=”ddd” value=”ddssd” onclick=”test()”>
only seems to work if test() is a javascript function…is there no way to call a php function this way? Is it absolutely necessary to create a separate php file and then use the action=”ddsds.php”?