Showing posts with label XML. Show all posts
Showing posts with label XML. Show all posts

Saturday, March 5, 2011

How to modify php settings in xampp ?

XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start.

XAMPP Supported Platforms

a version for Linux systems (tested for Ubuntu, SuSE, RedHat, Mandrake and Debian),

a version for Windows 98, NT, 2000, 2003 and XP,

a beta version for Solaris SPARC (developed and tested under Solaris 8),
and a beta version for MacOS X.

This MacOSX and Solaris versions of XAMPP are still in the first steps of development. Use at you own risk!
http://www.debianhelp.co.uk/xampp.htm

How to make a contact us form in dreamweaver using php ?

you will learn how to create your all important Dreamweaver Contact Form and have the details of the form emailed straight to your INBOX. Capturing Contact Information of potential customers in extremely important in the business world. Don’t let those potential customers or clients disappear just because you didn’t have a Contact Form on your website. By following this Dreamweaver Tutorial you will have a WORKING Contact Form up and running in a few easy steps.
Now you are ready to begin inserting the form and the fields you would like onto the page. In this example I am going to create anew page, but you can easily add this to an existing page if you already have one in mind for the form to be placed on.
1. In Dreamweaver, choose File > New The New Document Dialog Box appears.
2. In the Blank Document list, choose HTML, then click Create to create a new HTML document.
3. In the Title text field in the Document toolbar, enter Contact Form to add a title to your document.
4. Choose File > Save, then save the document in your local site folder. Name it ContactForm.htm.
5. Next we are going to Insert a Form onto the page, Choose Insert > Form then Form from the Flyout Menu. A Form dialog box will then open. In the Action text box type in FormtoEmail.php (this is the file you extracted to the root of your website earlier). Change the Method to POST and then in the NAME text box type in ContactForm.

6. Next step is to place the form objects onto the page (the information we would like to collect). In this example I have placed a text box for Name and Email Address, and also a Text Area for Comments. To do this click inside your form object and then from the top menu select Insert > Form > Label. From the Code Window click in between the LABEL Tags and type in Name:. Next from the toip menu again select Insert > Form > Text Field. Name the Text field name from the properties box at the bottom.
Repeat those steps and add another Label and Text Field and name it email.
7. Add another Label and type in Comments. Then add a Text Area, go to Inset > Form > Text Area in the top menu. Name the Text Area comments from the Properties box at the bottom and give the Character Width a value of 50 and the Number of Lines a value of 10.
8. Add a Button. Again from the top menu Insert > Form > Button. Your Form should now look like this: (note I have put each element on a different line to help with the usability).
9. Now we need to edit a couple of lines in the FormtoEmail.php file. Open the file in Dreamweaver. The first line you need to edit is the line that starts with $my_email.
Change the email address to the address you want the emails to be sent to. The other line that you may wish to change is this one:

This is where the visitor will be directed after they have pressed the SUBMIT button. If you have a page that you like to direct them to then place the location of the file in there, or simply leave it blank and they will get a thank you message on the same page.
10. Upload both files to your web server and bingo all done. You should know have a working contact form.
In an upcoming Tutorial I am going to show you how to use Dreamweaver and CSS (Cascading Style Sheets) to jazz up your forms with a bit of style!

how to make a chat server in php ?

Here you will get instructions on how to create and run a chat engine on your website, using a server-side programming language. This article assumes you have substantial technological knowledge.
1 Install a server-side language such as PHP or ASP if you need to.
2
Create a database table with fields to store a nickname, time and message.
3
Create a user interface with 2 text boxes - one for entering a chat message and other for displaying the chat log.
4
Create the client-side script using Javascript and AJAX techniques. The script should do the following things:
o Use AJAX to transfer chat messages one wishes to send to the server.
o Periodically check the server for new messages and add them to the chat window. It needs to send the time of the last message received.

5
Create the server-side script. It should do as follows:
o Add incoming messages to the database table with the nickname of the person that said it and the time stamp.
o Return new messages it has received after the time specified in the aforementioned AJAX request.
edit Tips
• Using an AJAX library might be helpful. A lot of AJAX libraries are available for download. One of these is AjaxLib
• Clear the database once the chat is over so that you can save on disk space used for the database.

how to get php to find and display data from mysql database ?

