Upload Share and Earn

Wednesday, September 26, 2007

Ajax Tutorial

Ajax Tutorial



Ajax is simple known asynchronous javascript and xml which is new technique of writing web applications more user friendly.This is first started using by
big companies like google,yahoo etc

How to Create Dynamic check box in php ?

while( )
{

input type="checkbox" name="myboxes[]"

}


you can access dynamic check boxes thru myboxes[] array

using loop

How to create Dynamic Drop down in php pr dynamic list box?

How to create Dynamic Drop down or dynamic list box in php?


Ans) It is very Simple to load
(select)
(option width="20" heigth="20") $filename (/option)
(/select)

where $filename is the value retrived from the database


This is the sample code where we are retriving valus from table in database and loading in to drop down box.

select box name plays an important here in posting the information

thank you
hope this helps for you

Thursday, September 13, 2007

PHP Interview Questions From yahoo

Hi Guys,

You all might be busy with your work. I hope this will be useful
information for you all. Following are the questions asked in the
interview of Yahoo!, last sunday.

PHP
----
1. Differences between sessions and cookies
2. Disadvantage of sessions
3. How to upload file using Get method
4. What is the max size of post method
5. How to store sessions in database
6. "a_b_2_3__5_ 6_8_a_b_2_ 4" given as a string Explode it
using Underscrore and find out unique alphanumeric existences and
their no.of occurences
7. Explain DB.ini file configuration in PHP
8. Registar_globals
9. connect,pconnet differences
10. setting php configurations dynamically
11. Soap Vs Rest
12. Error handling when an object calls an function which is not
existing in class
13. Implementation of Destructors in PHP4
14. In php5, in a class
__construct( ) is one method and another method name same as class name
Which will be called when object is intialized
15. Writing Code snippet for Stack implementation using OOPs.

Javascript
-----------
1. OOPs(inheritence and polymorphism) implementation in Javascript
2. Implement Trim functionality in javascript
3. Explain different types of objects(Native ,Host and user Defined) in
javascript
4. Try to extend Trim() method on String object
5. Explain all parameters of Window.open( )
6. How to avoid Permission denied error when child window accesses
parent window's elements.
7. Enabling and disabling Client's cookie settings using javascript
8. Write code snippet for managing the size of text area so that it will
not get scrollbar
(with DOM and without DOM)

HTML
----
1. Span vs Div
2. InnerHTML explanation
3. Form tag properties while uploading file
4. Frames vs Iframes
5. W3standards
6. How do you implement Search engine optimization Using HTML

CSS
----
1. #txt and .txt diffences
2. Order of preference for differnt types of CSS(inline,external etc.)
3. How to avoid scrollbar for textarea

Database
---------
1. Explain SQL Query processing
2. Explain Analyze option
3. Getting 10 to 20 records in mysql
4. Query to alter the data type of a field
5. Backup and Restore of Mysql database
6. Mysql 4 vs Mysql 5
7. Normal Forms
8. Employee table(empid, name,deptid, sal)
Query to retrive the details of employees who are having sal more
than the average of their dept sal
9. Inner join Vs Outer Join
10. Unique key vs. Primary key
11. Triggers in Mysql

Linux
------
1. How to monitor currently running processes in linux/unix
2. How to send a process to background[Atleast Three commands]
3. How to change the priority of processes
4. How to see the lists of services running currently
5. How to stop an user to connection to linux with ssh
6. How to reset root password
7. Installing PHP,apache and Database
8. How do you add modules to php(like gdlibrary) in windows and linux
9. How to see the ip address of linux system as normal user
10. what are the tools you use for file upload and ssh connection for linux

Apache
------
1. Virtual hosting
2. How to run apache on 2 or more ports at a time
3. What is directory index
4. How do you control no.of connections to webserver through apache settings
5. What is the default port of apache

Regards
Saikumar

Wednesday, September 12, 2007

PHP Job Opening In hyderabad

Got mail like this

If interested to move to hyderabad, I have a PHP developer postion, send me your resume to the email address ait15@sbcglobal.net"


Thnak you

Sunday, September 9, 2007

Javascript editor to embedd in to webpage also called webeditor

What is TinyMCE?
TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances. TinyMCE is very easy to integrate into other Content Management Systems.

