예제 #1
0
파일: update.php 프로젝트: brianjchow/CS105
		else if (document.all) {
			return eval("document.all." + objId);
		}
		else {
			return eval("document." + objId);
		}
	}
</script>

<body>

<?php 
session_start();
require "class_lib.php";
$sessionUsername = $_SESSION['username'];
$userLoggedIn = printToolbar($sessionUsername, false);
echo "<h1>Update Profile</br></h1>";
if (!$userLoggedIn) {
    echo "You must be logged in to do that. Click <a href=login.php>here</a> to log in. Click <a href=signup1.php>here</a> \r\n\t\t\tto sign up for an account.</br>";
} else {
    $db_server = connect();
    $query = "SELECT * FROM profiles WHERE username="******"'" . $_GET['user'] . "'";
    $result = $db_server->query($query);
    checkQueryResults($result);
    $row = $result->fetch_row();
    ?>
			<form id="Upload" action="updateHandler.php" enctype="multipart/form-data" method="POST">

				Fields left blank will remain unchanged.</br>
	
				<p>
예제 #2
0
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Image Upload Confirmation</title>
<link rel="stylesheet" type="text/css" href="SiteStyle.css" />
<meta http-equiv="Content-Type"
	content="text/html; charset = ISO-8859-1" />
</head>

<body>

<?php 
session_start();
require "class_lib.php";
$username = $_SESSION['username'];
printToolbar($username, false);
print "<h1>Image Upload Confirmation</h1>";
$db_server = connect();
$albumTitle = $_POST['albumTitle'];
$picTitle = $_POST['picTitle'];
if (preg_match('/[^A-Za-z0-9]/', $picTitle)) {
    echo "Image names can only contain letters and numbers. Please return to ";
    echo '<a href="testupload1.html">Image Upload</a>';
    echo " to try again.</br>";
} else {
    if (preg_match('/[^A-Za-z0-9]/', $albumTitle)) {
        echo "Album titles can only contain letters and numbers. Please return to ";
        echo '<a href="testupload1.html">Image Upload</a>';
        echo " to try again.</br>";
    } else {
        // upload image
예제 #3
0
		else if (document.all) {
			return eval("document.all." + objId);
		}
		else {
			return eval("document." + objId);
		}
	}
</script>

<body>

<?php 
session_start();
require "class_lib.php";
$username = $_SESSION['username'];
$userLoggedIn = printToolbar($username, false);
echo "<h1>Gallery Registration</h1>";
if ($userLoggedIn) {
    echo "Log out first before creating a new account.</br>";
} else {
    ?>

		<form action="signup2.php" enctype="multipart/form-data" method="POST">
			Username: <input type="text" name="username"><br>
			Password*: <input type="password" name="password1"><br>
			Re-enter password: <input type="password" name="password2"></br></br>

			Any fields below left blank will remain unchanged.

			<p>
				<label for="file">Choose a profile picture:</label>
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>View Album</title>
<link rel="stylesheet" type="text/css" href="SiteStyle.css" />
<meta http-equiv="Content-Type"
	content="text/html; charset = ISO-8859-1" />
</head>

<body>

<?php 
session_start();
require "class_lib_test.php";
$sessionUsername = $_SESSION['username'];
printToolbar($sessionUsername, false);
$db_server = connect();
$username = $_GET['user'];
$albumTitle = $_GET['albumTitle'];
print "<h1>{$albumTitle}</h1>";
print "<h3><a href=profile.php?user="******">Back to profile</a></h3>";
$username = $_GET['user'];
$albumTitle = $_GET['albumTitle'];
$picPath = $_GET['picPath'];
$offset = strlen($username) + strlen($albumTitle) + 2;
$picName = substr($picPath, $offset);
$albumHome = "album.php?user="******"&albumTitle=" . $albumTitle;
$query = "SELECT * FROM pictures WHERE username="******"'" . $_GET['user'] . "'";
$result = $db_server->query($query);
checkQueryResults($result);
$imgPaths = array();
				//oOutput.innerHTML = "Message posted! Response text is " + request.responseText + ".";
			}
		}	
		return false;
	}

</script>

<body>

<?php 
session_start();
require "class_lib_test.php";
// get op from session var
$op = $_SESSION['username'];
printToolbar($op, false);
echo "</br>";
if (!isEmptyString($op)) {
    ?>

	<!--<form id="postMessage" action="postMessageHandler.php" enctype="multipart/form-data" method="POST">-->
	<form id = "postMessage" name="postMessage" method="POST" onsubmit="process(); return false;">
		Enter a message (<?php 
    echo $MAX_MESSAGE_LENGTH;
    ?>
 character limit):</br></br>

		<textarea onKeyPress="return taLimit(this)" onKeyUp="return taCount(this, 'counter')" id="message" name="message" value="msgVal" cols="60" rows="7"></textarea></br>

		<input type = "hidden" name = "toUser" value = "<?php 
    echo $_GET['toUser'];
예제 #6
0
                if (TITLE_DATE) {
                    $datetime = "<span style=\"font-size: 10px\">" . date(TITLE_DATE, @filemtime($filename)) . "</span>";
                }
            }
        }
    }
}
// Disable caching on the client (the iPhone is pretty agressive about this
// and it can cause problems with the editing function)
header("Cache-Control: no-cache, must-revalidate");
// HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Date in the past
print "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
print "<html>\n";
print "<head>\n";
// Define a viewport that is 320px wide and starts with a scale of 1:1 and goes up to 2:1
print "<meta name=\"viewport\" content=\"width=320; initial-scale=1.0; maximum-scale=2.0;\" />\n";
print "<link type=\"text/css\" rel=\"stylesheet\" href=\"" . BASE_URI . "/" . CSS_FILE . "\" />\n";
print "<title>{$title}</title>\n";
print "</head>\n";
print "<body>\n";
print "<div class=\"titlebar\">{$title} <span style=\"font-weight: normal;\">{$datetime}</span></div>\n";
printToolbar();
print "<div class=\"main\">\n";
print "{$html}\n";
print "</div>\n";
print "<form method=\"post\" action=\"" . SELF . "?action=search\">\n";
print "<div class=\"searchbar\">Search: <input id=\"search\" type=\"text\" name=\"q\" /></div></form>\n";
print "</body>\n";
print "</html>\n";
예제 #7
0
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Profile</title>
<link rel="stylesheet" type="text/css" href="SiteStyle.css" />
<meta http-equiv="Content-Type"
	content="text/html; charset = ISO-8859-1" />
</head>

<body>

<?php 
session_start();
require "class_lib.php";
$sessionUsername = $_SESSION['username'];
$username = $_GET['user'];
printToolbar($sessionUsername, true);
print "<div align='center'><h1> {$username} </h1></div>";
$db_server = connect();
// retrieve profile info
$query = "SELECT * FROM profiles WHERE username="******"'" . $_GET['user'] . "'";
$result = $db_server->query($query);
checkQueryResults($result);
// print profile picture and facts
$row = $result->fetch_row();
$profPicPath = $row[4];
if (strlen($profPicPath) > 0 && $profPicPath != null) {
    echo "<td><div align='center'><img src='" . $profPicPath . "' height = 400/></br></div></td>";
}
print "<div align='center'><h3>{$row['1']}</br>{$row['2']}</br>{$row['3']}</h3></div>";
//print("<div align='center'><h3>$row[1]</h3></div>");
//print("<div align='center'><h3>$row[2]</h3></div>");