I've been trying to work with the Tipjoy API all day. I first tried it
in Python but was struggling greatly so I tried moving to PHP. I am
currently trying to initiate a Twitter payment, but when I send my
form, it results in a failure for reason "must HTTP POST". I do not
understand why this occurs, as it seems I am doing a POST, for my
form's method is post, and whenever I access the form data, I use
$_POST. Here is the code I have:
<?php
if ($_POST['submitBtn1']) {
header("Location:
http://tipjoy.com/api/tweetpayment?twitter_username=".
$_POST['username']."&twitter_password=".$_POST['password']);
}
else {
?>
<form name="cred" method="post" action="<?=$_SERVER['PHP_SELF']?>">
Twitter Username: <input type="text" name="username"><br />
Twitter Password: <input type="password" name="password"><br />
<input type="submit" name="submitBtn1" value="tweetpayment">
</form>
<?php } ?>
I am also confused as to why this is not working, because I have
another page that contains the EXACT same code, except instead of
"
http://tipjoy.com/api/tweetpayment" after "Location:", "http://
tipjoy.com/api/user/balance" is there; when I submit the form for this
other page, it works fine (I am prompted to open a JSON file and I can
see the result).
Any clues are helpful.
Thank you.
Blake