31 August 2018

How to Write PHP code and HTML code within a same file

  • A PHP file can have both PHP code and HTML code together.
  • Any HTML code written outside of PHP <?php //php code here… ?> Code is ignored by the PHP parser which allows PHP files to have PHP code and HTML code in a same file.
  • A PHP file must have “.php” extension. 
  • Sample “index.php” file code is given bellow:

  •  1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    <!DOCTYPE html>
    <html>
    <head>
    <title>Web Page Title</title>
    </head>
    <body>
    <?php
     echo "<h1>HTML Code inside PHP code </h1>";
    ?>
    <h1>This is a Heading</h1>
    <?php
     echo "Today's Date is ".date("d-m-y");
    ?>
    <p>This is a paragraph.</p>
    
    </body>
    </html> 
    
  • Output of above code:
  • HTML Code inside PHP code

    This is a Heading

    Today's Date is 01-09-18
    This is a paragraph.
    
    

# Book on PHP:


Learning PHP, MySQL & JavaScript: With jQuery, CSS & HTML5 (Learning PHP, MYSQL, Javascript, CSS & HTML5)

28 August 2018

What are PHP tags?

  • PHP code starts with start tag <?php and end with end tag ?>
  • PHP code can also start with short open tag <?  .To use this short tag you have to enable short_open_tag in php configuration file “php.ini
  • Before PHP version 7, PHP  also supported ASP tags <%, %>, ASP short open tag for <%=, and the script tag <script language="php"> which  has been removed from PHP version 7.
  • If  a PHP file have only PHP codes inside the file  then it is preferable to omit the PHP closing tag ?> at the end of the a PHP file.
  • Example of PHP Tag
  • 1
    2
    3
    4
    5
    <?php // Start PHP Tag
     echo "PHP is easy to learn !!";
     echo "PHP code is executed on web server !!";
    
     // End PHP Tag ?> 
    

  • Output of above PHP code:
    PHP is easy to learn !!PHP code is executed on web server !!

# Good book on PHP:



PHP for the Web: Visual QuickStart Guide (5th Edition)

26 August 2018

What are the Functionalities of PHP?

PHP is a powerful programming language which can be used to develop almost any kind of websites. Some most popular php functionalities are given bellow:

  • PHP is widely used to make dynamic web pages within very short time.
  • Send & Receive Email with PHP is very easy.
  • PHP can quickly Generate, Read, Write, Delete, Open and Close any files on the web servers.
  • PHP is perfect language to work with data Select, Insert, Delete, Update records in database.
  • PHP can be used to collect data from registration form, Login from etc forms.
  • PHP can Send and Receive cookies data stored on client machine.
  • PHP can store session data on servers.
  • PHP can be used to Control user-access on websites.
  • PHP can Encrypt data securely.
  • PHP can Compress files.
  • PHP can be used to Resize & photo enhancement. 
  • PHP can easily create PDF files ,XML Files, Flash files etc for websites.

Why should you learn PHP?



  1. PHP is easy to learn.
  2. PHP Web developer has huge demand in Job Market.
  3. PHP runs on various platforms like Windows, Linux, Unix, Mac OS etc.
  4. PHP supports a wide range of databases like Oracle, MySql, PostgreSQL, MongoDB etc
  5. PHP is free.You can download PHP from the official PHP websites: www.php.net
  6. PHP is a widely-used open source scripting language
  7. PHP is used to make Facebook, Wordpress, Yahoo etc websites.
  8. PHP is the best language which should be know by all web developers.
Head First PHP & MySQL: A Brain-Friendly Guide

What is PHP?


  • PHP stands for "PHP Hypertext Preprocessor" 
  • PHP is a widely-used general-purpose scripting open source scripting language.
  • PHP is especially used for web development and PHP can be embedded into HTML.
  • PHP scripts are executed on the web server.
  • A PHP script starts with start tag "<?php" and ends with end tag "?>" 
  • PHP files have extension ".php". Example of some php files can be index.php, about.php, home.php, contact.php
  • PHP is a powerful programming language which has been used to create Facebook, Wordpress, Yahoo etc websites.
  • Sample PHP Code:
  •  1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    <html>
        <head>
            <title>Example</title>
        </head>
        <body>
    
            <?php
                echo "Hello World!";
            ?>
    
        </body>
    </html> 
    

  • Output of the above PHP Code:
    Hello World!

Beginning PHP and MySQL: From Novice to Professional

07 November 2017

What is SEO (Search Engine Optimization)


  • SEO stands for "Search engine optimization".  
  • All major search engines such as Google, Bing and Yahoo have paid and unpaid search results.  
  • SEO  is the process of getting more visitor to a website from  search engine's  Unpaid, natural, organic results. 
  • SEO professionals do On Page SEO and Off Page SEO to get more visitors to a website from Search Engine results.

The Art of SEO: Mastering Search Engine Optimization

07 September 2017

Difference between HTML and HTML5



  • Hypertext Markup Language (HTML) is the standard markup language for creating web pages and web applications.
  • HTML5 is the W3C Recommendation which adds more powerful features such as header,footer,canvas,audio and video tag support. 
  • Every website is created with HTML and not all modern website is developed with html5 standard.
  • If you know HTML very well then  you can create any Web sites.
  • HTML is very easy to learn.
  • As html5 is the latest version of html,so definitely html5 is better than html. 
  • By following this HTML tutorial series, you will be an expert on HTML.
    Example of popular websites are news website, search engine , video, email, social, sports, social network, games etc    
  • Example HTML5 Code
  •  1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    <!DOCTYPE html>
    <html>
      <head>
        <title>Website Title</title>
      </head>
      <body>
      <h1>HTML TUTORAIL</h1>
        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p>
     <h1>What is Lorem Ipsum?</h1>
        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p>
     <h1>What is Lorem Ipsum?</h1>
        <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p>
      </body>
    </html>
    
  • Output of the above HTML Code:
  • HTML TUTORAIL

    Lorem Ipsum is simply dummy text of the printing and typesetting industry.

    What is Lorem Ipsum?

    Lorem Ipsum is simply dummy text of the printing and typesetting industry.

    What is Lorem Ipsum?

    Lorem Ipsum is simply dummy text of the printing and typesetting industry.

Murach's HTML5 and CSS3, 4th Edition

Featured Post

How to Write PHP code and HTML code within a same file

A PHP file can have both PHP code and HTML code together. Any HTML code written outside of PHP <?php //php code here… ?> Code is ig...

Popular Posts