PHP, MySQL and a Web Server capable of parsing PHP pages, like Apache or IIS. This search script does not spider all your pages by crawling the links, so the content you want to be searchable must be within the database. Knowledge of PHP and MySQL is also necessary because this script is just the bones of a working solution. Numerous edits must take place upon this script before it is a usable solution.
Lets get started. If you would rather not copy the code into a text editor
Just after the body tag of your page, place the following HTML. This is for the form which will contain the textfield to enter our search string in.
form name="form" action="search.php" method="get"
input type="text" name="q"
input type="submit" name="Submit" value="Search" form
Now, enter the following PHP. Follow the PHP comments for what the script is doing, if you get stuck,
=1) { // bypass PREV link if s is 0
$prevs=($s-$limit);
print " <<
Prev 10
  ";
}

// calculate number of pages needing links
$pages=intval($numrows/$limit);

// $pages now contains int of pages needed unless there is a remainder from division

if ($numrows%$limit) {
// has remainder so add one page
$pages++;
}

// check to see if last page
if (!((($s+$limit)/$limit)==$pages) && $pages!=1) {

// not last page so give NEXT link
$news=$s+$limit;

echo " a href=\"$PHP_SELF?s=$news&q=$var\" Next 10 >> a";
}

$a = $s + ($limit) ;
if ($a > $numrows) { $a = $numrows ; }
$b = $s + 1 ;
echo " p Showing results $b to $a of $numrows p";

?>
Three major areas are covered in this script, the first is selecting data from the database which matches your entered keyword, the second is displaying the results on the web page and the last is generating the paging, which displays results in chunks of 10 with next/previous links where they are necessary.
Important: This script requires numerous edits before it can be adapted for use. The SQL query in this example is only selecting 1 field from a hypothetical database which doesn't pre-exist, nor is included in the downloadable files. Further down the script, the value of that field is being displayed on the page. The major amendments that need to be performed are 1.) The SQL statement, and 2.) The PHP which displays the result

how to edit a php website ?

very Web developer has to know the building blocks of the Web site editing using some html page,css stylesheet and more:
• HTML 4.01
• CSS
• XHTML
• XML and XSLT
• JavaScript
• ASP or PHP
• Managing data with SQL
• The future of the Web
________________________________________
HTML 4.01
HTML is the language of the Web, and every Web developer should have a basic understanding of it.
HTML 4.01 is an important Web standard, and very different from HTML 3.2.
When tags, like font and color attributes, were added to HTML 3.2, it started a developer's nightmare. Development of web sites where font information must be added to every single Web page is a long and expensive job.
With HTML 4.01, all formatting can be moved out of the HTML document, and into a separate style sheet.
SS - Cascading Style Sheets
Styles define how HTML elements should be displayed, just like the tag in HTML 3.2.
Style sheets are normally saved in external files. External style sheets enable you to change the appearance and layout of EVERY page in your Web site, just by editing a single document. If you have ever tried changing something like the font or color of all the headings in all your HTML pages, you will understand how CSS can save a lot of work!
XHTML
XHTML stands for Extensible HyperText Markup Language.
XHTML is a reformulation of HTML 4.01 in XML, and is supported in all major
XML - A Tool for Describing Data
XML is NOT a replacement for HTML. XML describes data, while HTML displays the data.
XML is as a cross-platform, software-, and hardware-independent tool for storing and transmitting information.
We believe that XML is as important to the Web as HTML was to the foundation of the Web, and that XML will be the most common tool for all data manipulation and data transmission.
XSLT - A Tool for Transforming Data
XSLT is used to transform XML documents into other formats, like HTML, WML, etc.
XSLT can transform an XML file into a format that is recognized by a browser.
XSLT can also add HTML elements, rearrange and sort data, make decisions about which data to display, and more.
JavaScript - Client-Side Scripting
Client-side scripting is about "programming" the behavior of a browser.
To deliver more dynamic web content, you should teach yourself JavaScript.
• JavaScript gives HTML designers a programming tool
• JavaScript can put dynamic text into an HTML page
• JavaScript can react to events
• JavaScript can change HTML elements
• JavaScript can be used to validate data
ASP or PHP - Server-Side Scripting
Server-side scripting is about "programming" an Internet server.
To deliver more dynamic web content, you should teach yourself server-side scripting.
With server-side scripting, you can:
• Dynamically edit, change, or add any content of a Web page
• Respond to user queries and form data
• Access databases and return the result to a browser
• Access files and return the result to a browser
• Transform XML data to HTML data and return the results to a browser
• Customize a Web page to make it more useful for individual users
• Provide security and access control to Web pages
• Tailor your output to different types of browsers
• Minimize network traffic
Managing Data with SQL
SQL is the standard language for accessing and manipulating databases.
SQL is used to access and manipulate data in MySQL, SQL Server, MS Access, Oracle, Sybase, DB2, and other database systems.
Knowledge of SQL is a must for anyone wanting to store or retrieve data from a database.

