I'm trying to do script which is sends information to SQL, but I have problem with submit button and form radio, can anyone help me with it?
This IF doesn't work properly
if (isset($_POST['test'])) {
if(isset( $_POST['odp']))
This is all code of PHP http://wklej.org/id/1003412/
For one, after viewing your code it seems that you would do best to combine the two if's, as below:
if ((isset($_POST['test']) && isset( $_POST['odp']))
{
code to execute;
}
What are the values you are getting for isset( $_POST['test']) and isset( $_POST['odp'])? You may want to try echoing them out to see if they are the actual values you are expecting. You also can try echoing something right after the two if(isset's, as it may be part of the executed code that is not working, and not the actual if statements.
empty($_POST['test']) may work better as well, same as poster above stated.
For the header, in the code you provided you currently have that line commented out. Another tip is that a header redirect must be done before anything is outputted, you currently have it after a print line and a few echo lines. To fix this, you can move it to a function above all of the other code, and then call that function when needed.
Edit: This was meant to answer the last question posted on this page.