HTTP Request Methods-PHP



HTTP Request Methods The Internet’s HTTP protocol, commonly used to fetch Web pages, defines a number of “methods” that browsers can use to send requests and data to Web servers. Of the available methods, the two most important are the GET method and the POST method.
GET is the “default” method for the Internet, used whenever you request a page with your browser. All data in the request must be encoded in the URL.

POST is most often used for submitting forms. It allows additional form data to be sent with the request. HTML lets you specify the method to use for each formtag. Although GET is the default, it is most common to use POST, which avoids cluttering the URL with the submitted data.


Use the POST method when declaring your form in HTML. This prevents
form values from appearing in the URL, and allows a larger amount of data
to be submitted through the form.

Use PHP’s htmlspecialcharsfunction when populating form fields with
PHP values, to avoid malformed HTML.
PHP has its own wrappers for Curl, so we can use the same tool from within
PHP. A simple GETrequest looks like this:
<?php
$url = "http://oreilly.com";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

?>
The previous example is the simplest form, setting the URL, making a request to its
location (by default this is a  GET  request), and capturing the output. Notice the use of
curl_setopt(); this function is used to set many different options on Curl handles and
it has excellent and comprehensive documentation on http://php.net. In this example,
it is used to set the  CURLOPT_RETURNTRANSFERoption to  true, which causes Curl to  return
the results of the HTTP request rather than  outputthem. In most cases, this option
should be used to capture the response rather than letting PHP echo it as it happens.
We can use this extension to make all kinds of HTTP requests, including sending custom
headers, sending body data, and using different verbs to make our request.
If you use normal HTTP, form data will be sent in “clear text” over the Internet
from the browser to the server. This means it can be intercepted by someone
using a packet sniffer. When you send confidential information such as financial details,
 use an encryption technology such as SSL.

<?php
$url = "http://requestb.in/example";
$data = array("name" => "Lorna", "email" => "lorna@example.com");
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER,
array('Content-Type: application/json')
);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);

?>
Again,  curl_setopt()is used to control the various aspects of the request we send.
Here, a POSTrequest is made by setting the CURLOPT_POSToption to 1, and passing the
data we want to send as an array to the  CURLOPT_POSTFIELDSoption. We also set a
Content-Typeheader, which indicates to the server what format the body data is in; the
various headers

Assuming magic quotes is disabled on your server, and you have no other measures
in place to prevent it, this clever attack alters the meaning of the query:
SELECT * FROM users
WHERE username='' AND password='' OR username LIKE '%'

The modified query will select allrecords in the user table! When the script checks
whether any users matched the supplied user name and password combination,
it will see this big result set and grant access to the site

This can be prevented if we escape the incoming variables:

$sql = "SELECT * FROM users
WHERE username='" . safeEscapeString($_POST['username']). "'
AND password='" . safeEscapeString($_POST['password']). "'";
In some cases, depending on the circumstances, this may not be necessary.

Advantages of MySQL and PHP