TinyMCE Features

Easy to integrate, takes only two lines of code.
Customizable through themes and plugins.
Customizable XHTML 1.0 output. Block invalid elements and force attributes.
International language support (Language packs)
Multiple browser support, Mozilla, MSIE, FireFox, Opera and Safari (experimental).
PHP/.NET/JSP/Coldfusion GZip compressor, Makes TinyMCE 75% smaller and a lot faster to load.
You can easily use AJAX to save and load content!



for further info on this download everything
Visit this website

Download, Installing WAMP Server on windows XP

if you want to learn php,you need to install wamp server on windows (XP) which hardly takes 5 minutes.but for getting wamp server you need to download

from click here

After downloading click on the exe file you will asked abt simple setings click on finish button your installation will completed


Thank you
BYe

Saturday, September 8, 2007

Install download and configure MYSQL on Windows

Download

click here to download mysql. When this page opens click on "No thanks just take me to download", then pick any mirror site and start downloading MYSQL

Install and Configure

Just click the installer and MYSQL will automatically be installed and configured on your machine using the step by step wizard.

It will ask you a no of settings for the DB installation. Enter according to your requirements but I recommend not to set any passwords ie if you have it for your local use only.

Test

Go to "start" - "all programs". If mysql is installed it will be listed.

select "mysql" - "mysql server 5.0" - "mysql command line client"

It will ask for a password click enter

If everything is fine you will view a welcome message

Friday, September 7, 2007

phpinfo() the power of basics

Just open any editor and type the following:

echo phpinfo( );


Save it as info.php or any other name you like.

This simple page gives you everything you need to know about a web server. This function is also used to test your PHP installation. If you are deep into web development then you can easily recount instances when something is working just fine on the local server but when we upload it everything goes WAMP!.

This is mostly because of different versions of PHP/MYSQL ++ or different settings, configuration. I just need to advice everyone to create a file with phpinfo() on your local server and web hosting server. And in the future when you face an unexpected error just compare the two files and I am telling you than you will relate to me big time.

Thursday, September 6, 2007

PHP Job Opening In hyderabad

Hai i got this mail saying that there are openings in PHP


We are looking for PHP with Mysql programmers for Hyderabad

If you are interested kindly forward your updated profile asap to supriya_d_1984@yahoo.co.in


Regards,
Supriya
IT Recruiter
Hyderabad"

Install and configure PHP5 on windows system

There three major steps involved in installing PHP are:

Downloading PHP Installing PHP Configuring PHP Testing PHP

Before we start you have to understand that there are two possible places where a website can live

A local computer which can be a desktop computer, a laptop++
The internet. A website which is viewed on the "www." internet resides some where with a hosting company.
So to run a website on a personal computer PC you need to install PHP on it. Firstly make sure you have a web server running on your computer. If you are wondering what is a web server and how do you know if it is working or running or what ever on my computer then click here.

Ok now I assume the web server is running. Lets move on with our journey of installing PHP.

Download PHP.

Click here to download PHP 5.2.1 software package from the official site.
Click here to download PHP 5.2.1 installer from the official site. (Automatically installs configure PHP and web server)
Install PHP

Install PHP automatically using an installer

This is a very quick and clean way of installing PHP. It installs and configures PHP and even the web server (IIS, Apache++).

We recommend you take the time to setup PHP yourself as this will provide you with a better understanding of the system, and enables you to install PHP extensions easily when needed.

Install PHP manually

Upgrading from a previous PHP version:

For simplification previous editions of the installation manual suggested moving various ini and DLL files into your SYSTEM (i.e. C:WINDOWS) folder.
We advise you remove all of these files (like php.ini and PHP related DLLs from the Windows SYSTEM folder) before moving on with a new PHP installation.
Be sure to backup these files as you might break the entire system. The old php.ini might be useful in setting up the new PHP as well.
Start Installation

