Jump to content

Recommended Posts

Nevermind made new script and works if anybody needs it

[b]$user_currently_loged[/b] is the username that is currently logged in this depends on your login script

[code]<?php
$link = mysql_connect('localhost', 'username', 'password');
if (!$link) {
   die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db('tpf');
if (!$db_selected) {
   die('Could not select database: ' . mysql_error());
}
$result = mysql_query("SELECT username from banned where username = '$user_currently_loged' ");
if (!$result) {
   echo 'Could not run query: ' . mysql_error();
   exit;
}
$userban = $row["username"];
$userban = str_replace ('\"', "&quot;", $userban);
?>[/code]

[code]<?php
$banned_username = array();
$banned_username[] = $userban;

foreach($banned_username as $banned_user) {
    $user = $user_currently_loged;
    if($user == $banned_user){
        echo "You Have been Banned";
        exit();
    }
}
?>[/code]

lol itll be fun if this gets on the PHP Freaks script lists
Link to comment
https://forums.phpfreaks.com/topic/7369-need-help-modifying-a-php-freaks-script/
Share on other sites

[!--quoteo(post=364706:date=Apr 14 2006, 01:50 AM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Apr 14 2006, 01:50 AM) [snapback]364706[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Huh?
[/quote]

I want to modify the script so it recieves a set of Ip's from a DB table but the script above that i modified did'not work the page just went blank if i put in the script.SO i need help modifing it
[!--quoteo(post=364773:date=Apr 14 2006, 08:34 AM:name=desithugg)--][div class=\'quotetop\']QUOTE(desithugg @ Apr 14 2006, 08:34 AM) [snapback]364773[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I want to modify the script so it recieves a set of Ip's from a DB table but the script above that i modified did'not work the page just went blank if i put in the script.SO i need help modifing it
[/quote]
That much I understood -- but what about it isn't working? Is the query successful, do you get back the expected results, etc.?
[!--quoteo(post=365368:date=Apr 16 2006, 03:16 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Apr 16 2006, 03:16 PM) [snapback]365368[/snapback][/div][div class=\'quotemain\'][!--quotec--]
That much I understood -- but what about it isn't working? Is the query successful, do you get back the expected results, etc.?
[/quote]
yup before i had 1 query and it didnt work but above i have 2 and it works perfectly if anyone needs it their welcome to use it
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.