Certain technologies play together better than others. PHP, a simple and powerful scripting language, and MySQL, a solid and reliable database server, make a perfect marriage between two modern technologies for building databasedriven, dynamic Web sites. Some of the advantages of both PHP and MySQL are:
•  High performance
•  Built-in libraries
•  Extensibility
•  Relatively low cost
•  Portability
•  Developer community
•  Ease of learning
High Performance
PHP is no longer considered just a grassroots scripting language, but now with PHP 5, and its highly efficient built-in Zend engine, PHP accommodates developers and IT decision makers in the business trend to rapidly release and update software on the Web faster than conventional programming cycles have allowed.
MySQL, a highly optimized database server, provides the response time and throughput to meet the most demanding applications.With PHP scripts connected to a MySQL database, millions of pages can be served on a single inexpensive server.
Built-In Libraries
PHP comes with many built-in functions addressing common Web development tasks. Problems encountered by other programmers have been solved and packaged into a library of routines, made available to the PHP community. The official PHP Web site at http://www.php.netprovides excellent documentation explaining how to use all of the functions currently available.
Extensibility
PHP and MySQL are both extensible, meaning that developers around the world are contributing add-on modules to extend the functionality and power of the languages to stay current with the growing market needs and standards of the day. You can also obtain the source code for both PHP and MySQL. Source code is the code that a program consists of before theprogram is compiled; that is, the original building instructions of a program.
Relatively Low Cost
As a Web developer you can demand a lot more money for your time if you can master PHP and MySQL. Because they are open source projects, there is no licensefee associated with using PHP or MySQL. Because both applications run on almost any platform, you also have a wide range of hardware choices lowering the total cost of ownership. With so many qualified PHP developers sharing information on the Web, and excellent online documentation, you can get the most up-to-date, reliable information without paying for it.
Portability
PHP and MySQL run on almost any platform, including Linux, Windows, Mac OS X, FreeBSD, Solaris, and so on. If well written, you can simply copy the code from one server to another and expect the same results, perhaps with some minor adjustments.
Developer Community
Both PHP and MySQL have a huge following in the development community. If you run into a problem, you can usually very quickly find support on the Web, where your problem can be posted, identified, and resolved by other users and developers sharing your problem. Developers worldwide are constantly finding and resolving bugs and security holes, while working to keep these languagesup-to-date and optimized.
Ease of Learning
PHP and MySQL are relatively easy to learn. Most of the PHP constructs are similar to other languages, specifically Perl, making it familiar to most developers. MySQL uses the SQL query language and English-like language used by most modern database management systems today. If you have had any experience with SQL, you will find using it with MySQL an easy transition.

MySQL is a relational database management system. Whether you’re involved with a Web site that processes millions of requests a day like eBay or Yahoo!, or a smaller site such as your own online shop or training course, the data must be stored in an organized and structured way for easy access and processing.
This is handled by a database management system such as MySQL where the data is stored in tables rather than in a flat file.

MySQL uses the client/server model; that is, a database server (MySQL) that serves (communicates) with multiple clients application programs), where the clients may or may not be on the same computer. It also supports SQL, the structured query language, a standardized language used by most modern databases for working with data and administering the database.

MySQL software is open source. As discussed earlierin this chapter, open source means that it is possible for anyone to download MySQL from the Internet, and use and modify the software without paying anything. The MySQL software uses the GPL GNU General Public License, http://www.fsf.org/licenses/, to define what you may and may not do with the software in different situations. If you need to use MySQL code in a commercial application, you can buy a commercially licensed version. See the MySQL Licensing Overview for more information http://www.mysql.com/company/legal/licensing .
The MySQL Database Server is very fast, reliable, and easy to use. MySQL Server was originally developed to handle large databases much faster than existing solutions and has been successfully used in highly demanding production environments for several years. Its connectivity, speed, and security make MySQL Server highly suited for accessing databases on the Internet.

MySQL serves as a back end for all kinds of information such as e-mail, Web images and content, games, log files, and so on. The server can be embedded in applications such as cell phones, electronic devices, public kiosks, and more.

configuring PHP-impact security

The primary mechanism for configuring PHP is the php.inifile.
As the master file, this provides you with control over all configuration settings.
Entries generally take the format:
setting= value

Be sure to read the comments provided in the file before making changes, though.
There are a few tricks, such as include_pathusing a colon (:) as a seperator on
Unix, and a semicolon (;) on Windows.
Most Web hosts will not provide you access to your php.inifile unless you have
root access to the system (which is typically not the case if you’re using a cheap
virtual hosting service). Your next alternative is to use .htaccessfiles to configure
PHP assuming the Web server is Apache.
An .htaccessfile is a plain text file that you place in a public Web directory to
determine the behavior of Apache when it comes to serving pages from that directory; for instance, you might identify which pages you’ll allow public access to.
Note that the effect of an .htaccessfile is recursive—it applies to subdirectories
as well.

