PHP Website Design
PHP Website Design Tutorials
This is PHP tutorials for beginners. Trustweb – Web Developer provides these absolutely free php tutorials. Want to study Php for beginners then learn PHP basics from our php tutorials with example and make yourself an expert of php website design.
PHP stands for PHP Hypertext Pre-processor. This is server side scripting language specially designed for dynamic website design. PHP based on C and C++ programming languages. This was initially developed in the year of 1994. Previously it was named as "Personal Home Page" but now it is usually called "PHP Hypertext Pre-processor". PHP codes are easily embedded in pure HTML codes. PHP codes are executed in the server side and produce pure HTML outputs which are executed in the browser with browser side HTML codes and show the final output. Now days all kind of dynamic web pages mainly designed with PHP. The popularity of PHP is increasing very significantly. All most all e-commerce sites, chatting sites, online payment sites, and all other sites which are used different dynamic purpose is mainly designed with PHP. In this tutorial we will show you and teach you the basic understanding of PHP by which you can easily design one complete dynamic Web site.
Very first you have to learn how PHP code can be embedded in HTML codes.
It is quite easy,
Just write your PHP scripts anywhere inside HTML codes and surround it by <?php and ?>.
That is,
................................HTML...Codes.......................
...................................................................
...................................................................
...................................................................
<?php
..............................PHP...Scripts........................
?>
................................HTML...Codes.......................
...................................................................
...................................................................
...................................................................
Another thing you have to remember that if you include PHP script inside any web file then the file must be saved with .php extension instead of .html extension.
Another very popular way of embedding PHP script inside HTML codes including .php file wherever is required in the HTML codes.
Put your php, other scripts like javascripts and some necessary HTML codes inside a file and save it with .php extension. Call this file inside the HTML codes other php file with include() function That is,
................................HTML...Codes.......................
...................................................................
...................................................................
...................................................................
<?php include("example.php");?>
................................HTML...Codes.......................
...................................................................
...................................................................
...................................................................
Now we will learn how to display the output of any php codes on the browser. It is done by echo function.
Inside php script if write anything inside quotes after the word "echo" then that will be executed as html code and displayed on the browser.
In other words everything surrounded by quotes and after echo will come to browser and executed as pure HTML codes.
For example,
<?php echo "<span style='color:red'> RED TEXT </span>"; ?> Will display RED TEXT