Jump to content

Form processing, inputfields whith hyphen in name.


NorbertH
 Share

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...