To configure PHP with .htaccessfiles, your hosting provider must have the
Apache setting AllowOverride Optionsor AllowOverride Allapplied to your
Web directory in Apache’s main httpd.confconfiguration file. Assuming that
is done, there are two Apache directives you can use to modify PHP’s configuration:
php_flag
used for settings that have boolean values (i.e. on/offor 1/0) such as
register_globals

php_value
used to specify a string value for settings, such as you might have with the
include_pathsetting
Here’s an example .htaccessfile:

# Switch off register globals
php_flag register_globals off
# Set the include path
php_value include_path ".;/home/username/pear"

The final mechanism controlling PHP’s configuration is the group of functions
ini_setand ini_alter, which let you modify configuration settings, as well as
ini_get, which allows you to check configuration settings, and ini_restore,
which resets PHP’s configuration to the default value as defined by php.iniand
any .htaccessfiles. Using ini_set, here’s an example which allows us to avoid
having to define our host, user name and password when connecting to MySQL:
ini_set('mysql.default_host', 'localhost');
ini_set('mysql.default_user', 'harryf');
ini_set('mysql.default_password', 'secret');
if (!mysql_connect()) {
echo mysql_error();
} else {
echo 'Success';
}

Be aware that PHP provides for some settings, such as error_reporting, alternative functions that perform effectively the same job as ini_set.

Apple seeds iOS 8 beta

Apple is now seeding the iOS 8 beta 2 to developers. It comes exactly two weeks after the Beta 1 went live and brings lots of bug fixes and a few new features.

 Some of the critical fixes include a working brightness slider, purchases are sorted again by date in the App Store, and crashes does not occur when adding third party keyboards.

There are numerous fixes done on the HealthKit and Handoff feature between iOS 8 Beta 2 and Yosemite Beta 2. Apple's QuickType keyboard premieres on iPads, too.

Finally, the Apple's Podcast app comes pre-installed with iOS 8 Beta 2, as it was
with the iBooks app in Beta 1. New settings are available in the iOS 8 Beta 2 - Battery
 Usage Per App, Disable All Notifications, Enable iCloud Photos for sharing.


There are lots of ways you can install iOS 8 Betas. There are reports for some errors upon installing iOS 8 Beta 2, so if you don't know what you are doing or you are afraid to loose precious data - you should probably wait for the official release this fall. Side by side with the iOS 8 Beta 2

Medical Jobs At East Delhi Municipal Corporation

Online applications are invited for the following posts of Doctors in East Delhi Municipal Corporation
  1. Specialist-Surgery : 05 posts
  2. Specialist Gynecology : 07 posts
  3. Specialist Pediatrics : 07 posts
  4. Specialist –Medicine : 03 posts
  5. Specialist Ophthalmology : 02 posts
  6. Specialist Pathology : 04 posts
  7. Specialist Anesthetist : 05 posts
  8. Specialist ENT : 05 posts
  9. Specialist Radiologist : 05 posts
  10. Specialist Orthopedics : 04 posts
  11. General Duty Medical Officer - II : 25 posts
  12. Specialist-Microbiology : 01 post
  13. Specialist-Biochemistry : 01 post
  14. Specialist Dermatology : 03 posts
  15. Specialist MEDICAL MICROBIOLOGY : 01 post
  16. Specialist RESPIRATORY MEDICINE AND TB : 02 posts
How to Apply :  Apply Online at MCD East website on or before 30/06/2014 only. 
For more information and online submission of application form,
 View Details
 http://111.93.49.24/recruitment/control/portalView

Teacher job at South Delhi Municipal Corporation


Online Applications are invited from desirous candidates, who fulfill the eligibility conditions of the post concerned, for engagement as Teachers on contract basis :

  1. Teacher (Primary) : 800 posts
  2. Teacher (Nursery) : 120 posts
  3. Special Educator (Primary) : 588 posts
  4. Counsellors : 24 posts
