示例#1
0
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
  </head>
  <body>
  <?php 
include 'header.php';
?>
  <!-- Current info is indicated as light gray in the initial input. Replace with wanted Data -->
    <div id="login">
      <div id="form">
			<div class="top">
			<h2>Edit Student Information<span class="login-create"></span></h2>
			<form action="StudProcessEdit.php" method="post" name="Edit">
			<div class="field fancy-form">
				<label for="firstN">First Name</label>
				<input id="firstN" size="30" maxlength="50" type="text" name="firstN" required value=<?php 
echo getStudentFirstNameByID($_SESSION["studID"]);
?>
>
			</div>
			<div class="field fancy-form">
			  <label for="lastN">Last Name</label>
			  <input id="lastN" size="30" maxlength="50" type="text" name="lastN" required value=<?php 
echo getStudentLastNameByID($_SESSION["studID"]);
?>
>
			</div>
			<div class="field fancy-form">
				<label for="studID">Student ID</label>
				<input id="studID" size="30" maxlength="7" type="text" pattern="[A-Za-z]{2}[0-9]{5}" title="AB12345" name="studID" disabled value=<?php 
echo $_SESSION["studID"];
?>
示例#2
0
<?php

session_start();
$debug = false;
include '../../CommonMethods.php';
$COMMON = new Common($debug);
//Include functions
include "Functions.php";
if ($_POST["finish"] == 'Cancel') {
    $_SESSION["status"] = "none";
} else {
    //Grab all User data
    //Changed to function calls
    $firstn = getStudentFirstNameByID($_SESSION["firstN"]);
    $lastn = getStudentLastNameByID($_SESSION["lastN"]);
    $studid = $_SESSION["studID"];
    $major = getStudentMajorByID($_SESSION["major"]);
    $email = getStudentEmailByID($_SESSION["email"]);
    $advisor = $_SESSION["advisor"];
    if ($debug) {
        echo "Advisor ->" . $advisor . "<br>\n";
    }
    //If student doesn't exist, create them.
    $apptime = $_SESSION["appTime"];
    if ($_SESSION["studExist"] == false) {
        $sql = "insert into Proj2Students (`FirstName`,`LastName`,`StudentID`,`Email`,`Major`) values ('{$firstn}','{$lastn}','{$studid}','{$email}','{$major}')";
        $rs = $COMMON->executeQuery($sql, $_SERVER["SCRIPT_NAME"]);
    }
    // ************************ Lupoli 9-1-2015
    // we have to check to make sure someone did not steal that spot just before them!! (deadlock)
    // if the spot was taken, need to stop and reset