Monday, February 4, 2008

Web Application/ PHP-MySQL

Installing PHP on Windows

1. Extract the files from the .zip file into the directory where you want PHP to be installed, such as
c:\php
.

If you double-click the .zip file, it should open in the software on your computer that extracts files from .zip files, such as WinZip or PKZIP. Select the menu item for extract and select the directory into which the files are to be extracted. C:\php is a good choice for installation because many configuration files assume that’s where PHP is installed, so the default settings are more likely to be correct. It’s best not to install PHP in a directory with a space in the path, such as in Program Files/PHP. Doing so can cause problems.You now have a directory and several subdirectories that contain all the files from the zip file.

2. Copy the file required for MySQL to the PHP main directory.

The file is located in the ext subdirectory in the directory where PHP is installed. Copy one of the following files, depending on which version of MySQL you’re using:

ext\php_mysqli.dll (for MySQL 4.1 or later)

ext\php_mysql.dll (for MySQL 4.0 or earlier)


Copy the file into the main PHP directory, such as c:\php.

Another file, named libmysql.dll, is required for MySQL support. This file should already be located in the main PHP directory. If it isn’t, you need to find it and copy it there. If it’s not in your PHP directory, it’s usually installed with MySQL, so find it in the directory where MySQL was installed, perhaps in a bin subdirectory, such as c:\Program Files\MySQL\MySQL Server 5.0\bin. Occasionally PHP needs DLL files that it can’t find. When this happens, PHP displays an error message when you run a PHP program, saying that it can’t find a particular DLL. You can usually find the DLL in the ext subdirectory and copy it into the main PHP directory.


Configuring your Web server for PHP

Configuring IIS :

To configure IIS to work with PHP, follow these steps :

1. Enter the IIS Management Console.

You should be able to enter by choosing Start Programs Administrative Tools Internet Services Manager or

StartControl Panel Administrative Tools Internet Services Manager.

2. Right-click your Web site (such as Default Web Site).

3. Select Properties.

4. Click the Home Directory tab.

5. Click the Configuration button.

6. Click the App Mappings tab.

7. Click Add.

8. In the Executable box, type the path to the PHP interpreter.

For example, type c:\php\php-cgi.exe.

9. In the Extension box, type . php

This will be the extension associated with PHP scripts.

10. Select the Script Engine check box.

11. Click OK.

Repeat Steps 6–10 if you want any extensions in addition to .php to be processed by PHP, such as .phtml



Configuring PHP

PHP uses settings in a file named php.ini to control some of its behavior.

If the php.ini file isn’t installed during installation, you need to install it now. A configuration file with default settings, called php.ini-dist, is included in the PHP distribution. Copy this file into the appropriate location, such as the default locations just mentioned, changing its name to php.ini.



1. Open the php.ini file for editing.

2. Change the settings you want to change.

Steps 3, 4, and 5 mention some specific settings that should always be changed if you are using the specified environment.

3. Only if you are using PHP 5 or earlier, turn off magic quotes.

Look for the following line:

magic_quotes-gpc On

Change On to Off.

4. Only if you are using PHP 5/6 on Windows, activate mysqli or mysql

support.

Look for a list of extensions. Find the line for the mysqli extension, as

follows:

; extension=php_mysqli.dll

If you are using a version of PHP earlier than 5.0 or a MySQL version earlier

than 4.1, find the following line:

;extension=php_mysql.dll

Notice the semicolon (;) at the beginning of the lines. To activate the

extension, remove the semicolon. If the extension line isn’t in your

php.ini file, add it.

5. Only if you’re using PHP on Windows with the IIS Web server, turn

off force redirect. Find the line:

; cgi.force_redirect = 1

You need to remove the semicolon so that the setting is active, and also

change the 1 to 0. After the changes, the line looks as follows:

cgi.force_redirect = 0

6. Save the php.ini file.

7. Restart the Apache server so that the new settings go into effect.


Your required configuration is complete.

Now Enjoy using PHP/ MySQL in Windows, codes will be available soon.............











Friday, January 11, 2008

ASP.NET/ Some Ideas

INTRODUCTION

Before telling what ASP .NET is we have to understand what kind of website is usually referred to as a dynamic website.

Literally, websites which have their pages dynamically created as per the requests placed on the web server are called dynamic web sites and Web pages in those websites whose content is produced or generated dynamically based on user input or other information are called dynamic web pages. Examples for such websites are search engines, discussion forums etc where the output page is generally produced by the web server on the fly as per the requests.

So how does the web server serves dynamic WebPages as per requests ?

That is where the magic of Server Scripting languages comes in. These scripting engines sits behind the web server and as per the developer has instructed them to react, they generates HTML code as per the demands in the requests from clients passed on to them by the web server. They usually pulls contents from some data storages like files or database servers according to the conditions specified in the requests and spins off HTML code which is then served back to the client by the web server.