How to Apply :  Apply Online at South Delhi Municipal Corporation (SDMC) website  on or before 30/06/2014.
For more information and online submission of application form
View Details:http://111.93.49.24/recruitment/control/portalView

How Search Engines Work

Virtually all search engines operate in a similar fashion. Each search engine has robots
that keep visiting the web pages and keep indexing what they find there. The process
takes place in the following order:

Web crawling
Indexing
Searching
This is done by an automated web browsing script known as web crawlers, which are
popularly known as spiders. They retrieve information from the HTML coding of a web
page and they keep visiting the links present on that site and also find one way links
leading to the web page or website and continue indexing this data.
Data about web pages are indexed in a database for use in providing quick search
results. A search query can be a single word or a phrase depending on the
requirements of the person using the search engine. The function of this index is to
quickly enable a searcher to find the relevant information.

Social Networking And  SEO

However, social networking has challenged SEO in new ways because of the fact that
you no longer needed to impress only Google, but ordinary people. This meant that you
were no longer able to simply rely upon getting your stuff ranked highly by the Google
search engine but instead were forced to try to appeal to ordinary people

Google's dominance is also a bit of the Microsoft Office effect. Microsoft's Office
suite is considered the standard bearer in the world of office suites and they have
worked hard to maintain that dominance. Thus everyone else works to try to be
compatible with Microsoft Office which in turn makes Microsoft Office more entrenched.
Similarly, because nobody can afford to ignore Google as they work on SEO, people
tend to focus on Google as they do their SEO, which in turn feeds on Google.
How to get your website to top of google .

Google is so much more popular than all the rest is that they
have been working to keep themselves on top. This means that they make constant
updates to their algorithms in order to try to stay ahead of the spammers and black hat
SEO people. They have also worked to make their brand name ubiquitous

XML Sitemap

The premise of using XML Sitemap Protocol was that it would help search engines
index  content  faster  while  providing  ways  to  improve  their  existing  crawling  algorithms. Using XML Sitemap Protocol does not guarantee anything in terms of better
page rankings. Furthermore, use of XML Sitemap Protocol is not mandatory for all
sites. In other words, a website will not be penalized if it is not using XML Sitemaps.

SERPs

Once the visitor clicks on the Search button, things start to get more interesting. First,
the visitor is telling the search engine what he is looking for. The search engine responds
with a results page based on the current index for the specific region the visitor is coming
from. Between the time that the results page shows up and the time the visitor clicks
on a specific search result, many things can be recorded, including:
• The time it took to click on the first result not necessarily the first SERP result.
• The time it took to click on other results if any.
• Whether the visitor clicked on subsequent SERPs
• Which result in the SERPs the visitor clicked on first, second, and so on
• The time between clicks on several results.
• The CTR for a specific result.

Differences between Major Search Engines

All search engines basically perform the same task of providing relevant info which is
being searched for by the users. The only difference is how they index the information.
Search engines such as Google store all or part of the source as well as information
about the web pages which is present as the page source. On the other hand, some
search engines store every word they find on a web page.
Top 10 backlinking sources .

The main feature that marks a difference among search engines is their indexing
methods and search criteria. Some search engines index all the words and make that
the basis of their search results, while others establish relevance of terms by conducting
proximity searches. Presently Google has the largest share of the search engine
market. This is due to its popularity and the set of algorithms that it keeps updating to
make the user experience more relevant.

Google Analytics

Although Google Analytics is great at many things it does, it is far from perfect. You
can accomplish everything Google Analytics does and more with old-fashioned web
server logs and a solid third-party analytics tool. Web server logs do not lie or report
inaccurate data.
Google Analytics does have its benefits, as it is almost live and can be accessed from
anywhere. With Google’s integration of Analytics with its other flagship platforms.
If you have to use dynamic content, yet you need to ensure proper search engine crawling

Best Of Arijit Singh Songs

Best Of Arijit Singh Songs

Ek Villain: Galliyan Full Audio Song

