Beispiel #1
0
<HTML>
<HEAD>
<TITLE>Student - Entries</TITLE>
<?php 
session_start();
if (isset($_SESSION['access']) && $_SESSION['access'] == '6') {
    if (isset($_POST['SUBMIT2'])) {
        header('location:/sen/Modules/Links_temp/doctor_links.php');
    }
    if (isset($_POST['SUBMIT1'])) {
        $suggestion = $_POST['suggestion'];
        $db_handle = Connect_To_Server();
        $db_found = Connect_To_DB();
        student_entries($suggestion, $_SESSION['login_id']);
        Close_To_Server($db_handle);
    }
} else {
    $_SESSION['access'] = 0;
    session_destroy();
    header('location:/sen/Modules/login.php');
    echo "invalid Login";
}
?>
</HEAD>

<BODY>
	<FORM NAME="form2" METHOD="POST" ACTION="add_suggestion.php" >

		Suggestion: <INPUT TYPE="TEXT"  NAME="suggestion">
		<br>
		<INPUT TYPE="SUBMIT" NAME="SUBMIT1" VALUE="Add Suggestion">
  <div id="container" class="clear">
    <!-- content body -->
		<section align="center">
		<h2 align="center">Student Entries</h2><br>
		<?php 
if (isset($_SESSION['access']) && $_SESSION['access'] == '6') {
    if (isset($_POST['SUBMIT2'])) {
        header('location:/sen/Modules/Links_temp/doctor_links.php');
    }
    if (isset($_POST['SUBMIT1'])) {
        $login_id = $_SESSION['login_id'];
        $resident_id = $_POST['resident_id'];
        $ailment = $_POST['ailment'];
        $db_handle = Connect_To_Server();
        $db_found = Connect_To_DB();
        student_entries($login_id, $resident_id, $ailment);
        Close_To_Server($db_handle);
    }
} else {
    $_SESSION['access'] = 0;
    session_destroy();
    header('location:/sen/Modules/login/login.php');
    echo "invalid Login";
}
?>
		<?php 
function Connect_TO_Server()
{
    $usernamedb = "root";
    $passworddb = "";
    $server = $_SERVER['SERVER_ADDR'];