xyn Posted July 3, 2006 Share Posted July 3, 2006 Hi.I'm trying to make an Unban IP script by using this way, I used it before but I don't know how to make this "multiple script" work...ie:[code=php:0]delete.php?id=X[/code] then it'll delete the X id from database, but now I wanted to do this:ban.php?act=unban&ip=172.141.192.232&id=1[code=php:0]//AT the top of script i have:$act = $_GET['act'];$id = $_GET['id'];} elseif( $act == unban ) {$pip = $_GET['ip'];if( $id == '.$pid.' ){ include("db.php"); mysql_query("DELETE FROM ban WHERE id='$pid'"); //$pip is set as a var above the code! also. works echo '<SCRIPT>alert ("You have unbanned the IP #'.$pip.'.")</SCRIPT>'; }[/code] Quote Link to comment https://forums.phpfreaks.com/topic/13555-_get-problems/ Share on other sites More sharing options...
wildteen88 Posted July 3, 2006 Share Posted July 3, 2006 Is that you code? If it is you have a few problems [b]unban[/b] should be [b]'unban'[/b] (including the quotes). Also [b]'.$pid.'[/b] wont work as it wont parse the $pid variable as it is in single quotes. You might want ot use double quotes instead.Also if $id is supposed to be an number you should check that it by doing this:[code=php:0]if(isset($_GET['id']) && is_int($_GET['id'])){ // unban ip code here}else{ die("Please provide a valid id for the ipaddress");}[/code] Quote Link to comment https://forums.phpfreaks.com/topic/13555-_get-problems/#findComment-52490 Share on other sites More sharing options...
.josh Posted July 3, 2006 Share Posted July 3, 2006 all that aside, am i reading this wrong or are you basing your unban script on an id passed in the url? Quote Link to comment https://forums.phpfreaks.com/topic/13555-_get-problems/#findComment-52556 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.