Ek Villain: Galliyan Full Audio Song

Jeene Laga Hoon Bollywood-song

Jeene Laga Hoon Bollywood-song

Suno na Sangemarmar Full song

Suno na Sangemarmar Full song

Salman Khan-the killer

Salman Khan-the killer

Tune Maari Entriyaan - Song - GUNDAY


Kabhi Jo Badal Barse Song


Blue Eyes Full Video Song Yo Yo Honey Singh


How To Get Your Website To The Top Of Google And All top Search Engines less time

How To Get Your Website To The Top Of Google And All top Search Engines less time

Pictures- Great tool with some unique features like automatic effects or
watermark inclusion, image alt tags, shadows, position and more.

Tables- Insert tables easily in your weblog, without using any other external
applications or services.

Maps- Integrate maps locations in your blog. Very easy and useful feature.
Powered by Microsoft Virtual Earth application.

Tags- Easily insert tags for your blog posts. Supports tags from Technorati,
LiveJournal, Flickr, Del.icio.us, ice rocket, 43 things and more.

Insert Video- Easily upload or insert video to your weblog using this function.
Great tool for blogs with lot video integrated.

Insert Hyperlink- Of course you can add links with this nice tool. Advanced
options are available also. So everything you need is here.

Submit link from your original RSS XML file on these services and they will track
changes on it daily, just like when you upload original sitemap file.
http://your-website.com/rss.xml .Then all you need is to add above address on
Google Webmaster Centerand and Yahoo Site Explorer.

Make an account on http://twitter.com just for your IM
purposes. Make up a name, or come up with something like IMGuru as your username. This
is easy and simple; you should have no trouble here. Just make the account, confirm the
email, and then *important* personalize it with a bio, picture.

Get listed in various search engines and directories

1)  Strong Anchor Text Distribution Is A Must
2)  Utilize Authorship Markup
3)  Backlink Variation is Uber important.
4)  Social Signals Are Vital
5)  On-Site Optimization + Content
6. Get more traffic
On-site optimization has gotten more and more important recently and content
 has been and always will be important. You might say that content is the life of the internet.
No wonder Google values high quality .

Guest Blogging

Guest blogging method. Since the death of private blog networks
happened, this method should be one of your power methods to beat out your
competition.

Blog Commenting

In the past, a lot of people used programs like Scrapebox to quickly  blast out thousands
of irrelevant comments on any old blog they could scrape. While this worked fairly well
for quite a while, it is a horrible idea now. But blog commenting in and of itself is still a
great idea. Rather than blasting thousands of irrelevant comments.

Social Toolbars - Social Share Buttons

This is similar to the previous backlinking source, however, having a toolbar such as Slick
Social Share Buttons enables visitors to quickly and easily “like, “plus”, “tweet”,
“stumble”, etc…. Think of getting these as a person voting your site as useful and having
quality content. What does Google want their top results to have? Useful information
and quality content.

10 backlinking sources

1)  Free Website Directories
2)  Guest Blogging
3)  Blog Commenting
4)  Social Media Sites
5)  Social Toolbars
6)  Social Bookmarking
7)  Pinterest
8)  Free Press Releases
9)  Video Sites
10)  Document Sharing Sites

Keep a steady Link Velocity

Link Velocity is the rate at which you gain backlinks to your site. If you get them too fast,
then there is a good chance your site will get peanlyzed for spammy activities. If you get
them too slow, you will not get the desired rankings.
Try to get anywhere from 10 to 100 links per day if at all possible. Even near 100 is a bit
much, but should not raise any red flags. The key with backlinking now is quality and
consistency.

Make sure that each page found on your website has its own unique set of meta tags. Duplicate tags can really hurt your rankings.
Here’s an example of the meta tagsI use to describe just one of my many websites, Marketing.com:
<title>Internet Marketing Expert| Marketing Secrets</title>
<meta name=“Description” content=“Internet marketing expert reveals powerful marketing secrets. Search our internet
marketing expert database, marketing service providers, and more.”>
<meta name=“Keywords” content=“internet marketing, marketing secrets, online marketing expert, internet marketing help.”>
<meta name=“Robots” content=“all”>