Unzip the PHP 5.2.1 package at C:PHP (ie create a directory call PHP and unload the zip package in it)
Make the C:PHP directory available to the web server, CGI CLI binaries++. (If you don't understand any terms do not worry just move on and do as I say you will have your PHP running in no time)
Right click on "My Computer" which is located on your computer desktop
Go to the "Advanced Tab"
Click on the "Environment Variables" button
Look into the 'System Variables' pane
Find the Path entry (you may need to scroll to find it)
Double click on the Path entry
Enter your PHP directory at the end, including ';' before (e.g. ;C:php)
Press OK and restart your computer
Find the file "php.ini-recommended"in C:PHP. Read it carefully, this file drastically affect the PHP setup. Rename the file to "PHP.ini" and place it in C:windows folder (also known as System folder)
Configure PHP

The next step involves configuring PHP with web server IIS. If you do not know what IIS is and is not installed on your computer Click Here else read on
Click Start -> Control Panel -> Administrative Tools -> Internet Information Systems (IIS)
Double click on "Local Computer" -> Right click "Default Website" - > "Properties" -> "Home Directory"
Change the Execute Permissions to "Scripts only"
Click on the Configuration button, and choose the Application Mappings tab.
Click Add and set the Executable path to the appropriate ISAPI DLL. Example PHP 5 value is: C:phpphp5isapi.dll Supply .php as the extension. Leave "Method exclusions" blank, and check the "Script engine" checkbox. Now, click OK a few times.
Stop IIS completely
Start IIS again
Test PHP

Open notepad or dreamweaver++
Type
Place this file at C:Inetpubwwwroot
Click Start -> Control Panel -> Administrative Tools -> Internet Information Systems (IIS)
Double click on "Local Computer" -> Right click "Default Website" -> "Properties" -> "Documents" -> "Add" -> index.php -> Click "OK"
Open internet explorer or mozilla firefox++ and type http://localhost
If a page opens with PHP details and lot other details then PHP is installed properly configured and ready to rock and roll !!! :) Phew....

