Server-side scripting allows dynamic web page generation by running scripts on the web server. Common server-side scripting technologies include ASP, ASP.NET, JSP, PHP, and Ruby on Rails. PHP is a popular open-source option that runs on many operating systems and web servers. With server-side scripting, the server processes the script and database queries before returning HTML to the browser. WAMP provides a local environment for developing PHP applications using Apache, MySQL, and PHP. PHP code is enclosed in tags and can be turned on/off within pages.
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
887 views
Note - 01 - Server Side Web Programming With PHP
Server-side scripting allows dynamic web page generation by running scripts on the web server. Common server-side scripting technologies include ASP, ASP.NET, JSP, PHP, and Ruby on Rails. PHP is a popular open-source option that runs on many operating systems and web servers. With server-side scripting, the server processes the script and database queries before returning HTML to the browser. WAMP provides a local environment for developing PHP applications using Apache, MySQL, and PHP. PHP code is enclosed in tags and can be turned on/off within pages.
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 14
Server side scripting
Server-side scripting is a web server technology in
which a user's request is fulfilled by running a script directly on the Web server to generate dynamic HTML pages. In client-side scripting, the scripts are first downloaded, and then interpreted and executed by the Web browser. Server-side scripting enables the ability to highly customize the response based on the user's requirements, access rights, or queries into data stores.
Server side scripting technologies ASP - Microsoft designed, primarily Windows based. ASP.NET - part of Microsoft's .NET platform and is the successor to ASP JSP - a Java-based system for embedding Java-related code in HTML pages PHP - open source solution based on including code in its own language into an HTML page Ruby on Rails - a free web application framework that aims to increase the speed and ease with database driven Web sites creation
Why PHP? PHP runs on different operating system platforms (Windows, Linux, Unix and so on) seamlessly PHP is compatible with almost all Web servers used today (Apache, IIS and so on) PHP is free to download from the official website PHP is easy to learn and runs efficiently on any compatible Web server Extensive help is available through different sources (books, Internet community and so on)
Server side processing You enter the address of the Web page in the browsers address bar, e.g. http://www.facebook.com/login.php Your browser sends a request to the host (server) requesting the Web page The Web server process the request and reads the requested file (login.php) from the hard drive
Server side processing Web server detects that the file is a PHP file and thus it asks the PHP interpreter to process the file PHP interpreter, while executing the file, finds that the page has calls to MySQL database, and as a result, PHP interpreter asks MySQL to process the queries PHP interpreter completes the execution of the file with the results returned from MySQL Web server returns the resulting HTML text returned by the PHP interpreter to your Web browser Your Web browser then renders a Web page based on the HTML text returned by the Web server
WAMP Environment WAMP stands for Windows Apache MySQL PHP WAMP solution included the following software: Apache PHP MySQL PHPmyadmin SQLitemanager Wampserver service manager
Placing a PHP script within a document All PHP code needs to be enclosed within beginning and ending tags, i.e. <?php and ?> PHP blocks of code PHP processing can be turned on and off within a script by closing and reopening the PHP tags. Is PHP Installed? If you are unsure of your web hosts capability to run PHP, its recommended to follow this part. Open Notepad++. Type the following into a new text document and save it as info.php (or any file name that youll remember) in your webroot. <html> <head> <title>My first PHP page</title> </head> <body> <?php phpinfo(); ?> </body> </html> Is PHP Installed? Now point your browser localhost/info.php. If the page looks similar to the image below, PHP is installed correctly.
First PHP Page <html> <head> <title>My first PHP page</title> </head> <body> <?php echo "<h1>Hello World!</h1>"; ?> </body> </html>
It is only the server that can see the PHP codes - the client (the browser) only sees the result!