Robots

The simplest of all meta tags, the robots tag, signals the Googlebot, Google’s search engine spider, to crawl your entire website. In
order to index your website properly and include all of your web pages, search engines send their spiders to review and scan your
website on a regular basis. Google does this every two or three days.

Proper Keyword Placement

You must focus on where and how your keywords are placed on your web page. The frequency of placement is less important than once considered. Many people believe that if they fill their web pages with nothing but keywords, theycan attain top placement.

Search engines have responded to this and actually penalize sites that over use keywords. The number of times your keyword appears on a given web page is called keyword density.
The concept of keyword density gets thrown around quite a bit in SEO circles. It refers to the number of times your keywords are used on a given page as a percentage of the total number of words. Most website gurus suggest a keyword density of 2 to 3 percent.
Today, keyword density has less of an impact than it once did on overall Google rankings.
 Of greater importance is the placement and treatment of your keywords. 
Use the following guidelines tooptimize your page:
• Place your keyword(s) in the title tag, description tag, keyword tag, and alt tags.
• Place your keyword(s) in an <h1>, <h2>, and/or <h3> tag.
• Place your keyword(s) in the first twenty-five words of your page.
• Place your keyword(s) in the last twenty-five words of your page.
• Bold your keyword(s) at least once on your page.
• Italicize or underline your keywords at least once on your page.

On-page optimization -must follow

On-page optimization is what you do on yourwebsite to influence SERPs on Google.
• Doing proper keyword research is the first step to a successful SEO campaign.
• Having proper meta tags isessential. Always include your keyword phrase(s) in your meta tags.
• The proper meta tags include yourtitle tag, description tag, keywords tag, and robots tag.
• Choose your URL carefully. Your URL doesn’t have to have your keyword included but it helps when other sites link to your site using only your URL.
• How you format your page is important for optimization purposes.
• Make sure you design your web pages so Google isforced to read your on-page content first.
• Verify that your code is W3C compliant.
• Don’t forget to include your keyword phrase at <h1>, <h2>, and <h3> header tags. This signifies the importance of your content to Google.
• Label each graphic with an alt tag that includes your keyword phrase.
Italicize, bold, and underline your keyword phrase within your content.
• Eliminate Flash if it’s the mainpresentation of your website. Google does not view this favorably.
• If you’re going to use JavaScript toenhance the overall visitor experience of your website, place the code in an external file.
• Focus on a fast loading website. Thisis essential for top Google rankings.
• Be sure to include a sitemap that’s easily accessible by Google.
• Never underestimate the power of internal linking. A good internal linking structure can improve your SERPs.
• Keyword development is one of the most important on-page optimization strategies.

php.ini Settings for Session Management

Before you get started with this chapter, you may have to make a couple of minor changes to your php.ini file so that sessions work correctly.

On Windows

If you are using a Windows version of PHP, the first thing you need to do is to edit your php.ini file. The default session setting in php.ini will not work correctly under Windows.
Open your php.ini file, which is found in c:\windows or c:\winnt, in a text editor and search for the line:
session.save_path = /tmp 
Change it to a directory in which you keep temporary files, for example:
session.save_path = C:/temp 
You could also leave the value as /tmp and create a directory named "tmp" at the root of the drive on which your Web server resides. For example, if your Web server was located in D:/apache/bin, then you could create the directory d:/tmp and you would not have to change the session.save_path setting in php.ini.
A good indication that the session.save_path has not been set correctly on Windows is if Apache crashes when you try to load a session-enabled page.

On Linux

If you are using Linux, you need to make sure that your /tmp directory can be written to by the user who runs the Web processes. Typically this is the user nobody, and most systems, by default, allow the nobody user to write to the /tmp directory.
The rest of the default session settings should work fine for you in the examples in this chapter.

