You can only use sessions if you have started the session. Add this to the top of your page.
PHP Code:
session_start();
Also, you have named your session variable cname so simply put this whereever you want to echo it.
PHP Code:
echo $_SESSION['cname'];
so your code should look like this
Code:
<?php
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="" />
<title>Colors Inc.</title>
<style type="text/css">
<!--
@import url("style.css");
-->
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>
<body>
<div id="container">
<div id="header">
<h1>Colors Inc.</h1>
<p class="logo">Color Up Your Life</p>
</div>
<!-- menu -->
<div id="nav">
<ul>
<li><a href="index.html">Home</a> </li>
<li> <a href="products.html">Products</a></li>
<li> <a href="#">Login</a></li>
<li> <a href="#">Gallery</a></li>
<li> <a href="#">Contact Us</a> </li>
</ul>
</div>
<!-- content area -->
<div id="content" align="center">
<h1>Welcome</h1>
<p> </p>
<div align="center"><cite>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','431','height','110','title','animation2','src','ColorsFinal2','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','ColorsFinal2' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="431" height="110" title="animation2">
<param name="movie" value="ColorsFinal2.swf" />
<param name="quality" value="high" />
<embed src="ColorsFinal2.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="431" height="110"></embed>
</object>
</noscript>
</cite></div>
<div class="horline"></div>
<h3><center>
<p>You have successfully logged in <?php echo $_SESSION['cname']; ?></p>
<p>Now you place your order by clicking <a href="order.php">HERE</a> </p>
</center></h3>
<p> </p>
<h3>Comment from a Customer:</h3>
<div class="box">
<p>I've been searching my desired poster for years! And finally it has become possible because of Colors Inc. This is just what I've wanted! Many thanks to them!</p>
<p>- Hamim Al Ahsan</p>
</div>
<p>And that's how our customers love us! Now feel free to roam around the site, choose a product of your choice, or upload your own design! You'll get it in your hands, the service which you didn't have all this time!</p>
<div class="horline"></div>
<h3> </h3>
<h3>Lists</h3>
<p>Some Flash Advertisement</p>
</div>
<!-- content area -->
<div id="footer">
<p class="center">
<a href="http://validator.w3.org/check/referer">XHTML</a> :: <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a><br>
Copyright © 2012 colorsinc.com.bd:: Design by Priyotosh Das </p>
</div>
</div>
</body>
</html>
Bookmarks