Search found 86 matches
- Sun Nov 29, 2009 4:57 am
- Forum: PHP & MySQL
- Topic: How to Replace banned words using PHP
- Replies: 0
- Views: 1536
How to Replace banned words using PHP
This script will replace banned words in the string $message with an * for each letter. You can use this when receiving POST data with text input. In this example the banned words are in a text file called words.dat (in the same directory as the script) with one banned word per line. <?php $words_ar...
- Sun Nov 29, 2009 4:56 am
- Forum: PHP & MySQL
- Topic: How to Get the most recent file date using PHP
- Replies: 0
- Views: 1559
How to Get the most recent file date using PHP
When you need that most recent update date. You can use this script to get the most recent file date in a given directory. To use current directory, use "./" as the directory name. <?PHP $path = "./"; // put the directory path here foreach (glob($path) as $filename) if (filemtime($filename) >= $r...
- Sun Nov 29, 2009 4:55 am
- Forum: Web programming
- Topic: How to Validate Webpages
- Replies: 0
- Views: 1863
How to Validate Webpages
If you wish to validate the HTML and/or CSS code in webpages that you visit, create two bookmarks using the following code as the addresses: javascript:window.location="http://validator.w3.org/check?uri="+window.location javascript:window.location="http://jigsaw.w3.org/css-validator/validator?uri="...
- Sun Nov 29, 2009 4:54 am
- Forum: Web programming
- Topic: How to view your website in different resolutions
- Replies: 0
- Views: 1944
How to view your website in different resolutions
If you want to test your website in different resolutions, this Tip shows you an easy way. Make a bookmark (or favorite) with the following as the link or location. In this example, your browser will be resized to 800 by 600 leaving the browser content the same. Note - Internet Explorer sometimes ch...
- Sun Nov 29, 2009 4:53 am
- Forum: Web programming
- Topic: How to Masking your URL in the Address Bar
- Replies: 0
- Views: 1839
How to Masking your URL in the Address Bar
You can use frames to mask your address bar so it always shows www.yourdomain.com when viewing your pages. Use the frameset below in your default page (index.htm). In this example, the frameset will load home.htm and start your site from there. But the address bar will stay showing www.yourdomain.co...
- Sun Nov 29, 2009 4:52 am
- Forum: PHP & MySQL
- Topic: How to use Cookies using PHP
- Replies: 0
- Views: 1545
How to use Cookies using PHP
This script shows an example of how to use a cookie. It reads and sets a cookie value that can be used to track visits by a specific individual (PC/browser). The parameters are: The variable name The variable value The length of time the cookie should be saved on the PC for reuse (the example shows ...
- Sun Nov 29, 2009 4:50 am
- Forum: PHP & MySQL
- Topic: How to Ban or allow IP Addresses (not using htaccess) using
- Replies: 0
- Views: 1612
How to Ban or allow IP Addresses (not using htaccess) using
While a .htaccess file can be used to ban or allow, it cannot be selective by function. This is something you can easily do with a script. In these examples the IP Addresses are in a file called IP.dat (in the same directory as the script) with one address per line. These scripts can also ban or all...
- Sun Nov 29, 2009 4:50 am
- Forum: Web programming
- Topic: How to ensure your page is not opened in a frame
- Replies: 0
- Views: 1786
How to ensure your page is not opened in a frame
If you want to make sure your website is not opened in a frame from some other website, put this JavaScript in the <head> of your html page:
Code: Select all
<script type="text/javascript">
if (top.location != self.location) top.location.href = self.location.href;
</script>
- Sun Nov 29, 2009 4:48 am
- Forum: PHP & MySQL
- Topic: How to Stop direct links to web pages using PHP
- Replies: 0
- Views: 1701
How to Stop direct links to web pages using PHP
Want to stop someone from entering your site unless they come in the "front door"? Or want to keep a frame page from being loaded outside of the frameset? This script example will not let you load page2 unless you have already loaded page1 in the same browser session. Note that if someone loads page...
- Sun Nov 29, 2009 4:47 am
- Forum: PHP & MySQL
- Topic: How to validate URLs using PHP
- Replies: 0
- Views: 1715
How to validate URLs using PHP
This script will allow you to validate a url (link). It can be used to validate an input value in a form or any other time you need to determine if a url is valid. If the url does not start with http:// it will be added. There is also a parameter (set to true in the script) for following redirects. ...