Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 31
  1. #11
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    if your useing a function your not familiur with i suggest checking php.net, very useful

    http://uk.php.net/preg_match

    Pretty much anything im gona say about its in there anyway, the preg functions are always a bit confusieng due to regex with still often shows itself to be a pain in the ****

    $userinput = "ban: bob";

    if (preg_match("/ban: /i",$userinput )) {
    // invoke ban script,
    $ban = explode(" ", $ban);
    $Persontoban =$ban['1']

    // Banning script here
    } else {
    // Add the info normaly

    }


    Hope that quick crap helps

  2. #12
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    He is not good at php. He asked me to help him.. he had a code like this

    echo my stuff here .. its text;

    with no ""'s

  3. #13
    Join Date
    Aug 2005
    Posts
    856
    Tokens
    0

    Default

    Thanks.

    Denta, what are you on about?

  4. #14
    Join Date
    Apr 2005
    Location
    North Carolina, USA
    Posts
    4,535
    Tokens
    0

    Latest Awards:

    Default

    Everytime you post for help.. its always simple stuff.. so your not that good at php..

  5. #15
    Join Date
    Aug 2005
    Posts
    856
    Tokens
    0

    Default

    Its not that im not good, its that i havent used this yet..

    Just to cofirm $ban is the username in the code?

    Edit:

    PHP Code:
    if ($logged[level] == 12 && stristr($shout":ban"))
        {
            
    $shout $_POST[shout]; //Assume this is $_POST[shout]
            
    if (stristr($shout":ban"))
                {
                    
    $ban explode(" "$ban);
                    
    $ban['0'] = "";
    $result mysql_query("UPDATE `users` SET `banned` = 'banned' WHERE `username` = '$ban'") or die ('Error during the execution of the MySQL query : ' mysql_error());

    $query mysql_query("INSERT INTO `ban` (`id` , `username` , `time`) VALUES ('', '$ban', '$days-$date')") or die ('Error during the execution of the MySQL query : ' mysql_error());

    $alert mysql_query("UPDATE `users` SET `alert` = 'You have been banned and can no longer use the Site' WHERE `username` = '$user'") or die ('Error during the execution of the MySQL query : ' mysql_error());
                }
        }else{ 
    Right or wrong?
    Last edited by xRoyal15; 10-11-2006 at 04:31 PM.

  6. #16
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    Quote Originally Posted by xRoyal15 View Post
    Its not that im not good, its that i havent used this yet..

    Just to cofirm $ban is the username in the code?

    Edit:

    PHP Code:
    if ($logged[level] == 12 && stristr($shout":ban"))
        {
            
    $shout $_POST[shout]; //Assume this is $_POST[shout]
            
    if (stristr($shout":ban"))
                {
                    
    $ban explode(" "$ban);
                    
    $ban['0'] = "";
    $result mysql_query("UPDATE `users` SET `banned` = 'banned' WHERE `username` = '$ban'") or die ('Error during the execution of the MySQL query : ' mysql_error());

    $query mysql_query("INSERT INTO `ban` (`id` , `username` , `time`) VALUES ('', '$ban', '$days-$date')") or die ('Error during the execution of the MySQL query : ' mysql_error());

    $alert mysql_query("UPDATE `users` SET `alert` = 'You have been banned and can no longer use the Site' WHERE `username` = '$user'") or die ('Error during the execution of the MySQL query : ' mysql_error());
                }
        }else{ 
    Right or wrong?
    o.0 your useing a varible before you set it, and then repateing the code uselessly.
    Your also misuseing the explode impolded copy Heinous gave you...

    PHP Code:
    Get shout imput.
    $shout $_POST[shout];
    // Assuming your ban code is "ban: MrUser"
    if ($logged[level] == 12 && stristr($shout"ban: "))
        {
    //since they have banning permission (im guesing) and "ban: " is in the input, we must be banning someone

    //Exsplode the space in shout
     
    $ban explode(" "$shout);
    // the explode implode is more for when concatinaginng an undefined string length, since the syntax of the input of known its far easy just to drag the second chunk, 1 in this case.
    $usertoban $ban['1'];

    // SHOVE ALL YA MYSQL FOR BAN HERE

    }else{
    //no ban syntax found, just update post as normal

    //CODE HERE



  7. #17
    Join Date
    Dec 2005
    Location
    Australia
    Posts
    693
    Tokens
    0

    Default

    Quote Originally Posted by xRoyal15 View Post
    Its not that im not good, its that i havent used this yet..

    Just to cofirm $ban is the username in the code?

    Edit:

    PHP Code:
    if ($logged[level] == 12 && stristr($shout":ban"))
        {
            
    $shout $_POST[shout]; //Assume this is $_POST[shout]
            
    if (stristr($shout":ban"))
                {
                    
    $ban explode(" "$ban);
                    
    $ban['0'] = "";
    $result mysql_query("UPDATE `users` SET `banned` = 'banned' WHERE `username` = '$ban'") or die ('Error during the execution of the MySQL query : ' mysql_error());

    $query mysql_query("INSERT INTO `ban` (`id` , `username` , `time`) VALUES ('', '$ban', '$days-$date')") or die ('Error during the execution of the MySQL query : ' mysql_error());

    $alert mysql_query("UPDATE `users` SET `alert` = 'You have been banned and can no longer use the Site' WHERE `username` = '$user'") or die ('Error during the execution of the MySQL query : ' mysql_error());
                }
        }else{ 
    Right or wrong?
    You need the implode statement, like I posted, BEFORE sql queries. But yes, $ban is the username.
    XHTML, CSS, AJAX, JS, php, MySQL.

    --

    HxF moderators can't read timestamps.

  8. #18
    Join Date
    Aug 2005
    Posts
    856
    Tokens
    0

    Default

    YAY thanks, it works

  9. #19
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    Rofl i see ur doing what HabboRemix have done.

    Good luck with it

  10. #20
    Join Date
    Aug 2005
    Posts
    856
    Tokens
    0

    Default

    ;o what have they done?

Page 2 of 4 FirstFirst 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •