Search found 86 matches

by Tony
Sun Nov 29, 2009 5:20 am
Forum: PHP & MySQL
Topic: How to use .htaccess/.htpasswd Password Protection with PHP
Replies: 0
Views: 1150

How to use .htaccess/.htpasswd Password Protection with PHP

Setting up password protection The best way to secure content on your website is to use .htaccess/.htpasswd protection. This will password protect any directory and all directories below. You will need to create a .htaccess file which you put in the directory you want to protect. You will also need...
by Tony
Sun Nov 29, 2009 5:14 am
Forum: Web programming
Topic: Single Line JavaScript
Replies: 0
Views: 819

Single Line JavaScript

Fot a multi-line alert, use "\n" for a the line break. alert ('This is line one\nThis is line two');   If you want to test your website in different resolutions make a bookmark (or favorite) with the following as the link or location. javascript:resizeTo(800,600);   Ensure your page is not opened in...
by Tony
Sun Nov 29, 2009 5:13 am
Forum: Web programming
Topic: Single line HTML
Replies: 0
Views: 897

Single line HTML

You can easily create a scrollable text box with this one line <div> tag. You can put anything inside the scrollable area. This is a very simple one line alternative to the iframe. <div style="padding: 20px; overflow: auto; border: solid 1px black; width: 400px; height: 300px;">  Content goes here <...
by Tony
Sun Nov 29, 2009 5:10 am
Forum: PHP & MySQL
Topic: Single line PHP codes
Replies: 0
Views: 618

Single line PHP codes

Validate the format of a domain name: if (!preg_match("(^([-a-z0-9]+\.)+[a-z]{2,4}$)i", $domain)) echo "Domain name $domain is not valid";   Validate the format of an email address: if (!preg_match("(^[-\w\.]+@([-a-z0-9]+\.)+[a-z]{2,4}$)i", $email)) echo "Email address $email is not valid";   Valida...
by Tony
Sun Nov 29, 2009 5:07 am
Forum: Web programming
Topic: Very good CSS examples
Replies: 1
Views: 1350

Very good CSS examples

Below is an example of a CSS menu. Copy the code into an html page. <style type="text/css"> #menu { display: block; border: solid 1px rgb(190,60,40); list-style: none; text-align: left; width: 85px; margin: 0px; padding: 0px; background-color: white; } #menu li { margin-bottom: 4px; margin-left: 4px...
by Tony
Sun Nov 29, 2009 5:05 am
Forum: PHP & MySQL
Topic: How to use SQL with PHP
Replies: 0
Views: 595

How to use SQL with PHP

This SQL and PHP will count how many rows contain unique elements in your database. For example, you may have a database of user entries and want to know how many entries each user has. In this example, you want to know how many rows contain each unique element "name": $query = mysql_query("SELECT n...
by Tony
Sun Nov 29, 2009 5:04 am
Forum: PHP & MySQL
Topic: How to handle errors in MySQL using PHP
Replies: 0
Views: 652

How to handle errors in MySQL using PHP

Would you like to be notified when your site has a MySQL error? This PHP script will trap MySQL errors and send the user a custom error page. It will then either log the error or email you with the details of the error, or both. You can customize this example to launch other pages based on the type ...
by Tony
Sun Nov 29, 2009 5:02 am
Forum: PHP & MySQL
Topic: How to use AJAX and PHP by example
Replies: 0
Views: 634

How to use AJAX and PHP by example

Asynchronous JavaScript And XML AJAX is a method of making a web page more application like. It allows server interaction without having to reload the web page. It uses a combination of server-side scripting (in this example PHP), and client-side JavaScript and the XMLHttpRequest object. This is no...
by Tony
Sun Nov 29, 2009 5:00 am
Forum: Web programming
Topic: Regular Expression Rules
Replies: 0
Views: 1171

Regular Expression Rules

re.PNG
re.PNG (23.16 KiB) Viewed 1134 times
by Tony
Sun Nov 29, 2009 4:58 am
Forum: PHP & MySQL
Topic: How to create Simple "members only" pages using PHP
Replies: 0
Views: 731

How to create Simple "members only" pages using PHP

By combining some of the Tips & Scripts on this page it is possible to make a simple "members only" section on your website. When a user logs in they are automatically sent to their page, and can not get to anyone else's page. Use the "setting up password protection" tip to set up a password protect...

Go to advanced search