1
我真的很陌生,PHP和JavaScript,我做了一個PHP發佈腳本,我想添加twitter鏈接到用戶名。我把JavaScript放在頭上,但沒有運氣。我遵循所有的方向,但我無法實現它的工作。這是我的PHP:在PHP中使用Twitter linkify
<form align="center" method='post' action='add.php'>
<p>Your status:</p>
<textarea name='body' rows='5' cols='40' wrap=VIRTUAL></textarea>
<p> What color is a banana? (lowercase) </p>
<input type="text" class="blah" name="age" />
<input align="center" type="submit" class="submit" value="Post" disabled="disabled"/>
</form>
<script type="text/javascript">
$('.blah').change(function() {
$(".submit").attr('disabled', $(this).val() != "yellow");
}).change();
</script>
<?php
$posts = show_posts($_SESSION['userid']);
if (count($posts)){
?>
<table class="imagetable">
<table align="center" border='0' cellspacing='0' cellpadding='5' width='300'>
<?php
foreach ($posts as $key => $list){
echo "<tr valign='middle'>\n";
echo "<td>".$list['body'] ."<br/>\n ";
echo "<small>".$list['stamp'] ."</small><hr></td>\n";
echo "</tr>\n";
}
?>
</table>
<?php
}else{
?>
<p><b>You haven't posted anything yet!</b></p>
<?php
}
?>
</body>
</html>
這是<head>
:
<script type="text/javascript">
twttr.anywhere(function (T) {
T.linkifyUsers();
});
</script>
所以是有人類型的 「喜@stackoverflow」 @stackoverflow將鏈接到Twitter的個人資料頁?