Now as you have installed PHP5.2..... (the story doesn't end here, it has just begun ;))

PHP For Dummies

Mr Ajaykumar has written this article for those who are interested in learning about PHP as a scripting language, as well how PHP is rife in today's programming industry.This article is for people who are not aware what PHP is and for those who have not heard of PHP at all. This article will refresh your memory about what PHP is, along with some of the important highlights.

Don’t worry. I am here to tell you, what it is.

What is PHP?

Hi net mates. These days when you surf through some sites, you will find some file extension in the address bar of your browser. Some files extensions like the .htm, .asp, .jsp, .php, and .php3.

You will find this extension .php or the .php3 file extension in some of the popular sites too. Let us see that is this file extension, which language this extension refers to. Let us see what the main high lights of these language.

Hypertext preprocessor is the exact expansion of PHP, tough it doesn’t, fit to the exact spell, and it is adjusted to the word of mouth, called as PHP. PHP is a web scripting language. Let us see some the basic queries, which we come across php.

Who Wrote PHP?

Rasmus wrote PHP. PHP was started off accidentally, Rasmus was designing his web site, and he had planed to put a hit counter for his site. He decided to write a combination of Perl.

There were many enquires about the script which he used. Likewise, it slowly improved on and won the hearts of many programmers.

What type of scripting is PHP client or a server side?

PHP is a server side scripting language; server side scripting language is one, which has the capability of executing the script on the server and serving the output as a HTML File, server side script has the main advantage of interacting with the databases and to perform all types of server manipulations directly. Server side scripting language is responsible for manipulating the data which is filled in the entire web forms, any where in the net.

But this is not the case of a client side script. Some of the client side scripting languages is the JavaScript and VB script, but there are exceptions where, client side script can also be used for server side scripting, which is limited to some extent.

Can I use PHP with HTML?

Sure you can very well use HTML with PHP, like the other scripting languages you can do so. It is not a compulsory act for you to use PHP with the HTML. You can very well get the output with PHP alone. But the expected output, which is exhibited by PHP, is not that attractive for display. By attractive, I mean the formatting done by PHP.

Lets us take an example. You have a server side interaction with the database, which is used to manipulate and fetch a certain type of data based on the query, which is given out. Now, if you are going to display these data using PHP, which is fetched by PHP. The quality of output like the font face, font coloring and display areas are all disturbed, as well as being painful to locate and place the data. If HTML is used to present these data, the outlook of the data exhibited is gorgeous.

Can I Run PHP on the Windows Operating System?

You can very well run PHP on a windows machine. PHP is a cross platform support language, which means, PHP can run on various platforms like the Linux, Windows etc. Your web servers PWS, IIS, Apache can be configured to work PHP.

Is it easy migrating from any other server side scripting languages to PHP?

If you are aware of programming concepts and the application of the logic, then, you will find it ok to code any programming language if you simply understand the syntax. At the same, other scripting languages and PHP, have virtually the same function methodology. The only thing that matters is your requirement, how you are going to apply the logic and code php to your logic.

The main area lies while migrating is the syntax understanding. PHP’s syntax is similar to the C language. People with basic knowledge of C will find it very easy migrating as well as other aspects, an easy task.

I am new to programming, is it easy to learn PHP?

If you are very blind to programming then it is difficult to learn PHP because you may need to learn the programming concepts. This means you require an understanding of the logic, and to be able to troubleshoot the program. If you happen to know at least one programming language, then it is very easy to learn PHP. PHP it is pretty easy compared to other scripting languages.

What are the databases that support PHP?

PHP is very much compatible with MYSQL and POSTGRESQL Databases. PHP also can be programmed to interact with any database right from a simple text file to DB2. It is believed that php interacting with the database has the highest performance, unlike the other scripting languages.

How fast is PHP compared with other scripting languages?

PHP is believed to be fast when compared with other programming languages because of execution speed. In the case of large interactions with the database PHP really plays a good role of execution in performing the interaction. Now, today’s major web sites have been migrating to PHP because of the performance.

PHP is open source. Will this work properly?

PHP is the only scripting language, which has won the hearts of many web servers, has been moving on enormously day-by-day, The main advantages of the open source is that, if there is a problem that particular problem is shared my millions of programmers across the world. But in the case of a licensed version scripting languages, it is very limited to a set of a small community.

As innovative ideas are studied from all the programmers across the world, new ideas are implemented then and there making the language strong.

There is no problem in using PHP, which is open source.

I shall conclude by saying that, all the scripting languages have its own merits and demerits. So, it is up to you to decide for a partial migration or a full migration.

What are the main Advantages of PHP?

Let us see some of the important advantages of PHP. There are a lot of advantages of PHP. When it is compared with other scripting languages, some of the important highlights are as follows.

Speed

PHP is considered to be the fastest, as stated previously, when compared with other programming languages. You can really feel the speed when you are going to, implement live over the web.

Normally when you try to connect a database and fetch certain data, it usually takes time to connect the database, execute the statement, and get the data across. When these operations are performed by PHP it is really faster when compared with other types of scripting languages. Not only for the speed when connecting the database but also while using over other important applications.

Because of its high performance of speed, PHP is being used for some of the important administrations like the server administration over the web, mail functionalities.

Open Source

PHP is open source, open source is one where the user is given a free license to remodel or recode PHP, according to their wish. You might wonder if you can I do these things without source code. Yes would be the answer. Source code is shipped with PHP. It is open source remember.

Multi Platform

PHP supports various platforms, which mean PHP can be installed on almost every operating system, like the window-x, Linux, etc. You may choose the appropriate version and follow the instructions accordingly given in the Manual.

Easy Syntax

PHP syntax is quite easy to code, all the syntax are similar to the C language syntax, If you are very new to the programming environment then it will be a bit difficult task for you to code the PHP.

What are the main disadvantages of PHP?

Every language or scripting language has its own advantages or the disadvantages. Likewise, PHP has some of its own disadvantages.

But these disadvantages can be overcome using advantage methods.

Some people say it is a direct disadvantage, while some people say an indirect disadvantage.

Disadvantage indirectly means some of the aspects and functionalities in PHP, which are not being able to complete using the direct functionality. This particular disadvantage can be overcome using an advantage method.

Let us take a simple example, say redirection. Writing a piece of code from the client side or the server side - in some of the scripting languages there is a single task to achieve this - a single function will do so. But in the case of PHP it is done indirectly.

One more disadvantage is the Error Handling. It is believed that PHP has very poor handling errors qualities. Even this disadvantage can be over come using a feasible advantage solution.

These are some of the disadvantages. Note again, that this disadvantage can be overcome by using the advantage solution.

It is up to you to decide, whether to migrate or learn PHP.

PHP is great in the terms of performance of speed, which is the main factor, which people expect these days.

SRC:http://www.devarticles.com/c/a/PHP/PHP-For-Dummies/1/

Installing PHP under Windows: Further Configuration of WAMP

There are 4 steps involved in doing this configuration

(1)Installing PHP under Windows: Further Configuration of WAMP

In his last article, Matthew showed us how to successfully install and configure WAMP (Windows, Apache, MySQL and PHP) to setup a development environment. In this next piece, learn how to make use of the Apache and PHP configuration files to further enhance your server needs.
In the previous tutorial, your WAMP system on your home PC is best for use as a development server only. You may be able to host a personal home page or hobby page, but of course this would only be available when your computer is on and online. Bearing in mind our decision to only use it as a development server we will have a specialised configuration.

In an attempt to make code developed on our server portable to the widest possible range of configurations, for other peoples’ servers, we will deliberately have a strict configuration, with many options turned off, this will force us to use 'better' programming techniques thus allowing anyone with Apache and PHP to run our code.

First we are going to configure Apache, I will attempt to justify my choices for any configuration changes that I make, as well as briefly explain other possible options. This will allow you to choose your own options should your opinion differ from mine.


2)configure Apache


