Esempio n. 1
0
<?php

require_once '../config.php';
require_once '../inc/mysql.php';
//$connection
$fields = array();
var_dump($_POST);
// simple validations
foreach ($_POST as $field_name => $value) {
    $valid = false;
    switch ($field_name) {
        case 'eaddress':
            $valid = validate_email($value);
            break;
        case 'terms':
            $valid = validate_terms($value);
            break;
        default:
            $valid = validate_general($value);
            break;
    }
    if ($valid) {
        $fields[$field_name] = $connection->real_escape_string($value);
    }
}
$biddernum = addBidder($connection, $fields);
function validate_general($value)
{
    return !empty($value);
}
function validate_email($value)
Esempio n. 2
0
                            }
                            $blog_names[$post['blog_id']] = $post['blog_name'];
                            if ($blog_tags[$post['blog_id']]) {
                                $blog_tags[$post['blog_id']] .= "|TAG|";
                            }
                            $blog_tags[$post['blog_id']] .= "{$tag}";
                            $done[$post['blog_id']] = true;
                        }
                    }
                }
            }
        }
    }
}
if ($bloglines_terms) {
    $valid_terms = validate_terms(array_keys($bloglines_terms));
    if (!$valid_terms) {
        print "<h3>Sorry</h3>";
        print "<p>None of the terms in " . $_SAFE['bloglines_username'] . "'s subscriptions are in the Postgenomic index.";
        print_r($bloglines_terms);
    } else {
        print "<h3>Matched Bloglines terms</h3>";
        print_termcloud($valid_terms);
        # try and match up tags with blogs in the database
        foreach ($valid_terms as $term => $freq) {
            $post_ids = get_posts_with_term($term);
            # what blogs are these posts from?
            if ($post_ids) {
                $done = array();
                $posts = get_posts("cited", array("post_id" => $post_ids));
                if ($posts) {