wordpress hello word plugin tutorial

This blog is dedicated for wordpress beginner. I am trying to write this blog with ease so that even if you are new for wordpress you can create wordpress hello word plugin tutorial. Lets move on the topic on how to create hello word wordpress plugin, follow the quick and easy steps mentioned bellow. Presuming that the you have already installed wordpress on your machine.

3 easy steps to create helloworld module in wordpress.

Step 1: Create folder inside the plugin folder.
Go to the plugins folder and create folder “helloworld”.
wordpresswp-contentpluginshelloworld

Step 2: Now create new php file inside helloworld folder and name it to “helloword.php”. copy the source code mentioned bellow to the file. change the

view plaincopy to clipboardprint?

  1. /* 
  2. Plugin Name: Hello World 
  3. Plugin URI: http://www.phptechi.com 
  4. Description: A simple Hello Word Plugin 
  5. Version: 0.1 
  6. Author: Sunil Rajput 
  7. Author URI: http://www.phptechi.com 
  8. */  
  9. function hello_world() {  
  10. 10.     Print(“Hello World Test message.”);  

11. }  

Step 3: Now go to the wordpress admin panel > plugins and click on “activate” like of helloworld plugin. Now go to the current theme index.php, edit it and add following code just bellow the “get_header” function.

view plaincopy to clipboardprint?

  1. if(function_exists(“hello_world”)) {  
  2.     hello_world();  
  3. }  

now refresh your home page. It will show the message on your home page just bellow the header section.

Share this nice post:

Standard

Difference between php and html

  • HTML is a language used to describe to a browser how to display text and other objects in a browser window. It is not a programming language. HTML works on a client computer (the system on which the page is being viewed). 
  • PHP is a scripting language, and can be used to create web pages written in HTML. PHP runs on the server (the system from which the page comes), and is a full-fledged programming language.
  • That question doesn’t exactly make sense. Langauges do not need ‘protection.’ The manner in which they are used can sometimes cause problems for the system on which they run, but that will in no way hurt the language itself.

    The HTML of any web page can be viewed by right-clicking in a web page; the HTML created by PHP can be viewed by right clicking in a web page. PHP does nothing to prevent your HTML from being viewed. Once the HTML is on my computer, there is nothing that you can do to protect it from being viewed by someone that wants to see it.

  • PHP files are just like HTML files, but they can include both HTML and PHP code. The PHP code is parsed (or executed) by the Web server when the page is accessed and the resulting output is written as HTML within the Web page. When a user accesses a PHP page, his Web browser only gets sent the HTML code, since the Web server has processed the PHP code in the background. Most PHP pages are processed so quickly that it does not noticeably slow down the loading of the Web page.

    The .php extension is important, since it tells the Web server that the page may include PHP code. Therefore, it must be run through the server’s PHP engine before being sent to a client’s Web browser. This allows dynamic content to be generated each time the Web page is loaded, based on the variables included in the PHP code. For example, PHP pages may load objects such as the current date and time, data from form fields submitted by a user, or information from a database. Still, once the page reaches the user’s Web browser, everything is formatted as HTML.

Standard

Difference between session and cookie in php……

1->The main difference being that session data is stored on the server, while cookie data is stored on the client. Therefore, a client can easily modify the cookie contents, but will have to work way harder to modify the session contents.

2->Cookies are a means to store information in the end-user’s browser, so that the server can track the end-user.

Sessions are also implemented by using cookies, but the actual data is not in the browser; rather, it is stored in the user’s session record on the server. In the case of sessions, cookies are used to identify a particular end-user’s session identifier on the server records. Hence, they are a more secure way of storing user information.

3->A cookie is a ~piece of data stored on the client side. Data stored in session is stored on the server side, and the various sessions are identified by cookies.

4->A cookie is often used to identify a user. A cookie is a small file that the server embeds on the user’s computer. Each time the same computer requests a page with a browser, it will send the cookie too.

A session variable is used to store information about, or change settings for a user session. Session variables hold information about one single user, and are available to all pages in one application.

5->A cookie is an unique information that the user sends to the web server with each request in order to identify him. This unique id could be used to store information about this specific user on the server (session).

6->There are session and Cookies, both are used to store values or data. But there are some key differences between session and cookie: a cookie stores the data in your browser and a session is stored on the server. Cookie data is available in your browser up to expiration date and session data available for the browser run, after closing the browser we will lose the session information.

7->

Cookies will only expire on expiry time or if you explicitly clean cookie / cache of your browser. Cookies will retain into the system even after you open your browser next day. Cookies are stored on client’s system so they are less secure.

Session will expire on its expiry time or if the browser has been closed. As session is stored on server so it is more secure.

So for a login module, a combination of session and cookie should be used

 

Standard