There is a lot of Web scripting technologies that the developer can make use of and ASP .NET is one of them. Yes, so now you come to know that ASP .NET is nothing but a scripting engine, which is sitting on a web server ready to serve the web server with dynamically generated content, which in turn is utilized by the web server as responses to client machines. It is the web server which decides whether a request needs the service of the Scripting Engine or not. It usually decides this by looking at the extension of the requested files and ASP .NET files usually have an extension of .aspx.

How a webserver with ASP .NET serves a dynamic webpage



How a webserver with ASP .NET serves a dynamic webpage





Thursday, December 13, 2007

Teledesic Project Ended

Space News

PARIS — The Craig McCaw-backed Teledesic satellite broadband constellation project, which took the space industry by storm in the late 1990s and persuaded prospective contractors to invest about $1 billion in preparatory research, has surrendered its sole remaining asset.

In a letter to the U.S. Federal Communications Commission (FCC), the Bellevue, Wash., company said it was giving up its license to use a massive swath of radio spectrum — 500 megahertz uplink, and 500 megahertz downlink.

At just three paragraphs, the June 27 letter from Teledesic’s lawyer, Mark A. Grannis, is as short and clear as the Teledesic story is long and complicated.

Why Teledesic decided to make the move now is unclear. The company has been little more than a shell for at least a year, and its would-be contractors had long since stopped working on the project.

From its beginnings in 1991 and its formal FCC application in 1994, Teledesic evolved from a system proposing a low-orbiting constellation of 840 satellites, to one with 288 satellites, and finally to a medium Earth orbit constellation of 30 satellites.

Grannis, a partner in the Washington law firm of Harris, Wiltshire & Grannis LLP, said the decision to abandon all claims on the radio spectrum was made in part because Teledesic was facing a January 2004 FCC deadline to show firm progress in building its satellites.

"In the current funding environment, that was not going to be possible," Grannis said in a July 11 interview. "Teledesic was a magnificent dream, and I was a true believer all along — one of the last true believers."

International frequency regulations assign licenses to nations, not to companies. The licensed administration then sorts out which company has access. With Teledesic abandoning its rights, FCC officials now are mulling whether to return the frequencies to the common global pool managed by the International Telecommunication Union (ITU), a United Nations affiliate based in Geneva.

"We’re still looking at this to determine what to do," said an FCC official July 11. "It might be better just to let the license expire. At this point, does anybody care about it? We want to find out. We have other applicants that want to use this spectrum."

But the FCC official acknowledged that the other applicants, while alive in a regulatory sense, have shown no recent motivation to develop their systems. Ironically, the week after Teledesic’s letter to the FCC, the agency issued a broad order setting out its proposal for how Teledesic would share its frequencies with the several other satellite-broadband proposals that had applied for the spectrum in a second round of applications. Teledesic was the lone licensee in the first round.

The FCC official said that order, dated July 9, was issued despite the Teledesic decision because it has value as a precedent for settling future conflicts between first-round licensees and second-round applicants for spectrum.

"We’re going to do an honest evaluation," the FCC official said. "For now, as far as we’re concerned the other applicants have not informed us that they are no longer interested."

At the height of its reputation, Teledesic marshaled the lobbying power of the U.S. government to persuade other governments to grant the company access to its radio frequencies. Several European governments feared that Teledesic, which for a time also appeared to have the support of Microsoft Chairman Bill Gates, would create a global broadband monopoly.

"Some of the delegates to those (ITU) meetings might feel like they are owed an apology for all the work they put in," Grannis said. "But we really believed it would have been a good system for the world. Still, you can’t blame the investors in Teledesic now for not wanting to walk off a cliff."

Teledesic Project

Teledesic Corporation was a company founded in the 1990s to build a commercial broadband satellite constellation for Internet services. The goal of the Teledesic system was to provide a telecommunications infrastructure composed of low-earth-orbit satellites, for use by millions of concurrent Internet users, providing uplinks of as much as 100 Mbit/second and downlinks of up to 720 Mbit/second, using small, fixed, VSAT-type antennas, and completely bypassing terrestrial networks. The original 1995 proposal was extremely ambitious, costing over US$9 billion originally planning 840 active satellites with in-orbit spares at an altitude of 700 km. In 1997 the scheme was scaled back to 288 active satellites at 1400 km and was later scaled back further in complexity and number of satellites as the projected market demand continued to decrease.

The commercial failure of the similar Iridium and Globalstar ventures (composed of 66 and 48 operational satellites, respectively) and other systems, along with bankruptcy protection filings, were primary factors in halting the project, and Teledesic officially suspended its satellite construction work on October 1, 2002.

Teledesic was notable for gaining early funding from Microsoft (investing US$30 million for an 8.5% stake), Craig McCaw, Bill Gates, Paul Allen and Saudi prince Alwaleed bin Talal, and for achieving allocation on the Ka-band frequency spectrum for non-geostationary services. Teledesic's merger with ICO Global Communications led to McCaw's companies taking control of ICO, which has successfully launched one test satellite.

Tuesday, November 27, 2007

