I'm trying to develop a web site form that allows you to choose a
profile picture, enter your username&password, and then it will change
your profile pic to the selected one. I haven't implemented the
choosing of the picture yet, as I'm still trying to get one picture to
go through. I keep getting the error "There was a problem with your
picture. Probably too big."

Here's the code I have so far-


<html><head><title>Title</title>
<?php
$username = $_POST["username"];
$password = $_POST["password"];
$image = $_POST["image"];
if (!isset($_POST['submit'])) { // if page is not submitted to itself
echo the form
} else {
// The twitter API address
$url = 'http://twitter.com/account/update_profile_image.xml';
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, "$url");
curl_setopt($curl_handle, CURLOPT_POST, 1);
curl_setopt($curl_handle, CURLOPT_HTTPHEADER, array('Expect:'));
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_FILE, "ima...@$image;type=image/
jpg");
curl_setopt($curl_handle, CURLOPT_USERPWD, "$username:$password");
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
        echo $buffer;
        echo $image;
}
?>



</head>
<body>

<form method="post" action="<?php echo $PHP_SELF;?>">
Username:<input type="text" size="12" maxlength="12"
name="username"><br />
Password:<input type="password" size="12" maxlength="36"
name="password"><br />
<input type="hidden" value="http://up.jamesnweber.com/Whe.jpg";
name="image">
<input type="submit" value="submit" name="submit"><br />
</form><br />


Any ideas? Thanks!

Reply via email to