Showing posts with label web programming. Show all posts
Showing posts with label web programming. Show all posts

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

12 September 2015

How to redirect your website from HTTP to HTTPS on Apache HTTP Web Server


HTTP to HTTPS
  • You can automatically redirect your website visitor from http://www.yourwebsite.com  to https://www.yourwebsite.com  in various ways. 
  • This blog post will show you how to redirect your website from http to https using a simple .htaccess file saved on your web server.
  • Step 1: Install & configure mod_ssl on your Apache HTTP Server.
  • Step 2: Enable the mod_rewrite modules by editing the ‘httpd.conf’ apache configuration file.
  • Step 3: create an ‘.htaccess’ file and write the following code on that .htaccess file & save the file on your web server document root directory.   
  
 RewriteEngine On
 RewriteCond %{HTTPS} off
 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Pro Apache (Expert's Voice)

26 February 2015

WordPress theme & plugins installation “Download failed” problem solved

  • If you are getting an error message while tried to install any WordPress theme or plug-ins from wordpress admin panel. If the error message says “Download failed. There are no HTTP transports available which can complete the requested request.”. Then this post might help you. 

  • Step1:  You have to edit your php.ini file, so find the php.ini file & open it with notepad.
php.ini


  • Step2: Find “php_curl” extension on the php.ini file
php.ini


  • Step3: After finding, now enable the php_curl extension by removing the semicolon (;) 
php.ini


  • Step4: save the php.ini file & close it
  • Step5: Restart the apache service.
  • Step6: It’s done. 
  • Now you can download any wordpress themes & plugins from wordpress admin panel.




WordPress All-in-One For Dummies

04 February 2014

Write your first "Hello World" Program in Visual C#


If you are new to C# programming language, then this blog post will help you to write your first C# program. I used "Microsoft Visual Studio 2010" to write this first "Hello World" program.

So,Installed the "Microsoft Visual Studio" on your PC and follow the step by step instruction given bellow:

Step 1: Start Visual Studio 2010

Start Visual Studio 2010
Start Visual Studio 2010

Step 2:. Click on New Project or Ctrl+Shift+N to create new project


Step 3: Click on Console Application. You may change the Name, Location and Solution Name

C# Console application
C# Console application


Step 4: Write the code inside the main function.

   Console.WriteLine("Hello World ! My first C# program.");

Hello World programming code in C#
Hello World programming code in C#

Step 5:. You first C# program is done.

Step 6:. Now run to program to see the output.
Click Debug ->Start without debugging or press ctrl+F5

Step 7:. The result will be show on a dos screen:

C# Hello World programming  output
C# Hello World programming  output

Step 8:. Enjoy programming with C#. Now you may write as may text as you want using the C# programming language. Head First C: A Learner's Guide to Real-World Programming with C#, XAML, and .NET

30 December 2013

Solution of Font size problem on different browser

  • Most of the web developers are facing problem with font size on different browser especially on old version of internet explorer.
    different browser
  •  If you are facing font size problem on different browser then this blog post might help you. 
  • Step1: Edit your css code & add the following code:
     Font size problem
  body {font-size:100%;}

  • Step2: Use Em instead of pixel (px) on your css file to specify the font-size value. 1em=16px, To calculate the em value of any pixel, divide the pixel value by 16 . 
  • Example:
p {font-size:1em;}
h1 {font-size:3.125 em;} /* 50px/16=3.125em */
#content {font-size:1.25em;} /* 20px/16=1.25em */
  • Step3. Done. Now your website text will display same on all browsers.
CSS: The Missing Manual

03 October 2013

What types of applications you can build in C#.NET ?

C#.NET language can be used to develop four types of applications, these are:
  1. Console applications
  2. Windows applications
  3. ASP.NET Web applications
  4. Web services
  1. Console applications: A console application runs in a console window (ie.MS DOS) which provides simple text-based output.
  2. Windows applications: A Windows application runs on a computer desktop. Windows applications such as MS-Word and Excel, Calculator, Paint etc are example of windows application.
  3. ASP.NET applications: ASP.NET applications are developed to run on a web server which is accessible through browsers. ASP.NET technology facilitates the budding of web applications quickly and easily. Dynamic websites like http://www.microsoft.com are good example of ASP.NET applications.
    Web services
  4. Web services:Web services are complex applications that can provide services such as current weather update, product stock status, converts the temperature from Fahrenheit to Celsius and many more.
C in Depth

What is the .NET Framework ?

  • The (dot net) .NET Framework is a software framework developed by Microsoft. It has a huge number of class libraries which provides:
    .NET Framework
  • User interface, which is used to design for software interface,
  • Database connectivity, used to connect with database
  • Cryptography, used to ensure software security,
  • Web application development, 
  • Network communications and many more facilities on software development.
  • C#, VB, J# etc are the programming language used by software developer with the combination of .NET framework to developed software application.

  • The software applications developed with the dot net framework mainly runs on Microsoft Windows OS. 

  • The most important components of the .NET framework are:
  • CLR (Common Language Runtime), which allows us to compile and execute program.
  • FCL (Framework Class Library), which has a large number of predefined types or classes to use in software development.

C 6.0 and the .NET 4.6 Framework

30 September 2013

What are the difference between echo() and print() in PHP ?

  • To better understand the difference, you have to know the syntax with example of echo() and print(). Syntax of echo() :
void echo ( string $arg1 [, string $... ] )

  • Example of echo():
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
<?php

    echo ("The quick brown fox.");

    echo "The quick brown fox.";

    $dept_name="HR";

    echo "My department name is :$dept_name";

    echo"<p>

    Another message 1 Another message 2

    Another message 3

    </p>";

    ?>

  • Syntax of print()
int print ( string $arg )

  • Example of print():
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
    <?php

    print("The quick brown fox.");

    print "The quick brown fox.";

    $dept_name="HR";

    print "My department name is :$dept_name";

    print"<p>

    Another message 1 Another message 2

    Another message 3

    </p>";

    ?>

  • echo() is used to output one or more strings print() is used to output a string. 
  • Both echo() and print() are not actually a real function, it is a language construct. 
  • So you are not required to use parentheses with its argument list. 
  • echo() can take more than one parameter when used without parentheses. 
  • print() only takes one parameter. 
  • echo() is not a real function ,so it does not return any value. Though print() is also not a real function, but it will always returns 1. 
  • echo() has a shortcut syntax, this short syntax only works if the short_open_tag configuration setting on php.ini is enabled. 
  • Example of short_open_tag:
1
2
3
4
5
6
7
<?php

    $blog_address="http://shafiq2410.wordpress.com/";

    ?>

    <p>My Blog address is: <a href="<?=$blog_address?>" target="_blank"><?=$blog_address?></a></p>

PHP & MySQL: Novice to Ninja: Get Up to Speed With PHP the Easy Way

How to Comment your code in PHP?

  • PHP supports 'C', 'C++' and Unix shell-style (Perl style) comments. 
  • You may use any style based on your requirements. 
  • Single-Line code comments use C++ Syntax 
  • Multiple-Line code comments use C Syntax 
  • Unix Shell Syntax (Perl Style) is also used for single line comments 
  • Example: Single-Line C++ Syntax
1
2
3
4
5
6
7
 <?php

        // Title: My first PHP code

          echo "This is a PHP program.";

    ?>
  • Example: Unix Shell Syntax
1
2
3
4
5
6
7
 <?php

       # Title: My first PHP code

          echo "This is a PHP program.";

    ?>
  • Example: Multiple-Line C Syntax
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
<?php

    /*

    Title: Test Code

    Author: shafiq

    Author URL: http://shafiq2410.wordpress.com

    Email: shafiq2410@gmail.com

    */

    echo "This is a PHP program.";

    ?>
PHP Cookbook: Solutions & Examples for PHP Programmers

29 September 2013

How does code is separated in PHP?

  • PHP requires instructions to be terminated with a semicolon at the end of each statement. 
  • The closing tag (?>) of a block of PHP code automatically implies a semicolon(;) 
  • (Ref-Example 2), so you do not need to have a semicolon terminating the last line of a PHP block.
  • Example 1:
1
2
3
4
5
6
7
<?php

        echo 'This is a test';

        echo 'This is another test';

    ?>
  • Example 2:
1
<?php echo 'This is a test' ?>
  • Example 3:
1
<?php echo 'We omitted the last closing tag'; 
  • Note: The closing tag of a PHP block at the end of a file is optional and in some cases omitting it is helpful when using include() or require(), 
  • So unwanted white space will not occur at the end of files, and you will still be able to add headers to the response later.
Learning PHP, MySQL & JavaScript: With jQuery, CSS & HTML5 (Learning PHP, MYSQL, Javascript, CSS & HTML5)

What are the Syntax of PHP programming language

  • When PHP parses a file, it looks for opening PHP tag "<?php or <?" and ending php tag " ?>" which tell PHP to start and stop interpreting the code between them. 
  • Everything outside of a pair of opening and closing tags is ignored by the PHP parser. Example:
1
2
3
4
5
 <p>This is going to be ignored by PHP Parser.</p>

        <?php echo 'While this is going to be parsed.'; ?>

    <p>This will also be ignored by PHP parser.</p>
  • PHP code must have a semicolon ";" at the end of each statement.
  • The closing PHP tag "?>" automatically insert a semicolon.
  • Example:
  • 1
    2
    3
    4
    5
    6
    7
    <?php
        echo 'PHP is Fun to learn !!';
    ?>
    <br>
    <?php  echo 'PHP automatically insert a semicolon at the last closing tag' ?>
    <br>
    <?php echo 'If a PHP file have only PHP code than the last closing tag can be omitted';
    
  • Example Advanced escaping
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

        if ($expression) {

        ?>

        <strong>This is true.</strong>

        <?php

        } else {

        ?>

        <strong>This is false.</strong>

        <?php

        }

        ?> 
  • Before PHP version 7 There were four different pairs of opening and closing tags which could be used in PHP. Standard tag is always available Example: Script tag is also always available Example:
1
2
3
<script language="php">echo 'some editors (like FrontPage) don\'t like processing instructions';

            </script>
  • Short tags can be turned on and off from the php.ini configuration file. Example:
1
<?= expression ?>
  • This is a shortcut for
1
<? echo expression ?>
  • ASP style tags can be turned on and off from the php.ini configuration file Example:
1
<% echo 'You may optionally use ASP-style tags'; %><%= $variable; # This is a shortcut for "<% echo . . ." %>

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

01 September 2013

Difference between the break and continue in programming language


BREAK
Break
 The break statement will terminate iteration of the loop and continue executing if there is any code that follows after the loop. Example of Break statement in JavaScript:


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
<script>

x=0;

for(x=0;x<10;x++)
{
if(x==3)
{
break;    
}
document.writeln("x=" + x + "<br />");

}


</script>
Output: x=0 x=1 x=2

Continue
Continue

The continue statement will terminate the current execution of loop and resume the loop with the next value if any. Example of Continue statement in JavaScript:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<script>

xx=0;

for(xx=0;xx<5;xx++)
{
if(xx==3) 
{
continue;
}
document.writeln("xx=" + xx + "<br />");
}

</script>
Output: xx=0 xx=1 xx=2 xx=4
Beginning Programming All-In-One Desk Reference For Dummies

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