Ejemplo n.º 1
0
<?php

if (strlen($avatar) > 0 && !URLValid($avatar)) {
    $error = 'Avatar is not a valid link.';
} else {
    if (strlen($website) > 0 && !URLValid($website)) {
        $error = 'Website is not a valid link.';
    }
}
if (isset($error)) {
    SendResponse(array('success' => false, 'message' => $error));
} else {
    $stmt = $dbconnection->prepare('UPDATE users SET avatar = ?, website = ?, about = ? WHERE id = ?;');
    $stmt->execute(array($avatar, $website, $about, $session->GetUserID()));
    SendResponse(array('success' => true));
}
Ejemplo n.º 2
0
}
if (!isset($error)) {
    foreach ($images as $image) {
        if (!URLValid($image['url'])) {
            $error = '"' . $image['url'] . '" is not a valid link.';
            break;
        }
    }
}
if (!isset($error)) {
    foreach ($links as $link) {
        if (strlen($link['title']) == 0) {
            $error = 'Link title can not be blank';
            break;
        } else {
            if (!URLValid($link['url'])) {
                $error = '"' . $link['url'] . '" is not a valid link.';
                break;
            }
        }
    }
}
if (isset($error)) {
    SendResponse(array('success' => false, 'message' => $error));
    die;
}
$stmt = $dbconnection->prepare('SELECT status FROM jams WHERE id = ?;');
$stmt->execute(array($jamid));
if ($stmt->rowCount() == 0) {
    SendResponse(array('success' => false, 'message' => 'Invalid jam specified.'));
} else {