hello!!
I've stuck with another problem. I've downloaded a template for my project and used the basic strucutre of the template for all my pages.
I've renamed the html file as php file and i've inserted my php code inbetween to do my functionalities.
I've pages like login.php, home.php, groups.php, search.php, logout.php etc.
I've set $_SESSION["uname"] to the username who is logging in at the time of login. I've written the following code in the logout.php :
<?php
session_start();
unset($_SESSION['uname']);
session_unset();
session_destroy();
include 'login.htm';
?>
and it is working perfectly. But if i directly go to the page http://localhost/home.php i should check whether the user is logged in or not and should do the corresponding actions. I've found that i've to do the following
if(!isset($_SESSION['uname']))
{
//show login page
}
else
{
//show home page
}
But the design of the template is completely in html tags .
If i give
<?php
session_start();
if(!isset($_SESSION['uname']))
{
//error log in first
}
else
{
echo " // here i've given the entire tags of the design of that template "
}
?>
I'm getting parse error and it is showing in the last line.
I'm confused..wont that code work? Looking for help..
Thanks
Regards
NLV