i wanted a search system which will find the users starting ore where the name is in
like !user test
and the php file is ok and give me the result what i need when i vissit it true my inetx
like
testing test
it give me more then 1 result now i wanted to put the result true my eggdrop into my irc channel but i wont work
it only gives me 1 username but there are 3 users who got test in there name
those are the scripts but not working ok
Code: Select all
<?php
error_reporting(7);
define ('LF', "\n");
// DEFINE YOUR MYSQL INFORMATION HERE!
$server="localhost";
$dbuser="user";
$dbpass="pass";
$db="database";
mysql_pconnect($server,$dbuser,$dbpass);
mysql_select_db($db);
$username=$_GET["username"];
$usernfo=mysql_query("SELECT * FROM users WHERE UPPER(nickname) LIKE UPPER('%$username%') ");
while($user=mysql_fetch_array($usernfo)) {
echo
LF, $user[nickname],
LF, $user[joindate],
LF, $user[posts];
}
?>
Code: Select all
set url "http://localhost/ircscripts/user.php"
set agent "Mozilla"
package require http
bind pub "-|-" !user getstatus
proc getstatus { nick host handle channel text } {
global chan url agent
putlog "$text"
if {$text != ""} {
set query "$url?username=$text"
set page [http::config -useragent $agent]
set data [http::geturl $query]
set data2 [http::data $data]
set lines [split [::http::data $data] \n]
set ok [lindex $lines 1]
set date [lindex $lines 2]
set nickname [lindex $lines 1]
set posts [lindex $lines 3]
upvar #0 $page state
set max 0
http::cleanup $data
foreach line [split $data2 \n] {
if {$ok != ""} {
putquick "PRIVMSG $channel :\00307,01 \002\[User\] \00307,01 \002$nickname : \00314,01Status \00307,01$posts JOINED AT $date"
} else {
putquick "PRIVMSG $channel :\00307,01 \002\[User\] \00307,01 \002$text not found"
}
}
}
}