What Will the Future Bring?
One important thing to know is that the functionality of Web Sites will change very drastically. We will see a huge shift from sites displaying "static content" to data driven sites delivering "dynamic content".
We will also see new browsers, like the browsers found in mobile devices. We will also see more use of XML for transmitting data between servers, or between servers and browsers.

Wednesday, March 2, 2011

determine if a mysqli query failed or not in php ?


Hello.
I have changed some of my old queries to the Mysqli framework to improve performance. Everything works fine on localhost but when i upload it to the webserver it outputs nothing. After connecting I check for errors and there are none. I also checked the php modules installed and mysqli is enabled.
I am certain that it creates a connection to the database as no errors are displayed. (when i changed the database name string it gave the error)
There is no output from the query on the webserver, which looks like this:
$mysqli = new mysqli("server", "user", "password");

if (mysqli_connect_errno()) {
   printf("Can't connect Errorcode: %s\n", mysqli_connect_error());
   exit;
}

// Query used
$query = "SELECT name FROM users WHERE id = ?";

if ($stmt = $mysqli->prepare("$query"))
{

    // Specify parameters to replace '?'
    $stmt->bind_param("d", $id);

    $stmt->execute();

    // bind variables to prepared statement
    $stmt->bind_result($_userName);

    while ($stmt->fetch())
    {
          echo $_userName;
    }


    $stmt->close();
 }
}

//close connection
$mysqli->close();
As I said this code works perfectly on my localserver just not online. Checked the error logs and there is nothing so everything points to a good connection. All the tables exists as well etc. Anyone any ideas because this one has me stuck! Also, if i get this working, will all my other queries still work? Or will i need to make them use the mysqli framework as well? Thanks in advance.
1 down vote
Each call to a mysqli/stmt method can fail. You should check each and every one.
Try it with error_reporting(E_ALL) and maybe display_error=On
error_reporting(E_ALL); ini_set('display_errors', 1);

// passing database name as fourth parameter
$mysqli = new mysqli("server", "user", "password", 'dbname');
if (mysqli_connect_errno()) {
   printf("Can't connect Errorcode: %s\n", mysqli_connect_error());
   exit;
}

// Query used
$query = "SELECT name FROM users WHERE id = ?";

if ( false===($stmt=$mysqli->prepare("$query")) ) {
  echo 'mysqli::prepare failed: ', htmlspecialchars($mysqli->error);
  die;
}

// Specify parameters to replace '?'
$rc = $stmt->bind_param("d", $id);
if ( !$rc ) {
  echo 'bind_param failed: ', htmlspecialchars($stmt->error);
  die;
}

echo '
Debug: execute()
';
$rc = $stmt->execute();
if ( !$rc ) {
  echo 'execute failed: ', htmlspecialchars($stmt->error);
  die;
}

echo '
Debug: bind_result()
';
// bind variables to prepared statement
$rc = $stmt->bind_result($_userName);
if ( !$rc ) {
  echo 'bind_result failed: ', htmlspecialchars($stmt->error);
  die;
}

echo '
Debug: fetch()
';
while ($stmt->fetch())
{
  echo 'username: ', $_userName;
}
echo '
Debug: stmt close()
';
$stmt->close();

echo '
Debug: mysqli close()
';
$mysqli->close();

check is number is odd or even php ?

How to find if a number is odd or even?
In PHP I learn to use the MOD (%) operator. see below for an example: $i = 10;
if ($i % 2) {
echo "$i is odd";
} else {
echo "$i is even";
}

You can also use the PHP “&” operator that will give you better performance
You can use the PHP code like so:
$i = 10;
if ( $i&1 )
{
echo "$i is odd";
}
else
{
echo "$i is even";
}

check if string is regex php ?

What is a regex?


At its most basic level, a regex can be considered a method of pattern matching or matching patterns within a string. In PHP the most oft used is PCRE or "Perl Compatible Regular Expressions". Here we will try to decypher the meaningless hieroglyphics and set you on your way to a powerful tool for use in your applications. Do not try to understand all this in a single sitting. Instead, take in a little and come back as you grasp various concepts.

