How to make a button in PHP, send data to my mysql table?

Asked

Viewed 1,860 times

3

I put a button on my page to send the registered data to a table in mysql.

<button type="button" class="btn btn-block btn-primary">CADASTRAR</button>

how do I click on the button it makes the operation to register in the table, the examples I find is only with the method

<input type="submit">Cadastrar

I wanted to do with a button that I customized, as I do ?

Thank you

  • The button you customized is an image? an html element? Ask the question too

  • is an html element, I used css, that’s all.

  • Use type="Submit" on your button

  • I’m new to this, the button is created by bootstrap.

  • But change type="button" for type="submit"

  • I understand I’m going to test here, thank you

  • It worked, thank you :)

Show 2 more comments

1 answer

2


Change:

<button type="button" class="btn btn-block btn-primary">CADASTRAR</button>

For:

<button type="submit" class="btn btn-block btn-primary">CADASTRAR</button>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.