PHP Assignment
PHP Assignment
Session - 2022-23
Web Development
Using ‘PHP’
Assignment
File
Questions
1. What is PHP and write the syntax of PHP?
2. What is the difference between Echo and Print statement in PHP?
3. What is variable and type of variable in PHP with example?
1
Developed by Chitvan Kumar
4. What is Ajax and how its work?
5. What are the difference between while and do while loop?
6. What is Wordpress and explain different types of menus’.
7. Write the code to create connection using PHP with mysqli?
8. What are the difference between session and cookies?
9. Write the program in PHP to addition of any two numbers?
10. What is operator In PHP and explain any two operators with example?
11. Write the steps how to execute PHP program with XAMP server in CMD.
12. Write the steps how to execute PHP program using WAMP server.
13. Write the steps to set the permanent path to execute program in cmd.
14. Design the Student Registration page (Student Name, Mobile Number, Email id) using
HTML and CSS.
15. What is Control statement in PHP, explain with example?
16. Write the SQL Query to create database and Insert data into table using mysqli with PHP.
17. Explain synchronous and asynchronous in Ajax.
18. What is loop and explain any one loop with example?
19. Write the steps how to installation Wordpress.
20. What is plugin and how to use in Wordprss frame work?
21. How to use Categories in Wordpress frame work and explain all categories?
22. How to use Post in Wordpress?
23. How to use pages, blogs in Wordpress?
24. What is Media and how to use in Wordpress frame work?
25. To create table in database using Q.No-5 and perform all operations using mysqli with
PHP.
Answers
Ans 1: PHP
2
Developed by Chitvan Kumar
PHP is a server side scripting language that is used to develop Static websites or
Dynamic websites or Web applications. PHP stands for Hypertext Pre-processor, that earlier
stood for Personal Home Pages. PHP is an open source, server side general scripting language
that has now become a defact coding standard in the web development industry PHP runs on
different operating system such as Windows, Linux, Illnix and support different databases
MySQL, MS Access, Oracle.
Syntax Of PHP –
A PHP script can be placed anywhere in the document. A PHP script starts with <?php and ends
with ?>.
The default with file extension of PHP file is “.php”. A PHP file normally contain some HTML
tag and some PHP scripting code.
<?php
\\ PHP Code
?>
We frequently use the echo statement to display the output. There are two basic ways to get the
output in PHP:
3
Developed by Chitvan Kumar
o echo
o print
echo and print are language constructs, and they never behave like a function. Therefore, there is
no requirement for parentheses. However, both the statements can be used with or without
parentheses. We can use these statements to output variables or strings.
echo:
print:
o print is also a statement, used as an alternative to echo at many times to display the
output.
o print can be used with or without parentheses.
o print always returns an integer value, which is 1.
o Using print, we cannot pass multiple arguments.
o print is slower than echo statement.
o Example:
4
Developed by Chitvan Kumar
Code:-
<?php
$fname = "Chitvan";
$lname = "Kumar";
print "My name is: ".$fname,$lname;
?>
Output:-
Ans 3: Variables
Variables in a program are used to store some values or data that can be used later in a
program. The variables are also like containers that store character values, numeric values,
memory addresses, and strings. PHP has its own way of declaring and storing variables.
There are a few rules, that need to be followed and facts that need to be kept in mind while
dealing with variables in PHP:
Any variables declared in PHP must begin with a dollar sign ($), followed by the
variable name.
A variable can have long descriptive names (like $factorial, $even_nos) or short names
(like $n or $f or $x).
A variable name can only contain alphanumeric characters and underscores (i.e., ‘a-z’,
‘A-Z’, ‘0-9, and ‘_’) in their name. Even it cannot start with a number.
A constant is used as a variable for a simple value that cannot be changed. It is also
case-sensitive.
Assignment of variables is done with the assignment operator, “equal to (=)”. The
variable names are on the left of equal and the expression or values are to the right of
the assignment operator ‘=’.
One must keep in mind that variable names in PHP names must start with a letter or
underscore and no numbers.
PHP is a loosely typed language, and we do not require to declare the data types of
variables, rather PHP assumes it automatically by analyzing the values. The same
happens while conversion. No variables are declared before they are used. It
automatically converts types from one type to another whenever required.
PHP variables are case-sensitive, i.e., $sum and $SUM are treated differently.
Example-
x= 50;
y=12-5;
z=”Hello World”;
Types Of Variables –
Scope of a variable is defined as its extent in a program within which it can be
accessed, i.e. the scope of a variable is the portion of the program within which
5
Developed by Chitvan Kumar
it is visible or can be accessed.
Depending on the scopes, PHP has three variable scopes:
1. Local variables:
The variables declared within a function are called local variables to that
function and have their scope only in that particular function. In simple words, it
cannot be accessed outside that function.
Example-
<?php
$num = 60;
function local() {
$num = 50;
}
local();
?>
OUTPUT-
2. Global variables :
The variables declared outside a function are called global variables.
These variables can be accessed directly outside a function.
Example-
<?php
$num = 20;
function global_fun() {
global $num;
echo "Variable Number Inside Function Is: $num\n";
}
global_fun();
echo "Variable Number Outside Function Is: $num\n";
?>
6
Developed by Chitvan Kumar
OUTPUT-
Ans 4: AJAX
AJAX stands for Asynchronous JavaScript and XML. AJAX is a new technique
for creating better, faster, and more interactive web applications with the help of XML,
HTML, CSS, and Java Script.
Ajax uses XHTML for content, CSS for presentation, along with Document
Object Model and JavaScript for dynamic content display.
Conventional web applications transmit information to and from the sever using
synchronous requests. It means you fill out a form, hit submit, and get directed to
a new page with new information from the server.
With AJAX, when you hit submit, JavaScript will make a request to the server,
interpret the results, and update the current screen. In the purest sense, the user
would never know that anything was even transmitted to the server.
XML is commonly used as the format for receiving server data, although any
format, including plain text, can be used.
AJAX is a web browser technology independent of web server software.
A user can continue to use the application while the client program requests
information from the server in the background.
Intuitive and natural user interaction. Clicking is not required, mouse movement is
a sufficient event trigger.
Data-driven as opposed to page-driven.
How Does AJAX Work?
AJAX communicates with the server using XMLHttpRequest object. Let's try to
understand the flow of ajax or how ajax works by the image displayed below.
7
Developed by Chitvan Kumar
1. User sends a request from the UI and a javascript call goes to XMLHttpRequest
object.
2. HTTP Request is sent to the server by XMLHttpRequest object.
3. Server interacts with the database using JSP, PHP, Servlet, ASP.net etc.
4. Data is retrieved.
5. Server sends XML data or JSON data to the XMLHttpRequest callback function.
6. HTML and CSS data is displayed on the browser.
______________________________________________________________________________
PHP do-while loop can be used to traverse set of code like php while loop. The
PHP do-while loop is guaranteed to run at least once.
The PHP do-while loop is used to execute a set of code of the program several
times. If you have to execute the loop at least once and the number of iterations is not
even fixed, it is recommended to use the do-while loop.
It executes the code at least one time always because the condition is checked
after executing the code.
The do-while loop is very much similar to the while loop except the condition
check. The main difference between both loops is that while loop checks the condition at
the beginning, whereas do-while loop checks the condition at the end of the loop.
8
Developed by Chitvan Kumar
Flow Chart:
Example:
<?php
$n=1;
do{
echo "$n<br/>";
$n++;
}while($n<=10);
?>
Output:
PHP while loop can be used to traverse set of code like for loop. The while loop
executes a block of code repeatedly until the condition is FALSE. Once the condition
gets FALSE, it exits from the body of loop.
9
Developed by Chitvan Kumar
The while loop is also called an Entry control loop because the condition is
checked before entering the loop body. This means that first the condition is checked. If
the condition is true, the block of code will be executed.
Flow Chart:
Example:
<?php
$n=1;
while($n<=10){
echo "$n<br/>";
$n++;
}
?>
10
Developed by Chitvan Kumar
It is considered as the easiest and most popular CMS tool due to its features. The
main feature of WordPress is its versatility and feasibility to use. There is no use of
coding and designing skills for creating a website on this. Even a non-technical person
can also create a website with the help of WordPress easily.
There are various customization Menu items available; some of them are as
follows:
Navigation Label.
Title Attribute.
Link Target.
Link Relationship.
CSS Classes.
Original
Navigation Label
This field defines the title of the item on our custom menu. Our visitors will
see this when they visit our site or blog.
Title Attribute
This field defines the alternative text ('Alt') for the menu item. This text will
be shown when the user's mouse is hovering over the menu item.
Link Target
Link Relationship
CSS Classes
11
Developed by Chitvan Kumar
It provides the optional CSS classes to the menu item.
Original
It provides a link to the source of the menu item that helps us to see the page or post.
1. $host
Optional − The host name running the database server. If not specified,
then the default value will be localhost:3306.
2. $username
Optional − The username accessing the database. If not specified, then
the default will be the name of the user that owns the server process.
3. $passwd
Optional − The password of the user accessing the database. If not
specified, then the default will be an empty password.
4. $dbName
Optional − database name on which query is to be performed.
5. $port
Optional − the port number to attempt to connect to the MySQL server..
6. $socket
Optional − socket or named pipe that should be used.
______________________________________________________________________________
Syntax -
12
Developed by Chitvan Kumar
$mysqli = new mysqli($host, $username, $passwd, $dbName, $port, $socket);
Example-
<html>
<head>
<title>Connection To MySQL Server</title>
</head>
<body>
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';
$mysqli = new mysqli($dbhost, $dbuser, $dbpass);
printf('Connection successfully.<br>');
$mysqli->close();
?>
</body>
</html>
OUTPUT-
COOKIES SESSIONS
Cookies are client-side files on a local Sessions are server-side files that contain
computer that hold user information. user data.
Cookies end on the lifetime set by the When the user quits the browser or logs
user. out of the programmed, the session is
over.
It can only store a certain amount of info. It can hold an indefinite quantity of data.
13
Developed by Chitvan Kumar
The browser’s cookies have a maximum We can keep as much data as we like
capacity of 4 KB. within a session, however there is a
maximum memory restriction of 128 MB
that a script may consume at one time.
Because cookies are kept on the local To begin the session, we must use the
computer, we don’t need to run a function session start() method.
to start them.
Cookies are not secured. Session are more secured compare than
cookies.
Cookies stored data in text file. Session save data in encrypted form.
In PHP, to get the data from Cookies , In PHP , to set the data from Session,
$_COOKIES the global variable is used $_SESSION the global variable is used
We can set an expiration date to delete the In PHP, to destroy or remove the data
cookie’s data. It will automatically delete stored within a session, we can use the
the data at that specific time. session_destroy() function, and to unset a
specific variable, we can use the unset()
function.
Cookies are client-side files that are stored Sessions are server-side files that store
on a local computer and contain user user information.
information.
Cookies expire after the user specified The session ends when the user closes the
lifetime. browser or logs out of the program.
It can only store a limited amount of data. It is able to store an unlimited amount of
information.
Cookies can only store up to a maximum There is a maximum memory restriction
of 4 KB of data in a browser. of 128 megabytes that a script may
consume at one time. However, we are
free to maintain as much data as we like
within a session.
14
Developed by Chitvan Kumar
Cookies are used to store information in a The data is saved in an encrypted format
text file. during sessions.
Cookies are stored on a limited amount of A session can store an unlimited amount
data. of data.
Output:
15
Developed by Chitvan Kumar
________________________________________________________________________
o Arithmetic Operators
o Assignment Operators
o Bitwise Operators
o Comparison Operators
o Incrementing/Decrementing Operators
o Logical Operators
o Arithmetic Operators
The PHP arithmetic operators are used to perform common arithmetic operations
such as addition, subtraction, etc. with numeric values.
16
Developed by Chitvan Kumar
/ Division $a / $b Quotient of operands
Example:
<?php
$x = 10;
$y = 5;
echo ($x+$y),"<br>";
echo ($x-$y),"<br>";
echo ($x*$y),"<br>";
echo ($x/$y),"<br>";
echo ($x%$y),"<br>";
?>
Output:
Assignment Operators
The assignment operators are used to assign value to different variables. The basic
assignment operator is "=".
17
Developed by Chitvan Kumar
Assign
Example:
<html>
<head></head>
<body>
<?php
$x = 10;
echo $x;
?><br><?php
$x += 100;
echo $x;
?><br><?php
$x -= 30;
echo $x;
?><br><?php
$x *= 6;
echo $x;
?><br><?php
$x /= 5;
echo $x;
?><br><?php
$x %= 4;
echo $x;
?>
</body>
</html>
Output:
18
Developed by Chitvan Kumar
Ans 11: PHP Installation for Windows Users
Follow the steps to install PHP on the Windows operating system.
Step 1: First, we have to download PHP from it’s website. We have to
download the .zip file from the respective section depending upon on our system
architecture(x86 or x64).
Step 2: Extract the .zip file to your preferred location. It is recommended to
choose the Boot Drive(C Drive) inside a folder named php (ie. C:\php).
Step 3: Now we have to add the folder (C:\php) to the Environment Variable
Path so that it becomes accessible from the command line.
o To do so, we have to right click on My Computer or This PC icon, then
Choose Properties from the context menu.
o Then click the Advanced system settings link, and then click
Environment Variables.
o In the section System Variables, we have to find the PATH environment
variable and then select and Edit it.
o If the PATH environment variable does not exist, we have to click New.
In the Edit System Variable (or New System Variable) window, we have
to specify the value of the PATH environment variable (C:\php or the
location of our extracted php files).
o After that, we have to click OK and close all remaining windows by
clicking OK.
19
Developed by Chitvan Kumar
After installation of PHP, we are ready to run PHP code through command line.
You just follow the steps to run PHP program using command line.
Open terminal or command line window.
Goto the specified folder or directory where php files are present.
php file_name.php
After start the Wampserver show the wampserver icon on taskbar near to clock
icon at right bottom of windows screen.
Below menu you can Start All Services and Stop All Services of wampserver.
There is a top most option “Localhost”, which shows the server configuration.
20
Developed by Chitvan Kumar
Here, the “www directory” option define the path where we can save the PHP
file.
The default location path is “C:\wamp\www“.
We must save all PHP page at in “www” folder.
PHP Installation for Windows Users: Follow the steps to install PHP on the
Windows operating system.
Step 1: First, we have to download PHP from it’s official website . We have to
download the .zip file from the respective section depending upon on our system
architecture(x86 or x64).
21
Developed by Chitvan Kumar
Step 2: Extract the .zip file to your preferred location. It is recommended to choose
the Boot Drive(C Drive) inside a folder named php (ie. C:\php).
Step 3:
Open control panel
Go to System
Choose the Properties tab
Click Environment variables.
From this screen you can edit the environment variables of the system. If you only
wish to modify them on your user account, click New under your own variables box and
type in the following:
Variable name: Path
Variable value: %PATH%;C:\path\to\php
If you want the change to affect all users on the system, choose the Path variable
from the system variables box and click Edit.
Append the variable value with:
;C:\path\to\php
Note the ; character. It’s used to separate directories in the var, so be sure it’s
present.
Again, C:\path\to\php is where your php.exe is located.
Now, we should have the php executable available in command line.
____________________________________________________________________________
22
Developed by Chitvan Kumar
<label> Student Name: </label>
<input type="text" name="student" size="20" placeholder="Ex.
Chitvan"><br><br>
<label> Mobile No.: </label>
<input type="number" name="student" size="20" placeholder="Ex. 1234567890"><br><br>
<label> E-mail: </label>
<input type="email" name="student" size="20" placeholder="Ex. abc@gmail.com"><br><br>
<button>Submit</button>
</form>
</body>
</html>
Output:
23
Developed by Chitvan Kumar
Example:
<?php
$a = 16;
$b = 12;
If($a>$b)
echo “A is greater than 0”;
?>
Output:
If…else Statement:
else…if, as its name suggests, is a combination of if and else. Like else, it
extends an if statement to execute a different statement in case the original if
expression evaluates to FALSE.
Syntax :
if (condition)
//code to be executed if condition is true;
else
//code to be executed if condition is false;
Example:
<?php
$a = 10;
$b = 20;
if($a>$b)
echo "a is greater than b";
else
echo "b is greater than a";
?>
Output:
24
Developed by Chitvan Kumar
if…elseif….else Statement
Use the if….elseif…else statement to select one of several blocks of code to be
executed.
Syntax :
if (condition)
//code to be executed if condition is true;
elseif (condition)
//code to be executed if condition is true;
else
//code to be executed if condition is false;
Example:
<?php
$a = 10;
$b = 20;
if($a>$b)
echo "a is greater than b";
elseif($a<$b)
echo "b is greater than a";
else
echo "a equals b";
?>
Output:
Switch Statement
25
Developed by Chitvan Kumar
The switch statement is similar to IF statements on the same expression. In many
occasions, you may want to compare the same variable (or expression) with many
different values, and execute a different piece of code depending on which value it
equals to.
Syntax :
switch ( ) {
case condition1
break;
case condition2
break;
}
Example:
<?php
$i = 5;
switch($i) {
case 0:
echo "i equals 0";
case 1:
echo "i equals 1";
case 2:
echo "i equals 2";
default:
echo "Not Valid";
}
?>
Output:
26
Developed by Chitvan Kumar
$dbname = "myDB";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "INSERT INTO student (firstname, lastname, email)
VALUES ('Pragati', 'Sharma', 'pragatisharma30@example.com'),
('Chitvan','Kumar','chitvan@gmail.com'),
('Mukul','Kumar','mk@gmail.com'),
('Arshita','Kumari','arshita@gmail.com')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
______________________________________________________________________________
A synchronous request blocks the client until operation completes i.e. browser is
unresponsive. In such case, javascript engine of the browser is blocked.
Synchronous AJAX is a process that makes a java script to halt or stop the
processing an application until a result is sent by a server. The browser is frozen, while
the request is processed. The response time is 99.99% quick and fast enough.
27
Developed by Chitvan Kumar
As we can see in the above image, full page is refreshed at request time and user
is blocked until request completes. In case of intrusion for a request or transfer of the file,
the browser freezes may be for two minutes until the time is out for the request.
As we can see in the above image, full page is not refreshed at request time and
user gets response from the ajax engine.
28
Developed by Chitvan Kumar
Ans 18: Loop
Often when you write code, you want the same block of code to run over and over
again a certain number of times. So, instead of adding several almost equal code-lines in
a script, we can use loops.
Loops are used to execute the same block of code again and again, as long as a
certain condition is true.
while - loops through a block of code as long as the specified condition is true
do...while - loops through a block of code once, and then repeats the loop as
long as the specified condition is true
for - loops through a block of code a specified number of times
foreach - loops through a block of code for each element in an array
The PHP foreach Loop
The foreach loop works only on arrays, and is used to loop through each
key/value pair in an array.
Syntax
foreach ($array as $value) {
code to be executed;
}
For every loop iteration, the value of the current array element is assigned to
$value and the array pointer is moved by one, until it reaches the last array
element.
Code:
<?php
29
Developed by Chitvan Kumar
Output:
There are three available options for uploading WordPress to your hosting
account. When you unzipped the file in Step 1, you were left with a folder
named wordpress, and the contents need to be uploaded to your hosting account's file
manager. You can accomplish this one of three ways:
Upload via FTP - See How to Manage Files with Filezilla for more information.
Upload via File Manager - See How to Upload Using the File Manager for
instructions.
Upload via SSH - See How to Get and Use SSH Access for instructions.
I. Log in to cPanel.
30
Developed by Chitvan Kumar
II. Look for the Databases section, then click the MySQL Database
Wizard icon.
III. For Step 1: Create A Database, enter the database name, and click Next
Step.
IV. For Step 2: Create Database Users, enter the database user name and
password, and click Create User.
31
Developed by Chitvan Kumar
VI. For Step 4: Complete the task, make a note of the database name, username,
and password, as you will need them for Step 4⤵ below.
The wp-config-sample.php file can be found in File Manager in the folder where
WordPress is installed. The folder for your primary domain is public_html by default, so
the steps below show the process for that folder.
I. Log in to cPanel.
II. Navigate to the Files section, then click the File Manager icon.
32
Developed by Chitvan Kumar
V. In the pop-up box, check the box for Show Hidden Files (dotfiles), then
click Save.
33
Developed by Chitvan Kumar
o Replace username_here with the username of the database you
created.
o Replace password_here with the password of the database that
you created.
XII. Once done, click the Save Changes button on the top right, then Close to
exit and return to the File Manager.
Open a new browser window and enter your domain to run the installation
script. Depending on where you installed the script, you will be automatically
redirected to either of the following URLs:
https://example.com/wp-admin/install.php
https://example.com/yoursubfolder/wp-admin/install.php
I. Once you access your correct WordPress URL in a browser, you will
see a WordPress setup page prompting you to select your preferred
language. Select your preferred language and click
the Continue button.
34
Developed by Chitvan Kumar
II. You should now see a welcome page that says, "Welcome to the
famous five-minute WordPress installation process!" Under
the Information needed section, you'll need to fill out the following
fields:
35
Developed by Chitvan Kumar
page and a placeholder for your password. Click the Log In button to
log in to the WordPress Admin Dashboard to begin building your site!
______________________________________________________________________________
The following list are examples of Internet browser plugins that can be installed
in a browser to extend its capabilities - Adobe Acrobat, Adobe Flash, Java, QuickTime,
RealPlayer, Shockwave, etc.
Herbert.
The goal of this simple framework is to add some sanity and civility to
WordPress plugin development, a task which is currently messy and savage. So,
without further ado, I should like to present you with some sanity.
A template system that helps to separate your logic from your views.
An easy way to include JS and CSS within the admin or front-end of your
plugin.
36
Developed by Chitvan Kumar
AJAX in the admin made simple, with nonce integration out of the box.
An object oriented approach to plugin development which makes
modifications easy.
1. Go to your dashboard.
2. Click on Posts → Categories.
3. Click Add New Category.
4. Give the new category a name and a description.
5. Click Add to save the new category.
By default, the category will be added as a “Top level Category.” To create
subcategories, toggle the switch, and choose the top-level category you want this
category associated with.
For example, a food blog might have categories for Cakes, Pies, and Ice Cream,
all under a top-level Dessert category.
37
Developed by Chitvan Kumar
1. Go to Posts → Categories in your dashboard.
2. Click the ellipsis (three dots) to the right of the category you want to assign as the
default.
3. Select Set as default from the drop-down menu.
While it is not possible to delete the “Uncategorized” Category, you can rename it
to whatever you want by clicking the Edit option in the drop-down menu next to the
category name.
Categorize your Posts
38
Developed by Chitvan Kumar
You can select multiple categories for a single post to show in. However,
you should not add more than five to 15 categories and tags to a post.
You can remove a post from a category by unchecking the box next to the
category name.
It is possible to quickly add a new category through the post’s Post Settings by
clicking on Add New Category.
You will be able to give the category a name and select a parent category.
If you want to add a description to the category, go back to your dashboard and
navigate to Posts → Categories to edit the new category.
39
Developed by Chitvan Kumar
Customize Category Pages
like https://yourgroovysite.com/category/categoryname/.
If your site is using a theme that takes advantage of the Site Editor, you can
customize the Archives page’s template. Otherwise, it is styled by the theme you have
selected.
You can also create a custom category page using any WordPress block that
allows you to filter by category. These blocks include:
40
Developed by Chitvan Kumar
The default Archives page and any page that uses the blocks mentioned above
will automatically update with every new post you publish with that category.
You can link directly to the Category Archives page from your site’s
menu. When your visitors click on the link, they’ll navigate to the archives for the
category you linked to. For step-by-step instructions, check out the following
guide.
If you’ve created a custom category page, you can link to it in your site’s menu
like any other page on your site.
If you have added a category to your site’s menu but do not see any posts on the
category page, or a message that says the content can’t be found, this means no posts
have been assigned to that category. Once you publish posts with the category they will
automatically show on the category page.
Using text, images, or buttons, you can link to your category pages (both archive
and custom pages) throughout your site. The following guide will walk you through
adding links to pages and posts on your site.
41
Developed by Chitvan Kumar
Delete: Delete the category. This removes the category from your site but does
not delete any posts which had that category.
Set as default: Assign as the default category.
Use Categories to Get Discovered
People can add specific tags and topics in their WordPress.com Reader for topics
they’re interested in following. Then, when your post uses a category they’ve added to
their topics, they’ll see your post in their Reader. Therefore, assigning tags and categories
to your post increases the chance that other WordPress.com users will see your content.
However, you don’t want irrelevant content on the topics listings or search, and
neither do we. That’s why we limit the number of tags and categories used on a public
topic listing. Five to 15 tags/categories is a good number to add to each of your
posts. The more categories you use, the less likely your post will be selected for
inclusion in the topics listings.
To bulk delete any categories, check all categories you want to be deleted,
and in the Bulk Actions drop-down above the list, select “Delete,” then click the
“Apply” button.
42
Developed by Chitvan Kumar
Ans 22: Creating a WordPress
4. Enter a title in the available field. This will display on the top of your Post.
5. Enter your page content in the available field. You can use the Editor to format
your text.
43
Developed by Chitvan Kumar
7. Once you have entered your information in the Post, click the Publish button.
(You can also click Save Draft to save your work without publishing the Post)
Log in to your WordPress Dashboard, and click on Pages > Add New. This
step is pretty self-explanatory. Since you already have an existing business website
and you want to add a blog, you’ll need a page for your blog to live. You don’t want
it encroaching on other pertinent page information.
Let’s name it “Blog” for easy identification. Leave the text box blank because
you want the page to act as a feed for your posts — not a static read page.
In order for your Blog page to go live, you need to publish it.
When you’re in your Dashboard, you’ll see a column along the left with all
the different things you can do in WordPress. Go to Settings > Reading .
44
Developed by Chitvan Kumar
Click on A static page, and then select Blog under the drop-down menu
for Posts page. This is important. This step determines where your blog feed
appears.
Ø Customize Media Library:
At the top of the Media Library, you will find the bar that contains
options as View Mode, Filter by item, Filter by date, Bulk Select button, and a
Search inbox.
45
Developed by Chitvan Kumar
Ans 25: Creating Table in Database
Code:
<?php
$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";
46
Developed by Chitvan Kumar
47
Developed by Chitvan Kumar