I created a 2 functions, the first one is displayed with a next button, when the button is clicked the second function is displayed with two buttons, previous and submit.
first function:
<?php
function Programme()
{
?>
```html
<!--programme details-->
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
<label>Programme ID: <input type="text" name="progid" /></label><br />
<label>Programme Name: <input type="text" name="progname" /></label><br />
<label>Qualification: <input type="text" name="qualification" /></label><br />
<label>Graduation Year: <input type="text" name="gradyear" /></label><br />
<input type="button" name="next" value="Next" accesskey="Enter" />
</form>
<?php
}
?>
second function:
```php
<?php
function Employment()
{
?>
```html
<!--employment details-->
<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post">
<label>Employee: <input type="text" name="employee" /></label><br />
<label>Status: <input type="radio" name="status" />Full Time
<input type="radio" name="status" />Part Time</label><br />
<input type="submit" name="previous" value="Previous" />
<input accesskey="Enter" type="submit" name="submit" value="Submit" />
</form>
<?php
}
?>
```php
<?php
Student();
if (isset($_POST['next']) && $_POST['next']=='Next')
{
Programme();
if (isset($_POST['previous']) && $_POST['previous']=='Previous')
{
Student();
else
{
header ("Location:thankyou.php"); //thank you page
}
}
}
?>
The problem is when I click the next button the second function ‘Employment();’ should be displayed.
Whats wrong with the code?