General Considerations

You should not store the session files in any directory which is viewable from your Web server. If you are using Apache, then that would be any directory under the htdocs directory. The reason you do not want to place session files in a directory that is viewable from your Web server is because malicious users may be able to open those files and view individual session data, and even hijack user's sessions in this manner.

You cannot track variables across a user session unless you start the session on each page on which you want to use or alter those variables. Starting a session uses the session_start() function:
session_start(); 
session_start() takes no arguments. If you are starting a new session, then the function initializes the session and creates the necessary temp files to track the session. If a $PHPSESSID is found by the function, either by a cookie or a GET variable, then the function resumes the current session and the page has access to any variables that have been registered to the session.
Once you have started the session, you need to register some variables with it. The session will not track variables until they have been registered using the session_register() function:
session_register(STRING); 
The STRING argument to session_register() should be the name of the variable that you want to register with the session so that it may be accessed across any session-enabled pages.
Once you have started the session and registered one or more variables, you can use those variables across any session enabled pages on your site. , session.php, provides a simple example of starting a session and registering a variable.


PHPGTK-application window

PHPGTK is an extension to PHP that allows you to create graphical user interface (GUI) applications. Instead of running in a browser, your PHP application runs in its own application window. These applications are client-side only. They do not reside on the Web server. The files instead reside on the user's hard drive. For users to use the PHPGTK application, they must have the proper version of PHP with the GTK+ extension installed on their system.

GTK+ was originally designed for the open-source image editing program called the GIMP (GNU Image Manipulation Program). GTK stands for the GIMP Tool Kit. Later, the Gnome team decided to use GTK+ to create their desktop environment for Linux. GTK+ has been ported to Windows, Linux, and BeOS, and thus makes for a good cross-platform GUI library.

PHPGTK uses GTK+ to draw the widgets required in any GUI application. Widgets are things like scroll bars, text input fields, and buttons, among other things. When you start almost any Windows application, such as a Web browser, you are looking at a collection of widgets.

Widgets need to be contained in some type of framework to be useful and logical. You can't just have a bunch of buttons and text fields scattered randomly about the screen. To solve this problem, we use a special kind of widget called a container. A container is another structure that organizes the widgets however you think it best for your application. For example, the menu bar at the top of most applications is a container.

Before you can start using PHPGTK, you need to download the appropriate files. The PHPGTK team has set up a nice Web site at http://gtk.php.net. The PHPGTK Web site has downloads and documentation for the GTK extension.

Before You Install

PHPGTK still has not reached the 1.0 version, and as such I wouldn't recommend that you use this version of PHP on your production Web server. In fact, there really isn't a reason that you'd want to install PHPGTK on your production Web server. It is a client-side application!
PHPGTK is a developers' toy at the moment, and anything is subject to change, at least before PHPGTK reaches version 1.0. Have some fun with it, try it out, but don't base your company's next big product on PHPGTK 0.5.0.

Installing on Windows

Installing PHPGTK on a Windows machine is fairly straightforward and similar to installing the normal version of PHP. Download the Windows binary file from the PHPGTK Web site at http://gtk.php.net.
Unzip the file using a zip utility such as WinZip. Extract the files to your C: drive.
The following folders are created when you unzip the file:
  • php4— Contains the PHP executable, as well as some GTK library files.
  • test— Contains some sample *.php files that use the GTK widget set.
If you are using Windows 98 or Windows ME, then you will notice that folders called "winnt" and "winnt/system32" have been created. You should copy the contents of those folders into your C:\windows directory. Note that you may have to set your system files to be viewable so that you can see the necessary DLL files to copy them over to C:\windows.
Additionally, you should see a new php.ini file. Copy this to your C:\Windows or C:\WINNT directory. Be sure to first back up your existing php.ini file.
To test out the installation, type the following from a command prompt:

c:\php4\php.exe -q c:\test\gtk.php 
 

