从文本区域获取数据并发布到墙上的对话框 [英] get data from text area and post to a wall onfacebook

查看:143
本文介绍了从文本区域获取数据并发布到墙上的对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不知道这是否可行,但我需要做的是从我的文本区域获取数据,并将用户发布到他们的墙上。

not sure if this is possible, but what i need to do is take the data from my text area and let the user post that to their wall.

我的代码段

<div align="center">
<form method="GET" action="translate.php">
<textarea name="status2" cols="50" rows="5"<input type="text"/>
<?php echo str_ireplace(array     ('old','awkward','all','again','behind','along','alright','hello','among','children','yes','child','kids','food','barnard castle','beer','book','blow','beautiful','bird','burst','brown','burn','boots'), 
array ('auld', 'aakwad', 'aall','agyen','ahint','alang','alreet','alreet','amang','bairns','aye','bairn','bairns','bait','barney','beor','beuk','blaa','bonny','bord','borst','broon','bourn','byeuts'),$status); ?> 

</textarea><br>

<input type="submit" value="post to wall" />
</form>

</div>

<?php

$args = array(
'message'   => 'Hello World',
'link'      => 'http://apps.facebook.com/geordie-status/',
'caption'   => 'Translate from English to Geordie'
);
$post_id = $facebook->api("/$uid/feed", "post", $args);

?>

默认消息Hello World发布到墙上,但是我想用'status2'文本区域中的文本。这是可能吗?

the default message 'Hello World' posts to the wall, but i would like to replace that with the text in 'status2' text area. Is this possible?

谢谢

推荐答案

<textarea name="status2" cols="50" rows="5"<input type="text"/>

没有意义。
猜测您的textarea在您的实际代码段中编码良好。您应该在$ _GET ['status2']内的textarea值,因此更改traslate.php:

Doesn't make sense. Guessing that your textarea is well coded in your real snippet. You should have the value of the textarea inside $_GET['status2'], so change traslate.php:

$args = array(
'message'   => $_GET['status2']
...

这是我为测试编写的代码:

index.html

this is the code i've written for the test:
index.html

<form method="GET" action="server.php">
    <textarea name="status2"></textarea>
    <input type="submit" value="go"/>
</form>

server.php

<?
print_r($_GET);
?>

这篇关于从文本区域获取数据并发布到墙上的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