Easy to under standing File Upload in PHP

see simple tutorial how to upload file in php

http://www.sebastiansulinski.co.uk/web_design_tutorials/php/php_file_upload.php

change the PHP Max Upload file size

Last 2 yeara ago, I made a php-upload code for www.blemo.com, this site is specialy for mp3 sound and image gallary, regardings to this functionality user can upload multiple mp3 sound file at a time. that time I did not know about file uplode limit and it's setting
I tried much but some of file uploded and some of not for multipul file upload.

search some solution for that.

Most of the web servers are configured such a way that a user can only upload the maximum file size of 2MB.anything more will yield an error 500 due to a timeout. So there might be the problem for the people who wants to upload the .media file of size around 15MB. But, you can increse the maximum upload file size limit describe below.

There are two ways (that I know of) to change the php upload limit.

(1) changes in php.ini

The first is done by editing the php.ini file. This is normally the case if you have your own dedicated or virtual server. There may be multiple php.ini files throughout your system. The main one is typically found in /etc/php.ini which would govern all PHP. scripts.Furthermore you can include php.ini file in each folder that you wish to apply different settings to. In any case the, below are the fields you want to change.

upload_max_filesize = 10M ;
post_max_size = 20M ;


(2) by .htaccess

An alternative is to using the php.ini file is to use .htaccess. By just placing a.htaccess file in your root folder. the following directive would be placed in .htaccess file

RewriteEngine On
php_value post_max_size 20M
php_value upload_max_filesize 10M
php_value max_execution_time 6000000


Remember that : Choose your values carefully, know your audience and monitor the number of users. Always test/plan for worst case scenarios; 500 users uploading 10mb at the same time = 5,000mb bandwidth. This could easily annoy your web host provider.

If you are on windows with IIS server .htaccess file will not work for you,You should update these settings in php.ini file.

Advantages of PHP Programming

PHP programming which had a humble beginning has now turned to be a major player in software development. It was successful in launching fast and simple scripting language that could work seamlessly with many other components.

The execution speed of a web applications is very important as it cannot afford to slow down the rest of the machine, either. PHP integrates well with other software, especially under UNIX. It can be very fast, because it is a thin wrapper around many operating system calls.

PHP offers various security levels which can be set in the .ini file to defend the system from attacks of users, both as programmers and as surfers.

Another important advantage of PHP is its simplicity. Even HTML coders can integrate PHP programming straight into their pages.

Further Advantages of PHP Programming include:

* Ease of writing interfaces to other libraries.
* Several HTTP server interfaces.
* Large amount of database interfaces like MySQL, MS SQL, Oracle, Informix, and PostgreSQL etc.
* PHP programming is similar to C / JavaScript and Java.
* PHP is extendible.
* PHP will run on (almost) any platform.
* The PHP Extension and Add-on Repository.
* PHP is Open Source.

Reference from : http://www.eninteractive.com/Offshore-Outsourcing/Web-Application-Development/Programming/PHP-Advantages

Different types of WebHosting

Hosting can be FREE, SHARED or DEDICATED.

Free Hosting

Some service providers offer free web hosting.

Free web hosting is best suited for small sites with low traffic, like family sites or sites about hobbies. It is not recommended for high traffic or for real business. Technical support is often limited, and technical options are few.

Very often you cannot use your own domain name at a free site. You have to use a name provided by your host like http://www.freesite/users/~yoursite.htm. This is hard to type, hard to remember, and not very professional.

Good: Bad:
Low cost. It's free. No domain names.
Good for family, hobby or personal sites. Few, limited, or no software options.
Free email is often an option. Limited security options.

Limited or no database support.

Limited technical support.

Shared (Virtual) Hosting

Shared hosting is very common, and very cost effective.

With shared hosting, your web site is hosted on a powerful server along with maybe 100 other web sites. On a shared host it is common that each web site have their own domain name.

Shared solutions often offer multiple software solutions like email, database, and many different editing options. Technical support tends to be good.

Cost: $15 per month.
Best for: Small businesses who receive moderate levels of traffic.

Good: Bad:
Low cost. Cost is shared with others. Reduced security due to many sites on one server.
Good for small business and average traffic. Restrictions on traffic volume.
Multiple software options. Restricted database support.
Own domain name. Restricted software support.
Good support


VPS hosting

VPS (Virtual private server also referred to as Virtual Dedicated Server or VDS) hosting is a great stepping stone between shared and dedicated hosting. A single physical server is partitioned into multiple virtual private servers, and each VPS gets a dedicated amount of CPU and memory resources. Therefore, even if a VPS on the same server crashes, your VPS won't suffer. Also, a VPS gives you more control over server, software, and security configuration than shared hosting.


Cost: $60- $100 per month.
Best for: Small and medium businesses who need special server configuration and secure eCommerce capabilities.

Dedicated Hosting

With dedicated hosting your web site is hosted on a dedicated server.

Dedicated hosting is the most expensive form of hosting. The solution is best suited for large web sites with high traffic, and web sites that use special software.

