Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Tuesday, September 28, 2010

How to manual install PEAR PHP extension

1. Load http://pear.php.net/go-pear in your browser.
2. Save the output to a local file go-pear.php on your php installation folder.
2. Then run:
php go-pear.php

Wednesday, September 15, 2010

How to Setup Selenium in PHP Environment

If you have gone through configuring Selenium in Windows system by Setting up Selenium RC server in Windows and Setting up PHP in Windows using Abyss server, next thing you need to setup is the Selenium PHP client. Let me show you the steps I've gone through to accomplish this:

1. Open up the console with all administrative privileges especially in Vista
2. Go to the directory where PHP is installed
3. Execute command:
php PEAR/go-pear.phar
4. Follow the instructions, and ignore the additional offerings to configure it
5. Install PHPUnit by:
pear channel-discover pear.phpunit.de
pear install phpunit/PHPUnit
6. Download Selenium PHP PEAR extension and place into your PHP directory
7. Run:
pear install Testing_Selenium-0.4.3.tar
8. Download the sample GoogleTest and assuming you put it in C:\Tests folder
9. Now run:
phpunit --verbose GoogleTest C:/Tests/GoogleTest.php
10. Remember the class name GoogleTest must be the same as the class name defined in the GoogleTest.php


Source: [Geek With Blogs]

Monday, September 6, 2010

Connecting to MySQL Database in PHP

<?php

    $dbname="{database name}";
    $cn=mysql_connect('{host}','{username}','{password}') or 
    die("I Couldn't connect");
    $db=mysql_select_db($dbname,$cn) or die("I Couldn't select your database");
    $app_table1="{table name}";

?>