a script that the admins can add the USER ID OR Character name and it just look for the IP in the DB and add it to the Ipbans.dbo
a script that the admins can add the USER ID OR Character name and it just look for the IP in the DB and add it to the Ipbans.dbo
Last edited by fuxpro321; 21-12-10 at 11:50 AM.
No lifex's MPOG web has that function.
EDIT:i need one that dosent need the to Enter the Users IP Adress
just the Charname or the User ID
Last edited by fuxpro321; 21-12-10 at 12:27 PM.
DECLARE @IP VARCHAR(40)
DECLARE @UserID VARCHAR(20)
SET @UserID = 'xxxxx'
SELECT @IP = LastIP FROM Login WHERE UserID = @UserID
INSERT INTO [IPBans] (UserID, IP) VALUES (@UserID, @IP)
Execute in SQL Server management
Last edited by alfredao; 21-12-10 at 02:06 PM.
and?
what dose it do?
and could be provide the script?
PHP Code:<?php
if(isset($_POST['submit']))
{
$userid = $_POST['userid'];
$a = mssql_query("SELECT LastIP FROM Login WHERE UserID = " . $userid);
if(mssql_num_rows($a) == 0)
{
echo "Invalid userid";
die();
}
$b = mssql_fetch_array($a);
if($b['LastIP'] == "")
{
echo "User ip not exists";
die();
}
else
{
mssql_query("INSERT INTO [IPBans] (UserID, IP) VALUES ('$userid', '{$b['LastIP']}')");
echo "UserID " . $userid . " ip banned";
}
}
?>
<form method="POST" action="">
UserID:
<input type="text" name="userid" id="userid" />
<input name="submit" type="submit" id="submit" value="Ban">
</form>
Last edited by alfredao; 21-12-10 at 06:23 PM.
Here is the script i added to my DB..Code:Warning: mssql_query() [function.mssql-query]: message: Invalid column name 'lol'. (severity 16) in C:\AppServ\www\web\BANIP.PHP on line 8 Warning: mssql_query() [function.mssql-query]: Query failed in C:\AppServ\www\web\BANIP.PHP on line 8 Warning: mssql_num_rows(): supplied argument is not a valid MS SQL-result resource in C:\AppServ\www\web\BANIP.PHP on line 10 Invalid userid
I Edited abit cause it dosent Execute to the DB
so any idea?Code:Use [GunzDB] GO DECLARE @IP VARCHAR(40) DECLARE @UserID VARCHAR(20) SET @UserID = 'xxxxx' SELECT @IP = LastIP FROM Login WHERE UserID = @UserID INSERT INTO [IPBans] (UserID, IP) VALUES (@UserID, @IP)
screenie before
![]()
Last edited by fuxpro321; 22-12-10 at 08:44 AM.
Edit this
toPHP Code:$a = mssql_query("SELECT LastIP FROM Login WHERE UserID = " . $userid);
PHP Code:$a = mssql_query("SELECT LastIP FROM Login WHERE UserID = '" . $userid . "'");
now it says Invalid userid
yes i am sure i entered the correct info
Are you sure the userid exists?
Yeah1
BUMP! i am fuxpro321
bump!