Installing PHP under Windows: Further Configuration of WAMP - Configuring Apache
(Page 2 of 4 )

To configure Apache the file we will be editing is httpd.conf. Despite the extension this is just an ordinary text file; so open it in notepad for editing either by navigating through the folders (C:Program FilesApache GroupApache2confhttpd.conf) or via the shortcut on the Start menu (Start > All Programs > Apache > Config > Edit httpd Config File).

Apache will treat any lines starting with a hash, or pound, sign (#) as comments, and will ignore them, so a good way to test a setting would be to comment out the old line with a '#' and type your new setting. That way if you make any mistakes it will be nice and easy to go back to the way things were (delete the new line and uncomment the old one.) There will be many lines commented out, much of it will be text explaining various bits and pieces to you, you should read the first few paragraphs (before Section 1). This should explain a couple of points about directory paths, and different slashes. If there is something you don't understand, don't worry as I will be taking you through it all. Remember if you mess up big time the default configuration settings are stored in a backup file (httpd.default.conf). If there are any lines that I don't talk about, don't change them unless you know what you are doing. Finally remember, none of these changes will be apparent until Apache is restarted.
I would recommend changing one line at a time, saving the file and testing it by clicking start > All Programs > Apache > Configure > Test Configuration. If you briefly see a DOS (Command Line) box that disappears, then everything is ok. If the box stays it will tell you where it found an error.

Let’s move on to the various directives (configurations/options).

Line: Listen 80

This tells Apache which port to listen for requests on. The default is port 80. If you change the port from default, for example to 8080 or 8008 (both common choices), then any URLs must be validated (e.g. http://www.localhost:8080/ or http://localhost:8080/test.php). As you could imagine typing this for every URL would get quite annoying, quite quickly, so unless you have a real reason to change it, such as IIS compatibility issues, don't.

Line: LoadModule

The Various LoadModule commands tell Apache to load various external modules. Don't touch these unless you know what you are doing, If you remember when we first installed WAMP in the first tutorial, we added a LoadModule line for PHP (LoadModule php4_module php4apache2.dll). That's because PHP is an external module that Apache needs to load for PHP scripts to work. Move the PHP LoadModule line from the end of the file, where you put it on install, to the end of the LoadModule block.

Line: ServerAdmin

Make sure the email address you wish to be contacted on is here. Should any error page crop up this will allow people to contact you.. This is not really a major issue on a development server, however, should anything go wrong this would let people know who the server belongs to.

Line: ServerName :

localhost:80 will do for this one; for similar reasons to ServerAdmin.

Line: DocumentRoot

This tells Apache where your web documents are stored. You can leave this as is, or change it to something you prefer (c:webdocs might be quicker to browse to than C:/Program Files/Apache Group/Apache2/htdocs). Whatever you do, make sure the directory exists and that you copy all your files to it.

Line: AddType

Back when you installed PHP and added the LoadModule line you should have also added an AddType (AddType application/x-httpd-php .php) line. AddType tells Apache which extensions to associate with which types of documents. Move the PHP AddType line from the bottom of the file to the bottom of the AddType block. If you wish you could change the PHP AddType line to something like (AddType application/x-httpd-php .php .htm). This will associate .htm file types with PHP, so you can include some php scripts in htm files.

We will be adding another AddType line (AddType application/x-httpd-php-source .phps). This line will make the extension .phps a PHP Source file, which will display the PHP code with special coloured formatting (once we turn script highlighting on in PHP). You will probably find this quite useful for debugging.

Line: ErrorDocument

These allow you to create your own documents to handle errors. For instance, if a page is missing you usually get an ugly page with a message similar to '404 Not Found'. Well, you can make your own error pages. This will be more fully covered in a future tutorial; however, for the moment uncomment the line ('# ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var') by removing the '#' and change the .html.var extension to .html. In your document folder create a new directory called 'error' then create an html page called HTTP_NOT_FOUND. This page should contain a message telling the user that the page they clicked on could not be found. You should also include a link to your main page. Now, after Apache is restarted, whenever you go to a page that doesn't exist (http://localhost/bad/page) you will get your own pretty error page instead of the standard ugly one.

That's about all you have to worry about for Apache. As I said before, I recommend that you change one setting at a time, test the configuration (Start > All Programs > Apache > Configure > Test Config), and, if the black screen disappears, fine, if it stays, take note of any errors and correct whatever you may have done wrong. Remember that no changes will take effect until Apache has been restarted (Start > All Programs > Apache > Control > Restart).


3)PHP
(Page 3 of 4 )

Now we are going to edit php.ini in the Apache folder (one up from the conf folder). Anything following the semi-colon character (;) is commented out, to uncomment it, simply delete the semi-colon.

short_open_tag = On
This should be set to off. This will not allow us to use the short style tags. Although there are ways to get around this, this setting will force us to code in the 'proper' and more portable way ().

asp_tags = Off
Who wants to use ASP style <% %> tags (apart from ASP developers)?

highlight.string = #DD0000
highlight.comment = #FF9900
highlight.keyword = #007700
highlight.bg = #FFFFFF
highlight.default = #0000BB
highlight.html = #000000

Simply uncomment these lines (remove the semi colon (;) before them).

error_reporting = E_ALL
Sets PHP to tell us about all errors.

display_errors = On
PHP tells us about errors rather that just sit there with a blank screen!

register_globals = Off
Stops many possible security issues, and forces the user of the superglobal arrays (ie: $_POST, $_GET, $_COOKIES, etc.).

doc_root = C:Program FilesApache GroupApache2htdocs
This path should be the same as the document root you set in Apache’s httpd.conf file.

;extension= ...
This allows you to include various PHP extensions, a bit like modules in Apache. You should only turn then on when you need them.

session.save_handler = files
Make sure that this is set to files.

session.save_path = c:/temp
Make sure that this is set to a temp directory that exists on your PC. It will be used to save data for sessions.


Installing PHP under Windows: Further Configuration of WAMP - Conclusion
(Page 4 of 4 )



That's about it, save the file and restart Apache. View the test.php file you wrote in Installing PHP Under Windows to check that everything is still functioning the way it should be. In this article, we’ve covered various aspects of the Apache and PHP configuration files. By making use of the tips above, you are bettering the chance of creating portable code that can be used across an array of system configurations

Monday, September 3, 2007

G.D installation on Windows in PHP

Go to http://www.php.net/downloads.php and download the 'PHP 4.x.x zip package' if you don't allready have it. This package contains the GD-Library for windows. Find php_gd2.dll (or php_gd.dll if you need gif-support, but you will have less good image quality) and put it in your php folder (Usual c:\php). Find in the php.ini in your windows folder:
;extension=php_gd.dll
;extension=php_gd2.dll

Uncomment extension="php_gd2".dll by deleting the ';' in front of it.

Installing G.D library in PHP On WAMP Server

Installing G.D library in PHP On WAMP Server is very simple.

After installtion of WAMP on Windows XP You can see icon on right side bottom of your desktop.Click on that icon you can see a set of options.From that options
choose PHP Settings->PHP Extensions->PHP_GD2

click on it Restart Wamp Server

Thank you
BYe.

 
eXTReMe Tracker