コード例 #1
0
include 'includes/overall/header.php';
?>

<?php 
if (user_exists_members($user_data['username']) === false) {
    $data = "Baskerville Old Face";
    echo '<td><div align="center">
		<h1 style="font-family:' . $data . '; font-size:60px; text-shadow:0px 5px 2px #CCC; color:#900">Forum</h1></div>
        		<ul><li>
            <a href="notifications.php" style="text-decoration:none;">Notifications</a></li>
            	<li>
				<a href="emails.php" style="text-decoration:none">members email address </a></div></li>
                <li><a href="messageforstudents.php" style="text-decoration:none ">Member messages</a></li>
                </ul></td>';
} else {
    if (user_exists_members($user_data['username'])) {
        echo '<td><div align="center">
	<h1>Forum</h1></div><div align ="left"><h3><ul><li><a href="notifications.php">Notifications</a>
</li>	
</li>	 <li><a href="contentshare.php">share content with users </a>
</li>		 <li><a href="list.php">Details of all users</a>
</li>	<li><a href="addblog.php" style="text-decoration:none">Add A Blog</a></li><li><a href="profile.php" style="text-decoration:none">Check Your Profile Details </a>


</li> 
<li><a href="delete.php" style="text-decoration:none">Delete Some Blog </a>
<li><a href="message.php" style="text-decoration:none ">Share some message to Students</a></li>



コード例 #2
0
include 'core/init.php';
protect_pages();
include 'includes/overall/header.php';
if (empty($_POST) === false) {
    if (isset($_POST['submit'])) {
        $required_fields = array('username', 'firstname', 'email', 'branch', 'year', 'mobile');
        foreach ($_POST as $key => $value) {
            if (empty($value) && in_array($key, $required_fields) === true) {
                $error[] = 'Fields Marked with Aiersticks are compulsory';
                break;
            }
        }
    }
    //if user name exists then show error
    if (empty($errors) === true) {
        if (user_exists_members($_POST['username']) === true) {
            $error[] = 'the username \'' . $_POST['username'] . '\' already exits';
        }
        //checked and verified
        //function for checking spaces in user name
        if (preg_match('/\\s/', $_POST['username'])) {
            $error[] = 'Username must not contain the spaces';
        }
        //filtering email addres usin special constant
        if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === false) {
            $error[] = 'Please Enter a valid email address';
        }
        if (email_exists_member($_POST['email']) === true) {
            $error[] = 'the email \'' . $_POST['email'] . '\' already in used';
        }
    }