"; echo "Email Address:

"; echo "Password:

"; echo ""; echo ""; echo ""; } if ($_POST["page"] == "one" && $_POST["email"] == $tumblr_email && $_POST["pw"] == $tumblr_password) { ?>

Name (optional):

URL:

Description (optional):

(HTML allowed but no quotes: ex. href=http not href="http)

$v) { # if (is_int($k) && $prefix != null) $k = urlencode($prefix . $k); # if (!empty($key)) $k = $key.'['.urlencode($k).']'; # # if (is_array($v) || is_object($v)) # array_push($ret, http_build_query($v, '', $sep, $k)); # else array_push($ret, $k.'='.urlencode($v)); # } # # if (empty($sep)) $sep = ini_get('arg_separator.output'); # return implode($sep, $ret); # }} // Prepare POST request $request_data = http_build_query( array( 'email' => $tumblr_email, 'password' => $tumblr_password, 'type' => $_POST["page"], 'name' => $_POST["l_name"], 'url' => $_POST["l_url"], 'description' => $_POST["l_desc"], 'quote' => $_POST["q_quote"], 'source' => $_POST["q_source"], 'click-through-url' => $_POST["p_url"], 'caption' => $pcaption, 'source' => $psource, 'embed' => $_POST["v_embed"], 'caption' => $vcaption ) ); // Send the POST request (with cURL) $c = curl_init('http://www.tumblr.com/api/write'); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, $request_data); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($c); $status = curl_getinfo($c, CURLINFO_HTTP_CODE); curl_close($c); // Check for success if ($status == 201) { echo "Success! The new post is here.\n"; } else if ($status == 403) { echo 'Bad email or password'; } else { echo "Error: $result\n"; } } ?>