Exemple #1
0
<?php

if (isset($_POST['$results["id"]'])) {
    switch ($_POST['$results["id"]']) {
        case 'reply':
            reply_message();
            break;
        case 'delete':
            delete_message();
            break;
    }
}
function reply_message()
{
    echo "Id poruke: " . $results['id'];
    exit;
}
function delete_message()
{
    echo "Id poruke: " . $results['id'] . "<br>";
    echo "Id posiljaoca: " . $results['form']['id'];
    exit;
}
Exemple #2
0
        // Post message
        if ($LOGIN_USER == "") {
            $options = str_replace("+", "%2B", "+g" . urlencode($group) . $options);
            header("Location: login.php?PAGE={$PHP_SELF}?l{$options}");
            return;
        }
        if (ereg(".*\\.announce", $group) || ereg(".*\\.commit", $group)) {
            nntp_header("Forum Posting Error", array("All Forums" => "forums.php?g{$options}", "Back to {$group}" => "forums.php?g{$group}+s{$start}{$options}"));
            print "<p>We are sorry, but we could not post your message for the " . "following reason:\n" . "<blockquote>Forum {$group} is read-only.</blockquote>\n";
            html_footer();
        } else {
            post_message($group, $groups, $start, $msg, $search, $threaded);
        }
        break;
    case 'r':
        // Reply message
        if ($LOGIN_USER == "") {
            $options = str_replace("+", "%2B", "+g" . urlencode($group) . $options);
            header("Location: login.php?PAGE={$PHP_SELF}?r{$msg}{$options}");
            return;
        }
        reply_message($group, $groups, $start, $msg, $search, $threaded, $from);
        break;
    case 'v':
        // View message
        show_message($group, $groups, $start, $msg, $search, $threaded);
        break;
}
//
// End of "$Id$".
//
global $dbh;
switch ($_POST['option']) {
    case 1:
        add_comment($dbh, $table_prefix);
        break;
    case 2:
        add_news($dbh, $table_prefix);
        break;
    case 3:
        remove_news($dbh, $table_prefix);
        break;
    case 4:
        send_message($dbh, $table_prefix);
        break;
    case 5:
        reply_message($dbh, $table_prefix);
        break;
    case 6:
        get_massage($dbh, $table_prefix);
        break;
}
function add_comment($dbh1, $table_prefix)
{
    if ($stmt = $dbh1->prepare("INSERT INTO  " . $table_prefix . "_comments (project_id, user_id, comment) VALUES (?, ?, ?)")) {
        $stmt->bindParam(1, $_POST['project_id']);
        $stmt->bindParam(2, $_SESSION['user_id']);
        $stmt->bindParam(3, $_POST['comment']);
        $stmt->execute();
        echo "Success";
    }
}