How to create Web Service in PHP

Web Services can convert your application into a platform independent Web-application. You can call web services using mobile applications (e.g iPhone, BB or android). The basic Web Services platform is XML & HTTP. To create web services you should know XML & HTML.

What are Web Services?
- Web services are application components
- Web services communicate using open protocols
- Web services are self-contained and self-describing
- Web services can be discovered using UDDI (Universal Description, Discovery and Integration)
- Web services can be used by other applications

Web services platform elements are as follows:
- SOAP (Simple Object Access Protocol)
- UDDI (Universal Description, Discovery and Integration)
- WSDL (Web Services Description Language)

Creating web service in PHP:

Using NuSoap library you can create web service in PHP.

Step1. WSDL configuration :

require_once(“nusoap.php”);
$ns=”http://192.168.1.1/nusoap”;
$server = new soap_server();
$server->configureWSDL(‘test’,$ns);
$server->wsdl->schemaTargetNamespace=$ns;

Step2. Register method :

$server->register(‘test’,array(‘amount’ => ‘xsd:string’),array(‘return’ => ‘xsd:string’),$ns);

Step3. Writing PHP function :

function test($amount) {
if($_SERVER['PHP_AUTH_USER']==”test” and $_SERVER['PHP_AUTH_PW']==”supp0rt”) // check for user &
passwd $msg = “valid user”;
else $err = “Invalid user”; // XML to return response
$strOP = “”; $strOP .= “”;
$strOP .= “”.htmlentities($err).”";
$strOP .= “”.htmlentities($msg).”";
$strOP .= “”.htmlentities($amount).”";
$strOP .= “”; // eof XML to return response return $strOP;// return response }

 

Step4. SOAP response :

// send the result as a SOAP response over HTTP if (!isset($HTTP_RAW_POST_DATA)) $HTTP_RAW_POST_DATA = file_get_contents( ‘php://input’ ); $server->service($HTTP_RAW_POST_DATA);

 

Posted in PHP | Tagged , , , , , | Leave a comment

PHP script to fetch Domain Name Server information for .uk domain

What Is a Domain Name Server (DNS)?

DNS is a technology to map the names of sites with the server’s IP address. DNS is used to point domain name to server IP address.

WHOIS lookup is an internet utility that helps us to find information about a particular domain or IP address. Typically a record will contain the name and the contact information of the Registrant and the Registrar.

Let us discuss the method to get information about .uk domains:

Step 1. Assign SLD (Second Level Domain) & TLD (Top Level Domain) of domain to the php variables.

$tld = “nic.uk”;
$sld = “whois”;
$end = substr ($tld, 0 – 2); // to get last two characters of domain tld

      Step 2. Connect to the whois server using socket connection.

$whois_server = ‘whois.nic.uk’; // who is server
$fp = fsockopen ($whois_server, 43, &$err_no, &$err_str, 10); // open socket fputs ($fp, $sld.’.’.$tld); // put sld & tld data

        Step 3. Read socket data.

while (!feof ($fp)) // read up to last line of file { $buf = fgets ($fp, 128);// read line by line }

          Step 4. Find name server information.

if (ereg (‘Name servers’, $buf))
{
$dns = fgets ($fp, 128); // read data
$dns = str_replace (‘Name Server:’, ”,
$dns); // replace ‘Name Server:’ text with empty string $dns = str_replace (‘Server:’, ”, $dns); // replace ‘Server:’ text with empty string
}

            Step 5. The entire code is as follows:

if (ereg (‘Name servers’, $buf))
{
$dns = fgets ($fp, 128); // read data
$dns = str_replace (‘Name Server:’, ”, $dns); // replace ‘Name Server:’ text with empty string
$dns = str_replace (‘Server:’, ”, $dns); // replace ‘Server:’ text with empty string
}Step 5. The entire code is as follows:$tld = “nic.uk”;
$sld = “whois”;
$str_search = substr ($tld, 0 – 2);
if ($str_search == ‘uk’)
{
$whois_server = ‘whois.nic.uk’;
$fp = fsockopen ($whois_server, 43, &$err_no, &$err_str, 10);
fputs ($fp, $sld.’.’.$tld);
while (!feof ($fp))
{
$buf = fgets ($fp, 128);
if (ereg (‘Name servers’, $buf))
{
$dns = fgets ($fp, 128);
$dns = str_replace (‘Name Server:’, ”, $dns);
$dns = str_replace (‘Server:’, ”, $dns);
$domain_info['ns1'] = trim ($dns); // primary ns$dns = fgets ($fp, 128);
$dns = str_replace (‘Name Server:’, ”, $dns);
$dns = str_replace (‘Server:’, ”, $dns);
$domain_info['ns2'] = trim ($dns);// secondary ns

$dns = fgets ($fp, 128);
$dns = str_replace (‘Name Server:’, ”, $dns);
$dns = str_replace (‘Server:’, ”, $dns);
$domain_info['ns3'] = trim ($dns); // tertiary ns

$dns = fgets ($fp, 128);
$dns = str_replace (‘Name Server:’, ”, $dns);
$dns = str_replace (‘Server:’, ”, $dns);
$domain_info['ns4'] = trim ($dns); // quaternary ns
}
}
}
print_r($domain_info);

Posted in PHP | Tagged , , , , | Leave a comment

Check List and Guidelines for Website Testing

Testing plays a very important role in development of a website. The following checklist serves as a quick reference and guide for you to test any website:

1. Test all links:

  • Check all internal hyperlinks : Verify  whether all links are jumping to correct destination.
  • Check all external hyperlinks: Verify whether external hyperlinks like social network links and email links are correct.
  • Check whether there are any orphan links or links that jump on the same page.
  • Test all header and footer links which are constant for all pages.

2. Test forms if present:

  • Try to submit form without Mandatory and Optional field.
  • Check for field validation.
  • Check error handling for wrong input.
  • Check whether default/standard values are proper.

3. Test content:

  • Verify whether information on all pages is correct and easy to understand.
  • Test for spelling and grammatical errors.
  • Check contact details and email addresses.
  • Help content: Check files in the help section, search field and the site map.
  • Proper images.
  • Also check above points for pop-ups.

4. Test  navigation:

  • If menu is provided then check for its consistency in entire website.
  • Check for navigation using keyboard and shortcuts.

5. Graphical User Interface (GUI) check:

  • Font size and color.
  • Cursor or mouse focus.
  • Location of buttons , images, symbols and logos.
  • Scrolling: Avoid long scrolling.
  • Consistent design.
  • Dark colors should be avoided.

6. Cookies and Java scripts:

  • Test cookies and Java scripts that should be enabled or blocked.

7. Browser and OS compatibility:

  • Check for design and GUI issues on multiple platform and for different screen resolutions.
  • Test on different browsers and its versions like IE 6, IE8, Mozilla Firefox, Chrome, Opera, Safari, etc.
  • Also test on different OS and its browsers like Windows 7, XP, Vista,  Mac, Linux, and Solaris.

8. Compatibility on gadgets and mobile platforms:

  • Test for OS like Symbian, Android, iOS, Bada, etc., used for mobiles, tablets and smart phones. Nowadays, some TV sets also provide facility for browsing.

In this blog I have tried to cover all aspects for testing of website. In upcoming blog I will cover testing of web applications.

Posted in Quality Assurance & Testing | Tagged , , | Leave a comment

Brief introduction to PHP

PHP stands for Hypertext Preprocessor. Earlier it was known as Personal Home Pages. PHP is a server side scripting language suited for web based technologies and it can be embedded into HTML. PHP runs on server side, so we can say that PHP is a “Server side HTML embedded scripting language”.

There are two types of scripting languages:

1. Client side
2. Server side

Client side scripting languages run on client’s web browser. E.g. JavaScript or VBScript. We use client side scripting languages for form validation. Nowadays Javascript is widely used in jQuery to add additional text, background effects & menus.

Server side scripting languages run on the web server. Server-side scripting is used for database operations and to generate dynamic web pages. The server side scripts are not visible on browsers. No one can see the source code of server script language whereas as you can use, download client side scripts.

PHP is very popular server side scripting language. It is widely used in website development due to its ease of use. The syntax of PHP is very similar to other programming languages. You can use OOPS concept in PHP.

History of PHP:

PHP was invented by Rasmus Lerdorf in 1995. He is known as Father of PHP. He started PHP as a replacement for various Perl scripts. He used PHP to maintain his personal web page. PHP takes most of its syntax from C, Java, and Perl. PHP was written in C programming language.

PHP Versions:

- First version of PHP was FI (FI stands for Form Interpreter). It was introduced in 1995.
- The second version FI 2 was introduce in 1997.
- Third version was introduced in 1998.
- Fourth version was introduced on 2000.
- PHP 5 was released in July 2004

Some features of PHP 5 are:

1. Improved object-oriented programming:

You can access the following OOPS features in PHP:

- Constructor
- Interfaces
- Final methods
- Final classes
- Static methods
- Abstract classes

2. Embedded SQLite:

PHP supports SQLite. SQLite is an embedded database library that implements a large subset of the SQL 92 standard. It is the same as working with MYSQL.

3. Exception handling using a try & catch structure:

PHP 5 supports exception model similar to other programming languages. An exception can be thrown and caught in PHP.

4. Integrated SOAP support:

You can create your own web services in PHP using SOAP (Simple Object Access Protocol). You can create SOAP server as well as SOAP client in PHP.

5. The filter library:

Using filter library (filter_var) you can easily filter data. You don’t need to understand regular expressions.

6. Better XML tools:

Now you can use inbuilt PHP functions for XML (Extensible Markup Language) and JSON (JavaScript Object Notation)

7. Iterators (Object Iteration):

It is very easy to iterate objects in PHP such as foreach statement.

PHP 6 has been in development since October of 2006.

What’s new in PHP6?

- Unicode support (It will allow you to use multiple languages within your applications).
- Removal of ereg extension, ‘register_globals’, ‘magic_quotes’ and ‘safe_mode’.
- zend.ze1 compatibility mode to go.
- ‘var’ to alias ‘public’.
- Added 64 bit integers.
- Support for each multi-dim arrays.

Posted in PHP | Tagged , , , | Leave a comment

File-handle or format variables

These are the special variables that are used for file or related operations. These need not be mentioned explicitly as they are initialized on successful file opening. Moreover each file-handle holds its own set of values.

Some File handle or format variables are listed below:

1. $|
2. $%
3. $=
4. $-
5. $~
6. $^
7. $:
8. $^L

1. $|
This variable is basically used for output buffering. This flag determines whether buffering should be performed on programs input/output and on file read/write operations. If value is set to 1 ($| = 1), then buffering is enabled.

2. $%
This variable holds the current page number of the output channel that is being selected.

3. $=
This variable holds the current page length. The default being set to 60. This is measured in number of printable lines. This variable is useful in page formatting operations. If the page length increases than the current size then page formatting is applied.

4. $-
This holds the number of lines left on a given page to be printed. It basically gives the number of blank lines. For every line print its value is internally decremented. One can continuously check its value for a page break.

5. $~
It holds the name of the current report format name. The default is the file-handle name.

6. $^
This variable holds the name at the top of the page format.

7. $:
Holds the set of characters by which a string may be broken to fill continuation fields in a format. The defaults is ‘\n-’ to break on white spaces or hyphens.

8. $^L
Holds a character that is used by a format’s output to request a form feed. Defaults is \f.

Posted in Perl | Leave a comment

Data Center Infrastructure Management

Data Center is a facility used to house hardware, software, security systems, power conditioning and backup.  We can also say, Data Center is a computer room where all servers are stored, operated and managed. Data center operating costs have skyrocketed in the past years and a major cause of concern is the increased power bills.  Cost of running a data center is major part of IT budget. It varies due to installation costs of new hardware and software. As market changes rapidly, organizations must be able to adapt to the changes. Racks in a data center are used to host servers along with power cooling equipment and other electrical infrastructure.

It is observed that 15 – 20% of data center operating cost is spent on power. This concern can be effectively addressed by using a Data Center Infrastructure Management Solution (DCIM). DCIM is a management and monitoring solution for IT infrastructure and facility management. It is a software tool that can balance power and cooling, handle application and asset life cycle costing analysis, identify bottlenecks and redundancy affecting SLA.

A few years ago data center management was done by large enterprises that had thousands of square feet of data center floor space and teams dedicated to support it but with the advent of DCIM it has become quite easy for mid scale organizations to manage their own data centers. DCIM helps us to measure power usage and monitor proper cooling requirements. Today, numerous companies in the market offer DCIM software solution. DCIM software solution solves all our Data Center management constraints like space, size, cooling, power, etc.

Advantages of DCIM:

  • It visualizes, analyzes and monitors our data center performance.
  • It also enables data center managers to automate management of IT applications based on server capacity.
  • The major advantage is of DCIM is that it reduces energy usage and increases energy efficiency.

Trends associated with DCIM:

  • Server Virtualization
  • Cloud Computing
  • Energy Efficiency or Green IT Data Center.

All above trends help us to save our power costs, improve our data center energy efficiency, resolves space and size constraints. DCIM emphasizes on monitoring and manage data center operations effectively so that companies can redirect their wasted IT budget towards investments that support the core business objectives.

Posted in Data Center | Tagged , , , , | Leave a comment

Mobile Business Intelligence & Mobile Application Development Technologies

Mobile Business Intelligence:

 As we know, Mobile applications are internet applications that run on mobile devices. Operating system and customized or ready-made applications are ‘must have’ installations for mobile phone devices in today’s scenario. Mobile phone devices which have operating systems and thus the ability to install/uninstall applications and which can manage resources like processor, memory, data storage space and power are popularly known as ‘Smartphones’. These devices have the ability to run applications which are created on relevant operating systems or using cross-platform technologies and using Software Development Kits (SDKs) or plugins for the Integrated Development Environment (IDE) like Eclipse and NetBeans. It is a common and essential practice to do most of the business tasks using phones. This is known as Mobile Business Intelligence. Mobile Business Intelligence is the distribution of business data to mobile devices such as smartphones and tablet computers. Mobile phone based applications are used to monitor and analyze business data such as sales, costs, incomes etc. This is encouraged by the change from a ‘wired world’ to a ‘wireless world’ and the advantage of smartphones has led to a new era of mobile computing, especially in the field of Business Intelligence.

Mobile Application Development:

As business intelligence smartphones and tablet computers have become a necessity and so has application development for them become inevitable. The price range of smartphones is intermediate and affordable as compared to other mobile computing devices such as laptops and palmtops. Due to their abilities, smartphones have a huge demand in the market, and thus the development of applications for them has also vastly increased in recent times. Developers are now focusing on mobile application development to capture the mobile phone, smartphone and tablet computer user segment.  Some of the technical aspects of popular mobile phone operating systems are stated below:

Operating System Programming Languages IDE
Android Java Eclipse
Blackberry Java Eclipse
Symbian C++ Qt, Carbide
Windows C, C++ Visual Studio 2010, Visual Studio 2008
iOS Objective C Xcode
Java Micro Edition Java Eclipse, NetBeans
Palm OS C, C++, Pascal Eclipse, Code Warrior, Pocket Studio, HB++

Developers can choose to keep the applications free of cost or charge for downloads. If the applications are not free, developers can publish them in online stores by adapting a revenue sharing model. Popular online stores like Android’s ‘Market’ and Apple’s ‘App Store’ allow the distribution of only the apps that are approved by them to run on their respective devices. HP/Palm Inc. have also created the ‘Palm App Catalog’ where their device users can download applications directly and developers can send a link of their application to the end users via a unique web distribution method.

Listed below are some popular digital distribution platforms for mobile devices:

Mobile Application Store Owner Compatible OS
Android Market Google Android
App Store Apple iOS
App World RIM (Blackberry) RIM
OviStore Nokia Symbian, Java
Windows Marketplace Microsoft Windows 7

Posted in Mobile Application Development | Tagged , , , | Leave a comment

How to deploy ASP.NET MVC3 application on the server?

Let us discuss how you can deploy ASP.NET MVC 3 application on server without any support from web hosting providers. .NET framework 4.0 is required to run MVC application. This approach does not require ASP.NET MVC 3 installation on the server.

Background:

When we install ASP.NET MVC 3 on a machine, required assemblies are automatically registered in Global Assembly Cache (GAC). GAC is a directory where .NET assemblies can be installed for global sharing. If we use shared hosting we might not be able to deploy these assemblies in GAC.

Following simple steps will help you to deploy MVC application while using shared hosting services:

Manual method:

This is a manual way to deploy ASP.NET MVC 3 with Razor in BIN directory.

When you run application in Visual Studio 2010 with .net framework 4 and MVC 3 installed on your machine the following folders are automatically created:

C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 3

C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages.

These folders also contain an “Assemblies” folder.

ASP.NET MVC references following additional assemblies:

  • System.Web.Mvc
  • Microsoft.Web.Infrastructure
  • System.Web.Razor
  • System.Web.WebPages
  • System.Web.WebPages.Razor

To deploy your application on shared server with no support from your hosting company you can simply copy these DLL files and paste them to your BIN folder.

Make DLLs local while publishing:

If you don’t want to copy these files manually or don’t have permissions to copy and paste these files you can use this method.

The DLL files mentioned in the manual method can be included in the Bin folder when you publish your project to a production.

To include them to the Bin folder, go to your MVC application project and expand the ‘References’ node in project tree. Select above assemblies then right click and select ‘Properties’ and change ‘Local Copy’ to True as it is False by default. If Local Copy attribute is set to TRUE then selected DLL will be included in ‘Bin’ folder when you publish your project.

Posted in .NET | Tagged , , , , , , | 1 Comment

How to Apply Special Effect – “Emboss Effect” to text in Corledraw

As we all know, Coreldraw is a graphic design software used specially for printing media as well as other designing purposes. From this point of view using different effects for both text and images is very interesting yet important part of Coreldraw.

We can give “emboss effect” to text in Coreldraw same as done in Photoshop. The effect given in Coreldraw is more sharper and attractive compared to Photoshop. The major difference between emboss effect used in Coreldraw and Photoshop is that the depth of Photoshop emboss effect after printing is not that attractive as compared to Coreldraw emboss effect. Also the text by giving photoshop emboss effect is a ‘Raster image’ so it is not very sharp, while the text using Coreldraw emboss effect is much sharper.

Let’s discuss the steps to be followed to give emboss effect to text in Coreldraw :

Step 1 : Let’s type any word, say “TEAM GROWTH” using ‘Text Tool’. Use any bold font like ‘Arial black’ and font size more than 24pt. Fill the text color to ‘Orange’ using CMYK color palette. It will look like:

Step 2 : Now go to ‘Effects’ tab in menu bar and select ‘Bevel’option. A small window will  open on right side of the screen showing the properties of the ‘Bevel’ option. It includes the properties likeStyle of the effect, Bevel offset,  Shadow Color, Light controls etc.

Step 3 : Select the text i.e.”TEAM GROWTH” and go to the property window of Bevel.

Select ‘Soft edge’ option for Style property. Select Bevel offset to ‘To Center’. Keep Shadow Color ‘White’. Now for proper emboss effect ‘Light control’ function plays an important role. The effect of emboss depends upon the light controls. Light controls include :

1. Intensity - the brightness effect to the embossed text.

2. Direction - the direction of the emboss effect from 0 degree to 360 degree.

3. Altitude - the light direction given to the emobossed text.

Now to give the desired emboss effect while keeping the intensity at100%, Direction at 50 degree and Altitude to value  40. Now the text will look like:

Step 4 : Click on the tab ‘Arrange’ from main menu and again click on sub menu ‘Break bevel apart’. This will impart emboss effect from the original text.


Go to ‘Bitmaps’ tab from main menu, select convert to Bitmap option. Bitmap the embossed effect into CMYK 300dpi image.

Step 5 : Select the “TEAM GROWTH” emboss effect image. Now go to ‘Effects’ tab in main menu. Select ‘Powerclip’ option and sub option – ‘place inside the container’. Select the target as the original text and place the embossed image into original text.

“This will sharpen the text making it look more attractive!”

 

Posted in Tutorial | Tagged , , , , | Leave a comment

An Introduction to TeamGrowth

Since the introduction of World Wide Web (www), it has gone through few huge changes in the ways Internet has been used that lead IT Companies to venture into web industry. With the same vision, TeamGrowth a Research and Development division of a leading managed datacenter services company ESDS, has also did its debut in the industry to prove its mettle.

Team Expertise:

Our team comprises of skilled designers and programmers who are experienced in creating attractive and unique PHP, ASP.NET, and CSS websites. In addition, we also develop web applications using VB/VB.NET, C and hold proficiency in the various Java technologies, 2D and 3D animation, database design & development to name a few. We provide designs, applications and solutions to establish a successful and distinguished online profile for our clients. With an experienced technical team which includes Website Designers, Web and Software Developers, Researchers, we can offer our clients a vast range of services all under one roof.

Our experience and expertise allows us to analyze your needs and thus deliver on our promises efficiently and effectively, than our competitors. Having said that, offering solutions at affordable and industry competitive rates is something that makes TeamGrowth unique among the lot. Know more about Our Expertise

Services:

TeamGrowth offers the following Services:

Web Development: Web development is a process to make your web presence interactive and functional. Development of any product, service or solution to explore the advantage of the World Wide Web can be termed as Web Development. We are geared up to address all technological issues, including website development of companies with E-Commerce solutions, Content Management Systems, Corporate identity & branding. Please visit the following link to know more about our Web Development services

Software Development: Application/software development is the matter of customization, which directly depends upon the business requirement of the clients. We provide customized web and Software Development services and prompt support that leverage technology and business requirements. Know More about Software Development

Web Designing: Our company offers web-designing services to clients across the World. You can achieve a global presence that represents your ideas, concept, imagination through your website & reach your objectives by capturing business world. Read more about Web Designing

Software Testing & Quality Analysis (QA): We care about quality and reliability of every software we develop, hence to ensure this, we test each and every module and deliverable to verify that it meets the customer requirement and specification. Check our Quality Assurance page to know more in detail.

Search Engine Optimization (SEO) : At TeamGrowth we provide unmatched, assured and ethical SEO services which not only makes your website reputable, but also draw qualified targeted traffic to it. Checkout detailed information here : Search Engine Optimization

Mobile Application Development: In past couple of years, the Mobile Phone Market has seen a tremendous expansion and it directly gave a boost to Mobile Application Development. We hold the capabilities of developing mobile application to best suit clients business requirement for various platforms such as Android, iOS, Windows Mobile etc. Learn more on this : Mobile Application Development

Animation: TeamGrowth has vast expertise in the field of Animation, providing web animation services, 2D modeling and animation, 3D walk-through & Flash animations to users across the corners of the globe. Learn more on Animation

Solutions:

Apart from above services we also provide technology solutions like Enterprise Resource Planing (ERP), Customer Relationship Management (CRM), System Analysis and Program Development (SAP), Research and Technical Solutions for our clients.

Enterprise Resource Planing (ERP): ERP or Enterprise Resource Planning, is a business management system that integrates multiple operations like HR, Sales, Purchase, Stores etc. under one system. TeamGrowth provides complete customization and web based ERP as per different customer requirement.

Customer Relationship Management (CRM): Customer is the most important component of any business and good customer service is the lifeblood. Our CRM (Customer Relationship Management) software spans the enterprise with sales force and marketing automation, helpdesk, customer service, knowledge management, order processing, defect tracking, project management and more.

System Analysis and Program development (SAP): Our proven SAP integration capability enables seamlessly integrated solutions that increases the value of technology investments.

Research and Technical Solutions: TeamGrowth has a team of experts having more that Six years of experience in Webhosting and Internet world which can help to research on any technical problem and offer distinct solutions to best fulfill your requirements.

With the increasing need of a web presence these days, it is imperative for you to achieve a commendable spot over the web. To get started, you need a professional website design which sets you apart from everyone else and get on par with the giants of the web.

Posted in TeamGrowth | Tagged , , , | Leave a comment