NorbertH Posted December 19, 2018 Share Posted December 19, 2018 I have an issue while processing a form in PW // Variant 1 html <button tabindex="-1" id="reset-button" name="reset-button" value="reset" class="btn btn-info" type="send">Form Reset</button> // Variant 1 php if ( !empty ($input->post->reset-button)) .... // Variant 2 html <button tabindex="-1" id="reset-button" name="reset_button" value="reset" class="btn btn-info" type="send">Form Reset</button> // Variant 2 php if ( !empty ($input->post->reset_button)) .... When using a hyphen ( Variant 1) i get an notice : Quote PHP Notice: Use of undefined constant button - assumed 'button' in ..... Assuming a constant whith value "button" then results in several follow up errors, but thats not relevant. When using the underline, everything is ok , when using $_POST['reset-button'] directly i encounter no issues. I am absolutely confused by this. Any ideas whats going wrong here ? Link to comment Share on other sites More sharing options...
adrian Posted December 19, 2018 Share Posted December 19, 2018 You can use: $input->post('reset-button') or $input->post->{'reset-button'} This is not a PW issue, but rather a PHP one - you just can't use hyphens like that. That is why PW field names use underscores and not hyphens. 5 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now