desithugg Posted April 14, 2006 Share Posted April 14, 2006 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 ('\"', """, $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 Quote Link to comment https://forums.phpfreaks.com/topic/7369-need-help-modifying-a-php-freaks-script/ Share on other sites More sharing options...
fenway Posted April 14, 2006 Share Posted April 14, 2006 Huh? Quote Link to comment https://forums.phpfreaks.com/topic/7369-need-help-modifying-a-php-freaks-script/#findComment-26884 Share on other sites More sharing options...
desithugg Posted April 14, 2006 Author Share Posted April 14, 2006 [!--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 Quote Link to comment https://forums.phpfreaks.com/topic/7369-need-help-modifying-a-php-freaks-script/#findComment-26950 Share on other sites More sharing options...
fenway Posted April 16, 2006 Share Posted April 16, 2006 [!--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.? Quote Link to comment https://forums.phpfreaks.com/topic/7369-need-help-modifying-a-php-freaks-script/#findComment-27532 Share on other sites More sharing options...
desithugg Posted April 17, 2006 Author Share Posted April 17, 2006 [!--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 Quote Link to comment https://forums.phpfreaks.com/topic/7369-need-help-modifying-a-php-freaks-script/#findComment-27715 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.