Jump to content

spiderwell

Members
  • Posts

    1,008
  • Joined

  • Last visited

Posts posted by spiderwell

  1. as per the last post, slot it in here on the login.php:

    list($user_id,$user_email) = mysql_fetch_row($result);
    	// this sets variables in the session 
    	$_SESSION['user']= $user_email;  
    	$_SESSION['id']= $user_id
    
    [\code]
    
    then on the about me insert, do as Justin posted only substitute $_SESSION['user'] with $_SESSION['id']
    
    personally i think emails work just as well as a unique identifier so you could still do it with the email address.
    

  2. 3rd time lucky (god i hope so!)

    <?php
    
    $words = array('ass','fuck','shit');
    $string = 'Blah blah blah ass blah blah fuck blah blah shit!';	
    foreach ($words as $value) 	
    {	                                 
    if (strpos($string,$value))
    	{			
    		echo "naughty words limit";
    		break;
    	}                 
    
    }	
    ?>	
    

  3. this should do the trick, the mistake i made was with instr() it didnt count number of times a rude word might appear, so was looking for 3 different rude words, rather than a total of 3 rude words, be they all different or the same.

     

    EDIT*** i should be shot for skim reading, this allows you to have 2 rude words and not more, really as soon as you get a hit of 1 curse word you want it to stop. i will post YET A?NOTHER solution haha i think i need to go to bed!! ******

     

    <?php
    $i = 0;
    $limit = false;
    $words = array('ass','fuck','shit');
    $string = 'ass ass blah blah ass blah blah shit  blah ass!';
    foreach ($words as $value) 	{
    $i += substr_count($string,$value);// includes multiple counts of the same naughty word
    if($i>=3)
    	{
    		$limit = true;
    		echo "naughty word limit";
    	}
    if ($limit)break;// stops the search going any further
    }	
    ?>
    

  4. try this mate, no offence to other poster, but I can't see that snippet working, or maybe I am just going mad:

    <?php
    $i = 0;
                    $words = array('ass','fuck','shit');
    $string = 'Blah blah blah ass blah blah fuck blah blah shit!';
    foreach ($words as $value) 
    {
                                     if (strpos($string,$value))
    	{
    		$i ++;		
                                     }
                     if($i>3) echo "naughty words limit";	
    }
    ?>
    

     

×
×
  • 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.