Censoring messages in PHP PHP script

SPONSORED LINKS

    Specification

  • Version:
  • File size: 0 KB
  • File name: id=1006
  • Last update:
  • Platform: Windows / Linux / BSD / Solaris
  • Language: PHP
  • Price:Freeware
  • Company: saifullah shafiq (View more)

Censoring messages in PHP script description:




Publisher review:
Censoring messages in PHP shows how to hide email addresses in your messages. Consider that you place a messaging system on your site from where users of your site can communicate wit site froher. This would really increase hits on your site but what if users give each other their email address in the message then they wont need your messaging system, hence they wont be coming to your site. So you need to censor out any email address in the messages that users send to each other. I came up with an efficient yet simple solution to this problem. All you have to do is to search for any '@' in the message and then censor out few characters that appear after it and before it. For example, if you type "myemailaddress@hotmail.com" then the script will display it like my*********com. Here is the how it works For Example we got the following message: $message = "hello this is my email address: myaddress@mydomain.com" 1. First you search for '@' in the message that is passed to the function. strrpos returns the position of the character you specify. $emailpos = strrpos($message,'@'); This line will return the value '42'. 2. Then we check if there was a '@' in the message if none then we simply return the passed message other wise we proceed to the next step. 3. Then we take out the sub string (email address) based on the position we got from above. For Example, if we got the following message. $email = substr($message,$emailpos-5,12 ); Here we start the sub string by first going back 5 characters and then taking out next 12 characters. This will return 'dress@mydoma' you can change the length by changing values in the above function. I only used 12 characters because i think that is sufficient. You can change this according to your needs. 4. Then in the final step we simplly need to replace this substring (email address) with anything we like. Iprefer using '******'. You can use whatever you want. $message =eregi_replace($email,"********",$message); 5. Thats it! Now you just return the censored $message.
Censoring messages in PHP is a PHP script for Snippets scripts design by saifullah shafiq. It runs on following operating system: Windows / Linux / BSD / Solaris.

Operating system:
Windows / Linux / BSD / Solaris

Latest script and internet news

222

222

22

Posted on: 18 Jul 2023 22:27 by A. Brown

111

111

111

Posted on: 18 Jul 2023 22:24 by A. Brown

The permanently active Push system offered by the new Google Chrome 42

The permanently active Push system offered by the new Google Chrome 42

Hacked By !Sc-sT

Posted on: 17 Mar 2015 07:57 by A. Brown

SPREAD THE WORD

User Rating


Rating: 2.2 out of 5
Based on 13 ratings. 13 user reviews.

  • Currently 2.15 out of 5
  • 1
  • 2
  • 3
  • 4
  • 5