开发者

php how to add php code in the twitter callback url?

I am trying to start a new app on dev.twitter.com, and in the callback URL I want to pass a link like: www.text.com?number=<?= $var?> but it won't let me.

Any ideas? Thanks.

Edit: my link will eventually look like this: www.text.com?number=123456

But it 开发者_如何转开发will depend on who is logged in, so the number could be any 6 numbers, so I'm thinking the callback URL has to have that var inside it.


You have to pass the complete URL in an oauth_callback parameter when you get a request_token from Twitter. The specifics are detailed in the authentication documentation. For example you would have something like oauth_callback=http://example.com/callback.php?number=123456 and with the request token will be an attribute of oauth_callback_confirmed set to a value of true so you know that Twitter will honor the custom callback URL.


Why do you assume twitter is even running php? Even so they certainly wouldn't let you execute arbitrary php code in a callback they make.

Please explain what you really want to do. What you are asking isn't clear.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