THIS IS THE FUNCTIONS FILE

<?php
function pf_script_with_get($script) {
	$page = $script;
	$page = $page . "?";

	foreach($_GET as $key => $val) {
	$page = $page .  $key . "=" . $val . "&";
	}
return substr($page, 0, strlen($page)-1);
}

?>


<?php

session_start();
require("Config.php");
require("Functions.php");

//Determine if the user is logged in and can access this page:

require("Functions.php");

if (isset ($_SESSION['ADMIN'])==FALSE) {
	header("Location:Index.php");
	}

//Process the form:
if ($_POST['submit']) {
	$catsql = "INSERT INTO categories VALUES ('" . $_POST['category'] . "')";
	$catresult = mysql_query($catsql);
	header("Location:Index.php");
	}
	else {
		require("Header.php");
	}

?>

SECOND FILE

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Add Category</title>
<h3>Add a new Category</h3>
</head>


<body>
<form action="<?php echo pf_script_with_get($SCRIPT_NAME); ?>" method="post">

<table width="200" border="1">
  <tr>
    <td>Category</td>
    <td><input type="text" name="category"></td>
    
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="submit" value="Add Category"></td>
  </tr>
</table>
</form>




</body>
</html>

Welcome to Daniweb.

Someone added code tags for you so your code is (now) more understandable. The problem is that you didn't state your specific problem or provide any supporting info as to what you have already tried and what it is supposed to do. If you want someone to help you, then you need to show that you are making some effort and trying to make it easy for us to understand the problem.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.