Perl : Programming Language

Posted on January 31st, 2008 in Perl, ASP Host UK by admin

Short for Practical Extraction and Report Language, Perl is a programming language developed by Larry Wall, especially designed for processing text. Because of its strong text processing abilities, Perl has become one of the most popular languages for writing CGI scripts. Perl is an interpretive language, which makes it easy to build and test simple program

Set up the MySQL connection using Dreamweaver

Posted on January 31st, 2008 in Dreamweaver, MySQL Database, ASP Host UK by admin

1. Open Dreamweaver

2. Click File>New

3. Choose “Dynamic Page” in left frame and then “PHP” (or any other type of dynamic page) in right frame.

4. Click Create (a new blank page will appear).

5. On the Tools window drop down the “Application” window and choose the “Database” tab.

6. Assuming a site has been created already you can skip option #1.

7. In the first 4 steps listed above a document type was created already, so you can skip option #2.

8. Click on the link that says “testing server” in option #3.

9. Server model should equal PHP MySQL (this is the dynamic page chosen was equal to PHP).

10. Access should equal FTP (this information is pertaining to how Dreamweaver will upload it’s pages).

11. FTP host must equal the users domain name

12. Host directory must equal the directory to where the user would like his/her pages to be uploaded to.

13. Login must equal the ASP HOST’s FTP login info.

14. Password must equal the ASP HOST’s FTP pass.

15. URL prefix must be the complete URL (i.e. http://yourdomain.com/database/)

16. Click “OK”

17. Under the Databases tab in the application window click on the + symbol at the top of the window and choose “MySQL Connection”

18. Connection name can be anything (this is only a descriptive name for the user to recognize the specified connection).

19. MySQL Server Name must equal localhost

20. User name must user name of the database that you set up

21. Password must equal the password used to access the MySQL database (as you configured it)

22. Database must equal the user name user name as in (20) above

23. Click Test

24. If the test is successful click “OK” if the test in unsuccessful review the information provided in step #17.

Connect to database on another server from PHP script

Posted on January 31st, 2008 in PHP, MySQL Database, ASP Host UK by admin

A connection is made to a database with the usual statement:

mysql_connect(’localhost’,’USERNAME‘,’PASSWORD’);

Where ‘localhost’ is the database on the same web server as the PHP script.

If you want to connect to a database to another web server you would replace localhost’ to that of the IP address of the web server.

Importance of MySQL

Posted on January 31st, 2008 in MySQL Database, ASP Host UK by admin

MySQL is very fast, reliable, and easy to use. MySQL also has a very practical set of features developed in close cooperation with its users. It is also Open Source and therefore freely accessible. MySQL is used to access databases on the internet due to its connectivity, speed and security. It was originally developed to manage large databases at a much faster speed than the solutions that previously existed. MySQL has for several years, been thriving in the challenging areas of production.

MySQL Database

Posted on January 31st, 2008 in MySQL Database, ASP Host UK by admin

MySQL is a Relational Database Management System. A relational database adds speed and flexibility, by storing data in separate tables rather than putting all the data in one area. These tables are linked by defined relations making it possible to combine data from several tables upon request. Using a RDMS means it is possible to add, access, and process the data stored in your database. ‘SQL‘ stands for “Structured Query Language” - the most common standardised language used to access databases.

Connect to MySQL with ASP

Posted on January 31st, 2008 in MySQL Database, ASP Scripting, ASP Host UK by admin

You will need to use a DSNless connection which can be achieved by using code with the following VBscript:

set rsEvents = Server.CreateObject(”ADODB.Recordset”)
rsEvents.ActiveConnection = “Driver={MySQL}; DATABASE=databasename;USER=username; PASSWORD=password; Server=127.0.0.1″

…or the following JScript:

var rsEvents = Server.CreateObject(”ADODB.Recordset”);
rsEvents.ActiveConnection = “Driver={MySQL}; DATABASE=databasename;USER=username; PASSWORD=password; Server=127.0.0.1″;

Query a MySQL database from a PHP script

Posted on January 29th, 2008 in PHP, MySQL Database by admin

Use the following outline to connect and begin querying the MySQL server from within your PHP scripts. Remember that you cannot connect to your databases remotely for security reasons; you can only connect from localhost.

1. Connect to the MySQL Server

 Use the following statement to connect to the database server. Substitute the username and password for those that have been created in the control panel and have given adequate permissions to this database.

 mysql_connect(’localhost’,'USERNAME’,'PASSWORD’);

 2. Select Your Database

 Use the following statement to select the database you wish to connect to. Make sure you substitute your database name.

 mysql_select_db(”DATABASENAME”);

 3. Executing A Query

 You are now ready to execute your queries. Most problems that arise with your scripts will be caused by incorrect permission settings or syntax errors within the code.

PHP - An Open Source Scripting Language

Posted on January 29th, 2008 in PHP, ASP Host UK by admin

PHP: Hypertext Preprocessor, an open source, server-side, HTML embedded scripting language used to create dynamic Web pages. In an HTML document, PHP script (similar syntax to that of Perl or C ) is enclosed within special PHP tags. Because PHP is embedded within tags, the author can jump between HTML and PHP (similar to ASP and Cold Fusion) instead of having to rely on heavy amounts of code to output HTML. And, because PHP is executed on the server, the client cannot view the PHP code. PHP can perform any task that any CGI program can do, but its strength lies in its compatibility with many types of databases.

PHP is fully supported on all hosting accounts with ASP Web Host and PHP Web Host. For more information about PHP we suggest looking at www.php.net

Global.asa File

Posted on January 16th, 2008 in ASP.Net, ASP Scripting, ASP Host UK by admin

The Global.asa file is an optional file that can contain declarations of objects, variables, and methods that can be accessed by every page in an ASP application. All valid browser scripts (JavaScript, VBScript, JScript, PerlScript, etc.) can be used within Global.asa.

The Global.asa file can contain only the following:

  • Application events
  • Session events
  • <object> declarations 
  • TypeLibrary declarations
  • the #include directive

Note: The Global.asa file must be stored in the root directory of the ASP application, and each application can only have one Global.asa file.

Web.config File

Posted on January 16th, 2008 in ASP.Net, ASP Scripting, ASP Host UK by admin

Web.config is the main settings and configuration file for an ASP.NET web application. The file is a text based XML document that defines such things as connection strings to any databases the application uses, the default language for child pages, whether debugging is allowed and how it can be implemented, whether session state is used by default, what type of authentication is used, if any, and so on. Web.config files can only be placed inside directories that have been configured as ASP.NET applications, commonly the web application’s root directory. Web.config files inherit properties from higher level .config files and ultimately machine.config however some settings inside machine.config cannot be overridden.

The ‘web.config’ file is so central to the ASP.NET framework that when the file is saved, IIS restarts the application it belongs to. Visual Studio will automatically create a web.config file when needed, such as compiling a web application to run in debug mode.(Source : Wikipedia )