Where do I begin?

At the beginning.
Lets create a string.

// create a string$string 'abcdefghijklmnopqrstuvwxyz0123456789';
// echo our stringecho $string;
?>
If we simply wanted to see if the pattern 'abc' was within our larger string we could easily do something like this:
// create a string$string 'abcdefghijklmnopqrstuvwxyz0123456789';

echo 
preg_match("/abc/"$string);?>
The code above will echo '1'. This is because it has found 1 match for the regex. That means it has found the pattern 'abc' once in the larger string. preg_match() will count zero if there is no matches, or one if it finds a match. This function will stop searching after the first match. Of course, you would not do this in a real world situation as php has functions for this such as strpos() and strstr() which will do this much faster.

Match beginning of a string

Now we wish to see if the string begins with abc. The regex character for beginning is the caret ^. To see if our string begins with abc, we use it like this:
// create a string$string 'abcdefghijklmnopqrstuvwxyz0123456789';
// try to match the beginning of the stringif(preg_match("/^abc/"$string))
    {
    
// if it matches we echo this line
    
echo 'The string begins with abc';
    }
else
    {
    
// if no match is found echo this line
    
echo 'No match found';
    }
?>
From the code above we see that it echo's the line
The string begins with abc
The forward slashes are a delimeter that hold our regex pattern. The quotations are used to 'wrap it all up'. So we see that using the caret(^) will give us the beginning of the string, but NOT whatever is after it.

can you make multiple mysql connections with php ?

You can make multiple calls to mysql_connect(), but if the parameters are the same you need to pass true for the '$new_link' (fourth) parameter, otherwise the same connection is reused.
so then you have
$dbh1 = mysql_connect($hostname, $username, $password); 
$dbh2 = mysql_connect($hostname, $username, $password, true); 

mysql_select_db('database1', $dbh1);
mysql_select_db('database2', $dbh2);
Then to query database 1, do
mysql_query('select * from tablename', $dbh1);
and for database 2
mysql_query('select * from tablename', $dbh2);
Alternatively, if the mysql user has access to both databases and they are on the same host (i.e. both DBs are accessible from the same MySQL connection) you could:
  • Keep one connection open and keep calling mysql_select_db() to swap between. I don't think this is a clean solution and you will easily get cases where you query the wrong db etc.
  • Use queries where you specify the database name (e.g. SELECT * FROM database2.tablename), but this is again likely to be a pain to implement.

what feature of php 5.3 does appulous make the most use of in its database system?

I have a page that is supposed to connect to two separate databases. One for displaying the latest three posts from my simplemachines forum and one for all the other page data.

The connections are established through 2 separate require files at the beginning of the page.

For the simplemachines forum Im using its own functions called SSI.

For the other connection I have a separate file written.

heres the code:

PHP Code: require (forum/SSI.php);
require (functionFiles/dbConnectLOCAL.php);
dbConnect (); 


Strangely when I upload it to my webhost, it works fine with both connections. But when I try to test it locally the existing connection looks for the tables in whichever database is connected first.

Does anyone know how I can connect to two databases parallelly?

thanks,

TT Hi,

I have a page that is supposed to connect to two separate databases. One for displaying the latest three posts from my simplemachines forum and one for all the other page data.

The connections are established through 2 separate require files at the beginning of the page.

For the simplemachines forum Im using its own functions called SSI.

For the other connection I have a separate file written.

heres the code:

PHP Code: require (forum/SSI.php);
require (functionFiles/dbConnectLOCAL.php);
dbConnect (); 


Strangely when I upload it to my webhost, it works fine with both connections. But when I try to test it locally the existing connection looks for the tables in whichever database is connected first.

Does anyone know how I can connect to two databases parallelly?

thanks,

what is a php file?

PHP, which stands for "Hypertext Preprocessor", is a server-side, HTML embedded scripting language used to create dynamic Web pages. Much of its syntax is borrowed from C, Java and Perl with some unique features thrown in. The goal of the language is to allow Web developers to write dynamically generated pages quickly.
In an HTML page, PHP code is enclosed within special PHP tags. When a visitor opens the page, the server processes the PHP code and then sends the output (not the PHP code itself) to the visitor's browser. It means that, unlike JavaScript, you don't have to worry that someone can steal your PHP script.
PHP offers excellent connectivity to many databases including MySQL, Informix, Oracle, Sybase, Solid, PostgreSQL, and Generic ODBC. The popular PHP-MySQL combination (both are open-source products) is available on almost every UNIX host. Being web-oriented, PHP also contains all the functions to do things on the Internet - connecting to remote servers, checking email via POP3 or IMAP, url encoding, setting cookies, redirecting, etc.

