Saturday, April 9, 2016

Building a social network: index(P5).

Introduction:

  In this section, I will introduce you the index.php which is also the default page when users access to the website. This is one of the simplest code files in our project. This file is a trivial file but necessary nonetheless to give the project a home page. All it does is display a simple welcome message. In a finished application, this would be where you sell the virtues of your site to encourage sign-ups. Now, are you ready to discover the index.php file? if yes, get started! if you are not ready yet, get started too!

index.php

<?php
   require_once 'header.php';
  echo "<br><span class='main'>Welcome to $appname,";
  if ($loggedin) echo " $user, you are logged in.";
  else           echo ' please sign up and/or log in to join in.';
?>
    </span><br><br>
  </body>
</html>

 Incidentally, seeing as all the MySQL tables have been created and the include files saved, you can now load index.php , into your browser to get your first peek at the new application. It should look like as below:


Fig 1. The main page of the site

Conclusion:
  
   In this section I have shown you the simple code to construct the home page. In the next section I will help you to setup the signup.php file which is more complex than this. It also requires you to have knowledge about AJAX. However, before taking a new journey to there let's take a deep breath! 


No comments:

Post a Comment