While working with PHP and JQuery I am facing this problem, specially at that time when I click on submit button, call made to JQuery file and check certain validations on the current form and if all are resolved the control should be on the same form but after clicking on the submit button if everything is fine then it displaying error as:
Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.4 (Win32) OpenSSL/1.0.1e PHP/5.5.1
My partial code is as:
<?php
require('PHP/newdep.php');
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<link rel="stylesheet" media="screen" href="css/master.css">
<link rel="stylesheet" media="screen" href="css/menus.css">
<link href="CSS/pstyle.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="JScript/jquery-1.9.1.js"> </script>
<script type="text/javascript" src="JScript/newdep.js"></script>
<title>Phytec India</title>
</head>
<body>
<form action=<?php
if(isset($_POST['s_close']))
{
header("location:department.php");
}
elseif(isset($_POST['submit']))
{
"newdepartment.php";
}
?> method="post" id="ndep">
<div id="welcome">
<div id="welcome_text">Welcome <?php echo "$local_session" ?> <a href="logout.php">Signout</a></div>
</div>
<div id="header">
<div id="header_logo">
<img src="Images/logo.gif" height="29" width="178" />
</div>
</div>
<div id="wrap2">
<p class="validate_msg">Please fix the errors below!</p>
<p> <label for="dep_id">Department Id :</label> <input name="text_depid" type="text" /> <span class="sdepid"></span> </p>
<p> <label for="dep_name">Deparment Name :</label> <input name="text_depname" type="text" /> <span class="sdepname"></span> </p>
<input type="submit" name="btn_save" value="Save">
</form>
</div>