コード例 #1
0
    </body>
    </html>
    ';
    // To send HTML mail, the Content-type header must be set
    $headers = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    // Additional headers
    $headers .= 'From: case.shareup@gmail.com' . "\r\n" . 'Reply-To: case.shareup@gmail.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
    mail($to, $subject, $message, $headers);
}
if (isset($body)) {
    $json = json_decode($body);
    if (isset($json)) {
        $userid = studentIdByEmail($json->email);
        if (empty($userid)) {
            $userid = enterpriseIdByEmail($json->email);
            if (empty($userid)) {
                echo json_encode(array('error' => 'No entity registered with the given email'));
                return;
            }
            $type = 'enterprise';
        } else {
            $type = 'student';
        }
        $token = rand(100000000000000.0, 999999999999999.0);
        $token = substr($token, 1, -1);
        $hashed_token = hash("sha256", $token);
        generateRecovery($userid['id'], $hashed_token, $type);
        // get base url
        $currentPath = $_SERVER['PHP_SELF'];
        $pathInfo = pathinfo($currentPath);
コード例 #2
0
require_once '../api/enterprise.php';
require_once '../api/student.php';
require_once '../api/casestudy.php';
if (!isset($_GET["type"]) || !isset($_GET["email"])) {
    header("Location: index.php");
}
include '../templates/includes/header.html';
?>
<style>
body{margin-left:25px}
</style>

<?php 
if ($_GET["type"] == "Enterprise") {
    $enterpriseID = enterpriseIdByEmail($_GET['email'])['id'];
    $enterprise = getEnterpriseProfile($enterpriseID);
    if (!empty($enterprise['enterprise']['id'])) {
        ?>

<h1><?php 
        echo $enterprise['enterprise']['name'];
        ?>
</h1>
<h4 title = "<?php 
        echo htmlentities($student['name']);
        ?>
's email"><i><?php 
        echo htmlentities($_GET["email"]);
        ?>
</i></h4>