Installing on Linux

Installing PHPGTK on Linux is easier than installing the normal PHP; you don't have to worry about compiling with Apache. You can compile GTK functionality into an existing standalone version of PHP, but for our purposes we'll start from scratch and make a brand new PHP executable that has GTK functionality built in. Before you begin:
  1. Download the source file for PHP from the download page at www.php.net.
  2. Download the source file PHPGTK from the download page of http://gtk.php.net.
Once you have the necessary file, unzip and untar the regular PHP source file:
tar -zxvf php-4.x.x.tar.gz
This creates a new directory named php-4.x.x, where the "x" denotes the exact version number of PHP that you downloaded.
Compile PHP using the minimum options. We just want to create a standalone executable. If you want to add additional functionality, you can recompile later. For now, you just want to make sure you can create a working version of PHPGTK. Change directory into your newly created PHP source directory. Compile by typing:
./configure
That's all there is to it. This automatically creates an executable that has built-in MySQL support as well.
Once you have the php binary file, you must copy it to /usr/local/bin. The PHPGTK installation will be looking for it in that location. You need to be root to do this.
cp php /usr/local/bin
Now, it's time to build the GTK extension onto your PHP executable. Go back to where you downloaded the PHPGTK source file and extract it:
tar -zxvf php-gtk-0.5.0.tar.gz
This creates a new directory named php-gtk-0.5.0. Change directory into that directory and compile the source file. You will need to be root to perform the final step, make install. To compile PHPGTK, type the following (a lot of text will print to the screen after you type each command):
  1. ./compile
  2. make
  3. make install
You can test your installation by going into the test directory and running a few of the scripts. X-Windows will need to be running!
cd test php -q gtk.php
A window should pop up showing various GTK widget buttons. Click the different widgets to get a brief idea of what they do.
 


top Database management system-PHP

This summary is not available. Please click here to view the post.

Session Hijacking-Protection

Session hijacking isn't new to computer security. The term is most commonly used to describe the process of a TCP connection taken over by a sequence prediction attack. In such an attack, the attacker gains control of an already established TCP connection. When applied to Web application security, session hijacking refers to the takeover of a Web application session.

HTTP is a stateless protocol with its origins in information dissemination. Clients request a particular resource, which eventually is delivered by the server hosting that particular resource. The goal of the World Wide Web in its early days was to provide a uniform medium of information dissemination via HTTP and rendering of the information via HTML. The information could also be cross-referenced by using hyperlinks. As time went by, servers were developed with the ability to handle dynamically generated content and execute programs that generated HTML. Soon enough, the need for interactivity increased. Because of its ability to handle text and graphics, the browser took the place of a universal client. Small-scale applications began to be hosted on Web servers with the use of CGI scripting, which extended the ability of universal participation to all Internet users who had a browser. No longer was an underlying operating system an issue. So long as you had a browser, you could use the application. Application development went from a central mainframe–terminal based concept to the client-server model, and back to the central Web server–browser based concept again.

These days, Web application servers host complex applications, such as an entire office productivity suite. Microsoft Outlook for the Web is an example of delivering a fully featured e-mail client over a Web browser. Lotus Domino servers provide a Web interface that lets users perform more or less the same tasks as can be performed via a Lotus Notes client.

All multiuser applications embody the concept of a user session. Each user interacts with the application via a separate user session. The application keeps track of all who are currently using the application via sessions. This capability is essential for segregating user activity.

Despite rapid changes in Web server technology, the HTTP protocol remained the same. Currently, HTTP 1.1 is still the most widely used HTTP protocol. The greatest hurdle in designing and hosting Web-based applications is to get around the statelessness of HTTP. There are no standards governing how a Web-based application should provide its own state-maintaining mechanism over HTTP. Developers tackle state preservation in different ways. There are poor and good ways of approaching this problem, although both approaches result in a workable application. The poor ways of implementing session states lead to attacks such as session hijacking.