开发者

PHP - Simple Help needed

I have a IRC bot, how do I post multiple data to make this following text display on the main IRC channel "rock paper sizzor hand"?

Here is part of my script:

fwrite($ircSocket, "PRIVMSG " . $ircCh开发者_开发百科annel . " :" . $msg . "\n");

As you can see $msg will grab "rock" how do I make the following code display and post paper, sizzor and hand?

EDIT:

Here is what I need:

<html><body>
<h4>IRC Bot Tester</h4>
<form action="irc.php" method="post"> 
Command: <input type="text" name="msg" />
Paper: <input type="text" name="paper" />
Sizzor: <input type="text" name="sizzor" />
Hand: <input type="text" name="hand" />
<input type="submit" />

<?php

$ircServer = "irc.underworld.no";
$ircPort = "6667";
$ircChannel = "#bots";

set_time_limit(0);

$msg = $_POST['msg'];
$paper = $_POST['paper'];
$sizzor = $_POST['sizzor'];
$hand = $_POST['hand'];

How do I get those $paper, $sizzor, $hand into the PRIVMSG Part. Whatever is entered into paper sizzor and hand has to have a space inbetween when posted onto the IRC main channel.

 fwrite($ircSocket, "PRIVMSG " . $ircChannel . " :" . $msg . "\n");


This will print whatever the values are in $msg, $paper, $sizzor, and $hand with a space in between each:

fwrite($ircSocket, "PRIVMSG $ircChannel :$msg $paper $sizzor $hand\n");

If you literally just want to output "rock paper sizzor hand" (It's scissor, BTW...) then you can just do:

fwrite($ircSocket, "PRIVMSG $ircChannel :rock paper sizzor hand\n");


Can you explain more clearly what you want?

It sounds as though you just want to display the string "rock paper sizzor hand" in which case

$msg = "rock paper sizzor hand";
fwrite($ircSocket, "PRIVMSG " . $ircChannel . " :" . $msg . "\n");

but I'm sure that's not what you want.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