100% found this document useful (1 vote)
1K views

Experiment No. - 1: Design PHP Based Web Pages Using Correct PHP, CSS, and XHTML Syntax, Structure

1. The document provides instructions for creating a basic blogging website in 6 steps, including picking a name, getting hosting, customizing templates, writing posts, promoting the blog, and making money from the blog. 2. It also includes an example HTML code for the structure of a blog post page with sections for the header, navigation, blog dropdown, article, and comments. 3. The experiments cover topics like designing PHP web pages, using cookies and sessions in PHP, creating a website with WordPress, and building a basic blogging site.

Uploaded by

Akash Parihar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
1K views

Experiment No. - 1: Design PHP Based Web Pages Using Correct PHP, CSS, and XHTML Syntax, Structure

1. The document provides instructions for creating a basic blogging website in 6 steps, including picking a name, getting hosting, customizing templates, writing posts, promoting the blog, and making money from the blog. 2. It also includes an example HTML code for the structure of a blog post page with sections for the header, navigation, blog dropdown, article, and comments. 3. The experiments cover topics like designing PHP web pages, using cookies and sessions in PHP, creating a website with WordPress, and building a basic blogging site.

Uploaded by

Akash Parihar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Experiment No.

– 1
Design PHP based web pages using correct PHP , CSS , and XHTML
syntax , structure .
<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge">

<meta name="description" content="Just a test website for learning html , css and php">

<title>My great website </title>

<link rel="stylesheet" href="css/style.css" type ="text/css">

</head>

<body>

<header>

<nav id="main-navigation">

<ul>

<li><a href="index.php">home</a></li>

<li><a href="index.php">page 2</a></li>

<li><a href="index.php">page 3</a></li>

</ul>

</nav>

</header>

<div id ="main-contents">

this is page 1 , the home page .

</div>

<footer>

contact us at cms@co-in

</footer>

</body>

</html>
Experiment No. – 2
To store a cookie using PHP on client side .
Example for StoreCookie(setcookie())
In the example of setcookie() function the name of cookie is
set as ‘cookie_name’ . The value of cookie is set as
‘cookie_value’ . The expiry of cookie is till 1 day
[(60(sec)*60(min)*24(hour)] .
Here , the ‘path’ , ‘security’ , ‘domain’ is default set in
setcookie().
source code :

<?php

setcookie("cookie_name" ,"cookie_value" , time()+(60+60+24));

?>

<!DOCTYPE html>

<html lang="en">

<body>

<?php

echo "cookie is set.";

?>

</body>

</html>

</pre>

Output :

cookie is set.
Experiment No. – 3
To save the user session on server side .
Accessing Session Value
When we need to access session value firstly we call session_start()function .
Here we can access on any php page . Accessing session value through key .
<!DOCTYPE html>

<html>

<body>

<?php

echo $_SESSION["name"];

?>

</body>

</html>

Output

Rakesh

for show all keys and values

Source code :

<?php

session_start();

foreach ($_SESSION as $keys => $values){

echo $key."=" .$value."<br/>";

?>

Output :

name = Rakesh
Experiment No. – 4
Design website using WordPress
Steps
1. Find a domain name for your site.
2. Sign up for web hosting (we recommend Bluehost) .
3. Get WordPress installed via the Bluehost interface .
4. Pick a free WordPress theme from the Bluehoston Boarding.
5. Get some must-have WordPress plugins that will help with your site
growth .
6. Start creating your pages and blog posts .
Experiment No. – 5
Creation of basic Blogging website
How to start a Blog in 6 steps
1. Pick a blog name . Choose a descriptive name for your blog.
2. Get your blog online . Register your blog and get hosting.
3. Customize your blog . Choose a free blog design template and tweak it .
4. Write and publish your first post…
5. Promote your blog .
6. Make money blogging .
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>title</title>
</head>
<body>
<div id="container">
<header role="banner">
<h1>
<a href="/">joel sutherland</a>
</h1>
</header>
<nav>
<ul><!--nav items --></ul>
</nav>
<div id="blog" class="hidden"><!--blog dropdown--></div>
</div>
<!--blog-->
<article>
<header>
<h1>
<a href="">post title</a>
</h1>
<div class="postmeta">
<time datetime="">December 31st , 1969</time>
<a href="y#comments" class="comments">0 comments</a>
</div>
</header>
<!--content-->
<aside class="comments" id="comments"><!--comments--></aside>
<!--comments-->
</article>
</div>
<!--comments-->
<!--scripts-->
</body>
</html>

You might also like