0

I have a button in my html form that I want it to take user to food.php when they click on it, I did this but it's not redirecting, Please help

<a href="food.php"> <button name="submit" type="button" id="food">Food - Equipment</button> </a>

3 Answers3

0

Try this:

<a href="food.php" id="food"><button>Food - Equipment</button></a>
Justin Taddei
  • 2,142
  • 1
  • 16
  • 30
0

Why use a button element inside a link tag? Why not just:

<a href="food.php" id="food">Food - Equipment</a>

Try that and see if it fixes it.

Nicholas.V
  • 1,926
  • 2
  • 15
  • 30
0

A button is requested, not a link. Sometimes linked php files don't work as expected in some browsers. Use a form submit button and you'll get what you're looking for.

<form action="food.php" method="GET"> <!-- use get or post if you want
                                        to send anything -->
<input type="submit" value="GO">
</form>
Vbudo
  • 405
  • 4
  • 9