# Php help

**URL:** <https://forum.kirupa.com/t/php-help/230586>\
**Category:** Uncategorized\
**Created:** [June 27, 2007, 1:33pm UTC](https://forum.kirupa.com/t/php-help/230586 "2007-06-27T13:33:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Utech22](https://avatars.discourse-cdn.com/v4/letter/u/f17d59/32.png) [@Utech22](https://forum.kirupa.com/u/Utech22)\
**Post date:** [June 27, 2007, 1:33pm UTC](https://forum.kirupa.com/t/php-help/230586/1 "2007-06-27T13:33:33Z")

</div>

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
<?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 } ?\>

````auto

 
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 } ?\>

````auto

 

```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?