You should expect dedicated hosting to be very powerful and secure, with almost unlimited software solutions.

Cost: starting at $150 per month
Best for: Companies who outgrow VPS hosting, or new companies who have the need and budget.


Good: Bad:
Good for large business. Expensive.
Good for high traffic. Requires higher skills.
Multiple domain names.
Powerful email solutions.
Powerful database support.
Strong (unlimited) software support.


Collocated Hosting

Collocation means "co-location". It is a solution that lets you place (locate) your own web server on the premises (locations) of a service provider.

This is pretty much the same as running your own server in your own office, only that it is located at a place better designed for it.

Most likely a provider will have dedicated resources like high-security against fire and vandalism, regulated backup power, dedicated Internet connections and more.

Good: Bad:
High bandwidth. Expensive.
High up-time. Requires higher skills.
High security. Harder to configure and debug.
Unlimited software options.


Your Checklist

Before you choose your web host, make sure that:

  • The hosting type suits your current needs
  • The hosting type is cost effective
  • Upgrading to a better server is a possible solution
  • If needed, upgrading to a dedicated server is possible

Before you sign up a contract with any hosting provider, surf some other web sites on their servers, and try to get a good feeling about their network speed. Also compare the other sites against yours, to see if it looks like you have the same needs. Contacting some of the other customers is also a valuable option.


APACHE SERVER STATUS & ERROR CODES

Sometimes when trying to access a web page, an error code will appear. Have you ever wondered what that code meant? Here is a list of the most popular error codes and their description. The first thing you should do anytime you get an error code is to make sure that you have entered the correct web page addressed. Everyone has incorrectly spelled a company name or added too many periods.

401 - Authorization Required

This error code means that you must have special access to view this page. The developers may want only certain people to access this page. There are several ways to limit access to a web page, including password protection. You may get the “401 - Authorization Required” error message when you try to view a web page with limited access. (A web site may have a customized version of this error message, displaying “Access Denied” or “Unavailable.”)

403 - Forbidden

This standard error message is generated by web servers when you try to access a file that has not been correctly configured by whomever maintains it. (The file needs to be set with “read permissions” for all users.) What this code most likely means is that you can’t view the page because whomever maintains the site set it up incorrectly.


404 - Page not found