ASP.NET / C#.NET / Authentication & Authorisation

Authentication & authorization:-

If you are beginner in web applications, then this is right time to feed the following topic.

Suppose you are going to develop a website (in ASP.NET), where there must be a process of authentication & authorization (authentication means that the user is valid or not & authorization means how much resources an authenticated user will enjoy).

There should be 3 types of users in your website:-

1. 1. Anonymous user
2.
General user
3.
Administrator

When an anonymous user requests for home page, following page will come(Login.aspx)


They can only view the website’s limited resources.



If he/she provide user name & password, then they will be authenticated users & the following page will be displayed(Default.aspx)

There will be Sign out option as they are logged in.



Again if they click in Sign out option, they get following page again (Login.aspx)

If anyone access website with Admin password, then following page (Default.aspx) will come with Sign out option & various more options exclusively unique for Administrator





The codes are very simple, try to understand the underlying technology.

You think in this way, that users are requesting for the home page (Default.aspx). If page is not authenticated then users get the Login.aspx page & users will see Login.aspx page as home page.

Codes under Default.aspx ,

protected void Page_Load(object sender, EventArgs e)

{

if (!Page.User.Identity.IsAuthenticated)

{

Server.Transfer("login.aspx");

}

else

{

lblStatus.Text = User.Identity.Name;

if (Page.User.IsInRole("adminrole"))

{

btnAdmin.Visible = true;

btnUpload_books.Visible = true;

btnUpload_papers.Visible = true;

btnCk_payments.Visible = true;

}

}

}

Codes under Login.aspx ,

using System.Data;

using System.Data.SqlClient;

string s1;

SqlConnection sqlCon;

SqlCommand command;

SqlDataReader reader;

protected void Page_Load(object sender, EventArgs e)

{

s1 = System.Configuration.ConfigurationManager.AppSettings.Get("con1");

sqlCon = new SqlConnection();

sqlCon.ConnectionString = s1;

}

protected void btnLogin_Click(object sender, EventArgs e)

{

if (sqlCon.State == ConnectionState.Open)

sqlCon.Close();

sqlCon.Open();

command = new SqlCommand();

command.Connection = sqlCon;

command.CommandType = System.Data.CommandType.StoredProcedure;

command.CommandText = "user_select";

command.Parameters.Add("@uid", System.Data.SqlDbType.VarChar, 20);

command.Parameters["@uid"].Value = txtUname.Text.ToString();

reader = command.ExecuteReader();

if (reader.Read())

{

if (reader["upasswd"].ToString() == txtUpasswd.Text.ToString())

{

FormsAuthentication.RedirectFromLoginPage(txtUname.Text, false);

}

else

{

lblWarn.Text = "Invalid Credentials; Please Try again";

}

}

}

Codes under web.config ,

<authentication mode="Forms">

<forms name="login" loginUrl="login.aspx" protection="All" timeout="30" />

authentication>

<authorization>

<allow users="admin"/>

<allow roles="adminrole"/>

<deny users="?"/>

authorization>

<anonymousIdentification enabled="true"/>

<roleManager enabled="true"/>

N.B. :- Here I have used name of Administrator ‘Admin’, if you like to give other name then write your own given name in tag.

Thank You…………….

Mail me at : partho.neo@gmail.com / partho.neo@indiatimes.com



Thursday, November 22, 2007

Netbeans vs Eclipse

Eclipse vs NetBeans ...On which side are you on? Let us know which IDE you think is better and why.

Think of Java IDEs and two names that will come up are Eclipse and NetBeans. I have been using NetBeans for many years now and Eclipse has been a more recent addition to my Java armory. I have enjoyed working with both tools and as such don't have a clear favorite. I prefer NetBeans a little more than Eclipse as I have been using it longer and am more comfortable with it.

The thing I am most surprised about is how rapidly Eclipse has grown and how it has well and truly eclipsed NetBeans over the past year or so.

In the article: Migrating to Eclipse: A developer's guide to evaluating Eclipse vs. Netbeans, the author shows the differences between the two IDEs.

Just Eclipse or Eclipse in its WSAD avatar or MyEclipseIDE avatar is definitely good but hey..is it so good that nobody wants to be talk of NetBeans these days??? I haven't as yet tried out the new NetBeans 5.5 but I do hope it is very good. So that the competition between Eclipse and NetBeans stays fierce and there is no clear winner.

The end user gets two very good IDEs.

Java IDE comparison: Borland JBuilder Top

A comparison of 4 Java IDEs, from Borland, IBM, Oracle and Sun ranks them as follows:
  • Borland JBuilder 2005 Enterprise tops with - ( 8.5 / 10 )
  • IBM Rational Software Architect 6.0 - ( 8.3 / 10 )
  • Oracle JDeveloper 10.1.3 - ( 8 / 10 )
  • Sun Java Studio Enterprise 7 - ( 7.4 / 10 )


The article evaluates the four IDEs based on Features, Ease-of-use, Integration, Performance and Value.

To get more info click here