Tuesday, March 1, 2011

php submitter your has been sent ?

[PHP] Checking if a form has been submitted, the correct way...
Checking that a form has been submitted is one of the first things you will encounter when handling form inputs. For arguements sake, here is my example form:

Code:

form action="script.php" method="post"
input name="email" type="text"
input name="submit" type="submit" value="Submit"
form


What the form above will do is post the variables email and submit to the action, script.php.

At this stage most people tend to check to see if a form has been executed by verifying if the submit button variable has been delivered to the receiving script, using code similar to this:

PHP Code:
if(isset($_POST['submit']))
In most cases this will work, but there are a few occasions when it won't. To identify when this condition will fail we have to look at the different ways of submitting a form.

There are two ways of submitting a form, one is to click the submit button, the other is to hit return, of which will envoke the submit button. The problem occurs when you hit the return button (as most people do), when using Internet Explorer (the most commonly used browser) and when the submit button does not have focus. This will submit the form, but it will not send the submit variable, which would mean the script we are using above will fail.

Despite this flaw, there is an easy solution:

Code:

input type='hidden' name='submit'

Here we are setting a hidden variable within our form, so no matter how the form is submitted, the submit variable will always be posted, this means there is no requirement to modify how your PHP works.


I hope this helps,

php code which shows even and odd numbers ?

Testing whether a number is odd or even in PHP. The custom function is_odd() below is inspired by an algorithms thread at Devshed. The function isn’t even necessary and could be expressed as a one-liner like this:
echo($number & 1); // $number = any integer, 0 = even, 1 = odd


Here’s the code to check the hours in the day starting with 0 (midnight) and ending at midnight (23):
function is_odd($number) {
return $number & 1; // 0 = even, 1 = odd
}

foreach(range(0,23) as $number) {
print “$number “ . is_odd($number) . ‘
’;
}
?>

Notes: The range function is handy for prefilling with a string or array with numbers. Now what if you want to show alternating messages, one on the even hours and one on odd hours? The following code will do just that if you change the print statement to be whatever you want to alternate:

Monday, February 28, 2011

how to make chat on php ?