A 404 - Not Found error means that there was no web page with the name you specified at the web site. This could happen for a variety of reasons:
Make sure that the web address (URL) that you typed in exactly matches the address you were given. Check that the capitalization matches, that all words are spelled properly, and that all the punctuation, like dots (.) and slashes (/), are correct. Be sure you are using the forward slash (/) and not the backward slash (\). (Remember, there are no spaces allowed in Web addresses, and a proper Web address will look like http://www.htmlcenter.com).
The page may have been renamed, moved, or deleted. Another possibility is that the person maintaining the web page may no longer have an account at that location.

500 - Page not available

If the server has been incorrectly set up or is experiencing technical problems, it will return this error. Again the first thing to do is make sure that you have typed in the address correctly.

501 - Not Implemented

This error is a direct result of problems in the web page’s HTML (HyperText Markup Language). It usually occurs with web pages that contain forms in which you type information and send it to a third party.









































Successful Client Requests
200 OK
201 Created
202 Accepted
203 Non-Authorative Information
204 No Content
205 Reset Content
206 Partial Content
Client Request Redirected
300 Multiple Choices
301 Moved Permanently
302 Moved Temporarily
303 See Other
304 Not Modified
305 Use Proxy
Client Request Errors
400 Bad Request
401 Authorization Required
402 Payment Required (not used yet)
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable (encoding)
407 Proxy Authentication Required
408 Request Timed Out
409 Conflicting Request
410 Gone
411 Content Length Required
412 Precondition Failed
413 Request Entity Too Long
414 Request URI Too Long
415 Unsupported Media Type
Server Errors
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 HTTP Version Not Supported

Web 2.0 : What Is It?












 

The bursting of the dot-com bubble in the fall of 2001 marked a turning point for the web. Many people concluded that the web was overhyped, There is no clear definition of web 2.0.


The concept of "Web 2.0" began with a conference brainstorming session between O'Reilly and MediaLive International (Web 2.0 conference ) held in San Francisco Oct 2004 but one thing is clear Web 2.0 marks a fundamental change in how we use the Internet.


Web 1.0

Early Web development (retrospectively called as Web 1.0)

Simply we can say these :

·  Static pages instead of dynamic user-generated content.

·  The use of framesets.

·  Proprietary HTML extensions such as the <blink> and <marquee> tags introduced during the first browser war.

·  Online guestbooks.

·  GIF buttons, typically 88x31 pixels in size promoting web browsers and other products.

·  HTML forms sent via email. A user would fill in a form, and upon clicking submit their email client would attempt to send an email containing the form's details


Web 2.0

Network connectivity is the most fundamental principle for Web 2.0 to succeed. Any collaboration amongst users is not possible without being connected to each other.

There are a plethora of web sites emphasizing the social aspects of Web 2.0 which was not prominent in Web 1.0.


AJAX, CSS, RSS/Atom, Folksonomies, Blogs, Mashups and REST are some of the main technologies that enable the principles of Web 2.0. In the subsequent blog entries,

(IMAGE)


There is no clear-cut demarcation between Web 2.0 and Web 1.0 technologies, hardware and applications. The distinction is, to a large extent, subjective. Here are a few characteristics often noted as descriptive of Web 2.0:



  • blogging

  • Ajax and other new technologies

  • Google Base and other free Web services

  • RSS-generated syndication

  • social bookmarking

  • mash-ups

  • wikis and other collaborative applications

  • dynamic as opposed to static site content

  • interactive encyclopedias and dictionaries

  • ease of data creation, modification or deletion by individual users

  • advanced gaming.


 


 “collection of technologies - be it VoIP, Digital Media, XML, RSS, Google Maps… whatever … that leverage the power of always on, high speed connections and treat broadband as a platform, and not just a pipe to connect.”

That is easy (few minutes learning curve), quick (intuitive) and effective (presentable). Flickr, Wikipedia, MySpace, Writely, Del.icio.us and YouTube are some of the most common (and successful) websites showing Web 2.0 concepts. Most of these websites have gained popularity in past 1.5 years but it's hard to imagine life before them.

Web 2.0 era is the rise of blogging. Personal home pages have been around since the early days of the web, and the personal diary and daily opinion column around much longer than that,

& internet era software is that it is delivered as a service, not as a product.

Netscape was the standard bearer for Web 1.0, Google is most certainly the standard bearer for Web 2.0,














































































Web 1.0

 

Web 2.0

DoubleClick

-->

Google AdSense

Ofoto

-->

Flickr

Akamai

-->

BitTorrent

mp3.com

-->

Napster

Britannica Online

-->

Wikipedia

personal websites

-->

blogging

evite

-->

upcoming.org and EVDB

domain name speculation

-->

search engine optimization

page views

-->

cost per click

screen scraping

-->

web services

publishing

-->

participation

content management systems

-->

wikis

directories (taxonomy)

-->

tagging ("folksonomy")

stickiness

-->

syndication


we believe to be the core competencies of Web 2.0 companies:



  • Services, not packaged software, with cost-effective scalability

  • Control over unique, hard-to-recreate data sources that get richer as more people use them

  • Trusting users as co-developers

  • Harnessing collective intelligence

  • Leveraging the long tail through customer self-service

  • Software above the level of a single device

  • Lightweight user interfaces, development models, AND business models


That is easy (few minutes learning curve), quick (intuitive) and effective (presentable). Flickr, Wikipedia, MySpace, Writely, Del.icio.us and YouTube are some of the most common (and successful) websites showing Web 2.0 concepts. Most of these websites have gained popularity in past 1.5 years but it's hard to imagine life before them.


The idea of sharing information is being valued as much as the idea of proprietary information. Open source, which has been around for decades, is becoming a significant factor. And the web link is becoming a form of currency.


 


Web 2.0 vs Web 1.0   From Joe Drumgoole





  • Web 1.0 was about reading, Web 2.0 is about writing

  • Web 1.0 was about companies, Web 2.0 is about communities

  • Web 1.0 was about client-server, Web 2.0 is about peer to peer

  • Web 1.0 was about HTML, Web 2.0 is about XML

  • Web 1.0 was about home pages, Web 2.0 is about blogs

  • Web 1.0 was about portals, Web 2.0 is about RSS

  • Web 1.0 was about taxonomy, Web 2.0 is about tags

  • Web 1.0 was about wires, Web 2.0 is about wireless

  • Web 1.0 was about owning, Web 2.0 is about sharing

  • Web 1.0 was about IPOs, Web 2.0 is about trade sales

  • Web 1.0 was about Netscape, Web 2.0 is about Google

  • Web 1.0 was about web forms, Web 2.0 is about web applications

  • Web 1.0 was about screen scraping, Web 2.0 is about APIs

  • Web 1.0 was about dialup, Web 2.0 is about broadband

  • Web 1.0 was about hardware costs, Web 2.0 is about bandwidth costs


40 Tips for Optimizing PHP performance

Reinhold Weber has written 40 Tips for Optimizing PHP performance. Many of them were new to me - e.g. $row['id'] is 7 times faster than $row[id]. I don’t know how he has measured these numbers, but the tips are good overall!

Here are the first 10 tips:

  1. If a method can be static, declare it static. Speed improvement is by a factor of 4.
  2. echo is faster than print.
  3. Use echo’s multiple parameters instead of string concatenation.
  4. Set the maxvalue for your for-loops before and not in the loop.
  5. Unset your variables to free memory, especially large arrays.
  6. Avoid magic like __get, __set, __autoload
  7. require_once() is expensive
  8. Use full paths in includes and requires, less time spent on resolving the OS paths.
  9. If you need to find out the time when the script started executing, $_SERVER[’REQUEST_TIME’] is preferred to time()
  10. See if you can use strncasecmp, strpbrk and stripos instead of regex

Read the full list of 40 tips here.

Read comments on the post as well, they too contain useful information.