button href php code example
Example 1: add link behind a button in html
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<form>
<input type="button" onclick="window.location.href = 'https://www.w3docs.com';" value="w3docs"/>
</form>
</body>
</html>
Example 2: link input button in php
<input type=button onClick="parent.location='index.html'" value='click here'>
Example 3: php button to another page
<?php
if(isset($_POST['submit'])){
header("Location: http://www.example.com/page.php");
exit;
}