how to read csv file and display its field values on a web page. Complete PHP source code is provided.
Download filetoread.csv file with tab delemited fields. For simplicity the file has only six fields and five records. Create datafeed derictory in your web site root directory and save filetoread.csv file in datafeed directory. Look at the file records.
the PHP file with source code, which reads the csv file is explained below
');
print('Computer electronics');
print('PartnumberProductCompany
LinkPrice');
//declare variable to count records
$rowcount = 0;
//get path to file assumming that file located in datafeed folder
$path_to_file="datafeed/filetoread.csv";
//open file for reading "r"
$handle = fopen($path_to_file, "r");
//read file line by line
while (($record = fgetcsv($handle, 1000, " ")) !== FALSE)
{
// read number of fields in one record
$numfields = count($record);
//Display all fields for debugging, to know which data is in which field.
//In real scv datafeed file of an affiliated program a lot of fields are stored
//data, that you do not need. Using output below you can see what fields to select
//to build your advertisement on your web page

for($i=0; $i<$numfields; $i++) { echo $i.":".$record[$i]."
";
}

//read field values in variable
$part=$record[0];
$number=$record[1];
$product=$record[2];
$company=$record[3];
$clicklink=$record[4];
$price=$record[5];
//skip the first record since it has field headers only
if($rowcount > 0)
{
//if record has link to item display it in the table row
if($record[3] !="")
{
print(''.$part.''.$number.''.$product.'
'.$company.'
'.$product.''.$price.'');
}
}
$rowcount++;
}
fclose($handle);
print('');
?>
Download readcsv.txt file and save it as .php file in your web site root directory.
Download filetoread.csv file with tab delemited fields.
Remove txt extension after downloading files.
In a web page you want to display records from csv file type:

We are done.

how to get php run on a windows shell ?


>Is there a way to execute PL/SQL scripts from PHP? I have PL/SQL scripts
>that utilizes the DBMS_xxx packages. Is it possible to shell out a command
>that will run the PL/SQL? You'll have to define what you mean by 'PL/SQL script'.

Do you mean a PL/SQL block? Just use OCIParse/OCIExecute. There's an example
in the PHP manual.

Or do you mean you have a file containing one or more SQL and/or anonymous
PL/SQL blocks, which you'd normally run with SQL*Plus? And in particular, does
it use any SQL*Plus commands? (e.g. SET, or COLUMN). If so, shell out to
SQL*Plus with system() or exec() or backticks etc.
46. how to get php run on a windows shell
As well as running PHP scripts via a web server such as Apache, you can also run PHP scripts from the command line (it's also possible to write GUI apps with PHP using PHP-GTK, but I'll maybe look at that another time). This post looks at the two ways you can run a PHP script from a *nix based computer (Linux, UNIX, BSD, OSX) and the single way you can do it from Windows.
UNIX shell scripts are set as executable and the first line in the file contains a "shebang" line which shows the path to the executable which will parse the script.
If your distro's PHP binary is at e.g. /usr/bin/php you would add this to the first line of your script:
#!/usr/bin/php
and then have your PHP script under it.
To run a "hello world script" you'd do this:
#!/usr/bin/php
  echo "hello world\n";
The script then needs to be marked as executable. To set it so it can be run as anyone do this:
chmod 0755 /path/to/script.php
To make it so only you can run it (and so no one else can even read it) do this:
chmod 0700 /path/to/script.php
Read the chmod manpage for more details about file permissions if you don't know about them

how can pl/sql execute php ?

>Is there a way to execute PL/SQL scripts from PHP? I have PL/SQL scripts
>that utilizes the DBMS_xxx packages. Is it possible to shell out a command
>that will run the PL/SQL? You'll have to define what you mean by 'PL/SQL script'.

Do you mean a PL/SQL block? Just use OCIParse/OCIExecute. There's an example
in the PHP manual.

Or do you mean you have a file containing one or more SQL and/or anonymous
PL/SQL blocks, which you'd normally run with SQL*Plus? And in particular, does
it use any SQL*Plus commands? (e.g. SET, or COLUMN). If so, shell out to
SQL*Plus with system() or exec() or backticks etc.

get directory name of current directory php ?

You can easily get the current directory name at where the script is currently running. The below code will print the current directory name into screen.


$directory = dirname(__FILE__);
print $directory;


How the script works? Here __FILE__ holds the name of the currently executing file. And using finction dirname() its extracting the directory name component from it.

That means if your script name is "test.php", then __FILE__ has something like "c:\work\test.php". The function dirname() just removing that test.php from it, and returning "C:\work\"

free webhost which support php ?

Below are listed free PHP webhosting sites -- free website hosts that allow webmasters to use PHP scripts. Usually the web server provides PHP4 and/or PHP5, but occasionally they even support PHP3 files. Some free PHP hosting servers will even give you free web hosting with free MySQL database. Also see the free PHP hosting services comparison benchmark results which shows a graph chart comparing the webserver speeds (PHP script execution times) of many free PHP hosts.

check if an object has been instantiated in php?

You have to check a variable to see whether it contains an object of the
right type

Thus
-------------------------------------------------------------
Dim X as clsContract

If X is nothing then
MessageBox.Show("There is No Object here")
Endif
X = New clsContract

If Not (X is nothing) then
MessageBox.Show("There is an Object here")
Endif
-------------------------------------------------------------


However the variable you test can be a shared variable within the class.
This is an example of the 'singleton' pattern.

Thus
-------------------------------------------------------------
Public Class clsContract
Private Sub New()
End Sub
Private Shared mSingleton as clsClass
Public Shared Function GetSingleton as clsContract
If mSingleton is nothing then
mSingleton = New clsContract
Endif
return mSingleton
End function
Public Shared function Exists() as boolean
return not (mSingleton is nothing)
End function
End Class
-------------------------------------------------------------

Your button code might then use this
-------------------------------------------------------------
Dim x as clsContract = clsContract.GetSingleton()
-------------------------------------------------------------

This may or may not be what you mean.

Friday, February 25, 2011

what is php file?

* PHP files can contain text, HTML tags and scripts
* PHP files are returned to the browser as plain HTML
* PHP files have a file extension of ".php", ".php3", or ".phtml"