Русистика member php action profile

Русистика member php action profile


Fetching contributors…

Cannot retrieve contributors at this time. Cannot retrieve contributors at this time

78 lines (70 sloc) 2.23 KB

// Check to see if the user is logged in. If they are not, then redirect them to the index/login page.
header(«Location: index.php«);
// Include the common PHP file
// Call the common header function.
<?php addMenu(); ?>
<h1>Bad Pen Members</h1>
<form method=«get« action=«members.php« id=«search«>
Search for Members you know:
<td><input type=«text« name=«email« id=«email«/></td>
<input type=«submit« value=«Search«/>
<form method=«post« action=«add_friends.php« id=friend_form>
$db = getDatabaseHandle();
$user = $_SESSION[user];
if (isset($_GET[email])) {
$search = %.$_GET[email].%;
else {
$search = %;
$query = «select fname, lname, email, id, liveCity, liveState, fromCity, fromState, image, (
select id in (
select user2 from friends where user1 = (
select id from users where email = ?))) as friend from users where email like ? and email <> ?«;
$prep_query = $db->prepare($query);
$prep_query->bind_param(sss, $user, $search, $user);
$prep_query->bind_result($fname, $lname, $email, $id, $liveCity, $liveState, $fromCity, $fromState, $image, $is_friend);
$count = 0;
while ($prep_query->fetch()) {
$checked = $is_friend ? checked : ;
$checkbox = «<input type=’checkbox’ name=’friends[]’ value=’$id$checked/>«;
++$count; ?>
<form action=«profile.php« method=«post«>
<?php addProfile($email, $fname, $lname, «$liveCity, $liveState«, «$fromCity, $fromState«, $image); ?>
<input type=«submit« class=block value=«Go to Profile«/>
<input type=checkbox form=friend_form name=friends[] value=<?php echo «$id$checked« ?>>Friends</input>
if ($count == 0) {
echo «<p>No Members Found</p>«;
else {
echo «<input type=’submit’ form=’friend_form’ value=’Save’/>«;

You can’t perform that action at this time.


Читайте также

Добавить комментарий