Archive for the 'PHP Class' Category

PHP-MySql Connection Script

Saturday, July 29th, 2006

Using This Script We can connect phpMysql.
———————————————————————————— 
<?
// hostname or ip of server
$servername=’localhost’;
// username and password to log onto db server
$dbusername=’Username;
$dbpassword=’password’;
// name of database
$dbname=’a’;
connecttodb($servername,$dbname,$dbusername,$dbpassword);
function connecttodb($servername,$dbname,$dbuser,$dbpassword)
{
global $link;
$link=mysql_connect (”$servername”,”$dbuser”,”$dbpassword”);
if(!$link){die(”Could not connect to MySQL”);}
mysql_select_db(”$dbname”,$link) or die (”could not open db”.mysql_error());
}
?>
 
—————————————————————————————————

Variables and Constants in PHP

Tuesday, May 16th, 2006

A variable is a holder for a type of data. So, based on its type, a variable can hold numbers, strings, booleans, objects, resources or it can be NULL. The variable name consists of letters, numbers and/or the underscore character (“_”), preceded by a dollar (“$”) sign. It cannot include spaces or [...]

PHP Types

Thursday, May 11th, 2006

PHP uses different types of data in its many functions. For example, if you have a script that adds up two numbers, you need to provide two numbers. If a script searches a text within another text, you need to provide two series of characters. These are two simple types of data.
Different [...]

Structure of a PHP script

Tuesday, May 9th, 2006

Let’s get back to the script we used before:
<?php
print "Hello Web!";
?>

In this simple script you can see some of the most used components of a PHP script. First off, PHP tags are used to separate the actual PHP content from the rest of the file. You can inform the interpreter that [...]

First PHP script

Tuesday, May 9th, 2006

Writing PHP code is very easy. You don’t need specialized software to do this, all the tools should be found in a new installation of your operating system. Let’s start off with a little script and analyze its contents. PHP files are made up of plain text, just like a HTML document. [...]

PHP Configuration

Saturday, May 6th, 2006

After installing PHP, the next step would be configuring its many options. In order to do this, you must edit the configuration file, which should be called "php.ini". PHP reads this file when it starts, so you shouldn’t expect your changes to apply as soon as you’ve modified the file, you have [...]

PHP Installation(Tutorials)

Wednesday, May 3rd, 2006

Before you start programming with PHP, you must first acquire, install, and configure the PHP interpreter. PHP is available for a lot of platforms, and works in conjunction with many web-servers. Along with PHP itself and a web-server you also need a web-browser, so you can view the outcome of your work.
The latest version of [...]

PHP Tutorial The Microwave Way to PHP Programming

Wednesday, May 3rd, 2006

From today I want to write about PHP,coz Im learnig PHP.So let’s start…

What is PHP
The endless possibilities of the PHP scripting language and a great community of users has made it one of the most popular open-source languages. For all you people living outside the UNIX world, Open Source means it doesn?t cost anything. [...]