[HELP]A few Queries

Discussion in 'PHP' started by born2hack, May 25, 2008.

  1. #1
    Hi to the one who reads this, I am currently trying to make a website through PHP, its a game, or say an online Pokemon RPG. I have got many questions for it and I hope people can help me out.

    First of all the thing required is User Registration I tried my best to make some forms but sometimes I was unsuccessful or sometimes it worked but not efficiently or correctly. Plus the main thing I wanted was Image Verification and E-mail verification. Which I have doubts how to do.

    Next, I plan to make an Inbuilt Mail System and an Inbuilt Forums to discuss about games and other topics. I was successful, or say very much successful in this except a few things like:
    a)How to let people use BBcode and Smilies
    b)How to put a <br /> wherever use has press Enter.
    c)How to STOP user from using Some HTML codes, and refrain from using JS or PHP. I dont want to end up having a c99 in my website.

    Thats all for now, if anyone can help post here or drop me a PM. :D
     
    born2hack, May 25, 2008 IP
  2. CreativeClans

    CreativeClans Peon

    Messages:
    128
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
  3. born2hack

    born2hack Banned

    Messages:
    294
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks a ton. and about the other two?
     
    born2hack, May 26, 2008 IP
  4. born2hack

    born2hack Banned

    Messages:
    294
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Anyone? Please I need help
     
    born2hack, May 26, 2008 IP
  5. carpathia

    carpathia Well-Known Member

    Messages:
    124
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #5
    thanks dude
     
    carpathia, May 26, 2008 IP
  6. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #6
    BBCode and Smilies are more complex, and require you use to regular expressions, such as preg_replace . I'd lookup the source of phpBB for an example of how it's done.

    Jay
     
    jayshah, May 26, 2008 IP
  7. itnashvilleCOM

    itnashvilleCOM Banned

    Messages:
    176
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You can try something similar to this to clean out javascipt and such for security:

     
    itnashvilleCOM, May 26, 2008 IP
  8. born2hack

    born2hack Banned

    Messages:
    294
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thank you I will try it out :D
     
    born2hack, May 26, 2008 IP
  9. born2hack

    born2hack Banned

    Messages:
    294
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #9

    I thought the same but have been unable to find the source yet.... dunno why
     
    born2hack, May 26, 2008 IP
  10. bmhrules

    bmhrules Peon

    Messages:
    109
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    
    <?php
    	function bbcode($text)
    	{
    		$pattern = array();
    		$replace = array();
    		$pattern[] = '/\[b\](.*?)\[\/b\]/i';
    		$replace[] = '<b>$1</b>';
    		$pattern[] = '/\[B\](.*?)\[\/B\]/i';
    		$replace[] = '<b>$1</b>';
    		$pattern[] = '/\[i\](.*?)\[\/i\]/i';
    		$replace[] = '<i>$1</i>';
    		$pattern[] = '/\[I\](.*?)\[\/I\]/i';
    		$replace[] = '<i>$1</i>';
    		$html = preg_replace($pattern, $replace, $text);
    		return $html;
    	}
    ?>
    
    PHP:
    This is more or less what I have been using.
     
    bmhrules, May 27, 2008 IP
  11. CodyRo

    CodyRo Peon

    Messages:
    365
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #11
    CodyRo, May 27, 2008 IP