Results 1 to 8 of 8

Thread: banned words

  1. #1
    Join Date
    Apr 2002
    Location
    Wirral/Cheshire/Meresyside
    Posts
    203

    banned words

    hi i got a script that makes a email accoutn for my users i would like to make the script check a list of words before it makes the account could some 1 please tell me the code in php to do it thanks
    http://www.gocre8.co.uk - Liverpool Web Design
    http://www.outallnite.co.uk - Liverpool Clubbing

  2. #2
    Join Date
    Apr 2002
    Location
    Wirral/Cheshire/Meresyside
    Posts
    203
    Code:
    <form method=post>
    Username:<input type=text name=email><br>
    Password:<input type=password name=password><br>
    <input type=hidden name=quota value="10">
    <input type=submit name=submit><br>
    thats the html im using is there anything that i need to put in there that will check a list of words?

    theres more to the code BTW
    http://www.gocre8.co.uk - Liverpool Web Design
    http://www.outallnite.co.uk - Liverpool Clubbing

  3. #3
    Join Date
    May 2002
    Posts
    69
    what language are your trying to write it in?
    http://evilpuppy.com
    where developers gather...

  4. #4
    Join Date
    Apr 2002
    Posts
    61
    There are many ways to do it, not to mention you can do it via client-end (javascript, for instant), or server-end. One of the server-end ways using PHP is:

    register.html
    <form method=post action=check.php>

    check.php
    PHP Code:
    $fp = @fopen("ban_words.txt""r");

    while (!
    feof($fp)) {
        
    $ban_list fgetcsv ($fp1000"\n");
        if (
    eregi ($ban_list[0], $HTTP_POST_VARS[email])) {

        
    // Ban words matched, do whatever you want to do here

        
    }


  5. #5
    Join Date
    Apr 2002
    Location
    Wirral/Cheshire/Meresyside
    Posts
    203
    thanks ill post the script up to see if you get it, its for automatic creation of pop3 email addys in Cpanel
    http://www.gocre8.co.uk - Liverpool Web Design
    http://www.outallnite.co.uk - Liverpool Clubbing

  6. #6
    Join Date
    Apr 2002
    Location
    Wirral/Cheshire/Meresyside
    Posts
    203
    <?
    if ($submit){
    $host = "www.txt3.com";
    $domain = "txt3.com";
    $socket = fsockopen($host,2082);

    // these lines are changed
    $cpaneluser = "";
    $cpanelpass = "";
    $authstr = "$cpaneluser:$cpanelpass";
    //****************************

    $pass = base64_encode($authstr);
    $in = "GET /frontend/bluetrix/mail/doaddpop.html?email=$email&domain=$domain&password=$password&quota=$quota HTTP/1.0\r\nAuthorization: Basic $pass \r\n";

    fputs($socket,$in);
    fclose( $socket );


    }
    else {
    ?>

    <form method=post>
    Username:<input type=text name=email><br>
    Password:<input type=password name=password><br>
    <input type=hidden name=quota value="10">10MB MAX STORAGE<br>
    <input type=submit name="submit"><br>


    pop3 usage = SMTP & POP3 server = mail.txt3.com
    webmail Access = www.txt3.com/mail/


    <?
    }
    ?>
    http://www.gocre8.co.uk - Liverpool Web Design
    http://www.outallnite.co.uk - Liverpool Clubbing

  7. #7
    Join Date
    Apr 2002
    Posts
    61
    Although I never did this before, but I think I know what you want to do.

    First, make a file called ban_words.txt and put inside the file:
    banned_word1
    banned_word2
    ...

    Then, put in the same directory with doaddpop.html.

    Use the below's code. Done!

    I don't have cpanel so can't check for you but it should work.

    note: Watch the little error there.
    $in = "GET /frontend/bluetrix/mail/doaddpop.html?email=$email&domain=$domain&password=$password&amp;quota=$quota HTTP/1.0\r\nAuthorization: Basic $pass \r\n";

    <?
    if ($submit){

    // Do the banned words check here
    $fp = @fopen("ban_words.txt", "r");

    while (!feof($fp)) {
    $ban_list = fgetcsv ($fp, 1000, "\n");
    if (eregi ($ban_list[0], $HTTP_POST_VARS[email])) {

    unset ($HTTP_POST_VARS[submit]);
    header ("$HTTP_SERVER_VARS[PHP_SELF]?ban=1");

    }
    }
    // Banned words check ended


    $host = "www.txt3.com";
    $domain = "txt3.com";
    $socket = fsockopen($host,2082);

    // these lines are changed
    $cpaneluser = "";
    $cpanelpass = "";
    $authstr = "$cpaneluser:$cpanelpass";
    //****************************

    $pass = base64_encode($authstr);
    $in = "GET /frontend/bluetrix/mail/doaddpop.html?email=$email&domain=$domain&password=$password"a=$quota HTTP/1.0\r\nAuthorization: Basic $pass \r\n";

    fputs($socket,$in);
    fclose( $socket );


    }
    else {

    if ($HTTP_GET_VARS[ban]=='1') {
    echo "Don't use banned words!";
    }

    ?>


    <form method=post>
    Username:<input type=text name=email><br>
    Password:<input type=password name=password><br>
    <input type=hidden name=quota value="10">10MB MAX STORAGE<br>
    <input type=submit name="submit"><br>


    pop3 usage = SMTP & POP3 server = mail.txt3.com
    webmail Access = www.txt3.com/mail/


    <?
    }
    ?>
    Last edited by kyun; 10-08-2002 at 04:32 PM.

  8. #8
    Join Date
    Apr 2002
    Location
    Wirral/Cheshire/Meresyside
    Posts
    203
    thing is i dont av access to where the addpop file is as its a Cpanel account and im not the admin
    http://www.gocre8.co.uk - Liverpool Web Design
    http://www.outallnite.co.uk - Liverpool Clubbing

Posting Permissions

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