示例#1
0
		<td>Confirm Password:</td><td><input type="password" id="confpaswd"></td>
		</tr>
		<tr class="signup" id="signupEmail">
		<td>Email:</td><td><input type="email" class="signup" id="email"/></td>
		</tr>
		</table>
			<input type="button" value="Signup" class="signup" id="signupButton" onclick="userSignup()" />
			<span id="loginButtons"><input type="submit" value="login" onclick="userLogin();"/> or <a id="signupButton" onclick="showSignup()">Signup</a></span>
		</div>
		<div id="title">
		 <h1 id="Heading">Charity Chain</h1>
		 <h3 id="Subheading">Social Networking giving back to society</h3>
		 </div>
<div id="container">
	<div id="main">
		<?php 
echo contentGen("main_discription");
?>
		 <input type="button" value="JS test" onclick="userCheck()" />
		 </div>
		 <span id="testspace"><?php 
//userLogin("root","1234");
?>
</span>
	<div id="nav">
		Hey this is the NAV and it loaded!!!
		 </div>
</div>
	<script type="text/javascript" src="script/script.js"></script> <!-- JavaScript loaded at the bottom for more efficent page loading -->
	<span class="dim" id="dimmer"></span>
</body>
/**
 * Function mailer($option,$data) is a function designed to generate a good looking email body for the preset messages sent from the server to the user
 * Currently supported options:
 * 		'CONFIRM': TODO:Make the CONFIRM message look good
 * 
 */
function mailer($option, $data)
{
    $option = strtoupper($option);
    $message = NULL;
    $url = $GLOBALS['URL'];
    $urli = substr($url, 0, strpos($url, "/"));
    switch ($option) {
        case 'CONFIRM':
            $messageText = wordwrap(trim(contentGen('confirm_email'), " "), 70);
            $header = "From: Robots <robots@{$urli}>" . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/html; charset=iso-8859-1';
            $subject = "Confirmation code from Charity Chain";
            $message = "<html>\n\t\t\t <body style:'background-color:grey;'>\n\t\t\t <div id='containter' style:'margin:10px; padding:5px; background-color:white; box-shadow:5px'>\n\t\t\t <p>{$messageText}</p>\n\t\t\t <a href='{$url}/script/functions.php?option=confirm&confcode={$data['0']}'>{$url}/index.php?option=confirm&confcode={$data['0']}</a>\n\t\t\t </div>\n\t\t\t </body>\n\t\t\t </html>";
            $result = mail($data[1], $subject, $message, $header);
            return $result;
            break;
        default:
            return FALSE;
            break;
    }
}