Here's what I dealing here...and it's quite tough so be prepared to be mind boggled (like me)
So I have a login and and profile system on my page that are currently operating on different "platforms".
I want to mix the two together seamlessly without completely starting over.
If you go to my site http://www.yourtechview.com , make an account, and login...you will be introduced to a page ending in
access-controlled.php
This page can only viewed while you have an active session..other wise you will be redirected to the login screen
(neat huh?)
so at the top right of the access-controlled.php page you'll notice that your full name will appear as a menu option. (cool beans)
What I want to do is to have that menu item linked to the login page of the user who is logged in.
that's all.
You're probably asking for code right about now and here goes.
Access Controlled page
<?PHP require_once("./include/membersite_config.php"); if(!$fgmembersite->CheckLogin()) { $fgmembersite->RedirectToURL("/source/login.php"); exit;} ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE HTML> <!-- Halcyonic 1.0 by nodethirtythree + FCT http://nodethirtythree.com | @nodethirtythree Released under the Creative Commons Attribution 3.0 license (nodethirtythree.com/license) --> <html> <head> <title>Your Tech Reviews</title> <div id="fb-root"></div> <p> <script type="text/javascript"><!-- (function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); // --> </script> </p> <center> <style type="text/css"> #navbar ul { margin: 0; padding: 5px; list-style-type: none; text-align: center; background-color: #FFFF; } #navbar ul li { display: inline; } #navbar ul li a { text-decoration: none; padding: .2em 1em; color: #FFFF; background-color: #FFFF; } #navbar ul li a:hover { color: #B8B8B8; background-color: #FFFF; } </style> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <script type="text/javascript" src="/js/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="/js/jquery.slidertron-1.1.js"></script> <!--5grid--><script src="/js/viewport.js"></script><!--[if lt IE 9]> <script src="/js/ie.js"></script><![endif]--> <link rel="stylesheet" href="/css/responsive.css" /><!--/5grid--> <link rel="stylesheet" href="/css/style.css" /> <link rel="stylesheet" href="/css/style111.css" /> <link rel="stylesheet" href="/css/demo1.css" /> <!--[if lte IE 9]><link rel="stylesheet" href="/css/style-ie9.css" /><![endif]--> </head> <body> <p><!-- Header --></p> <div id="header-wrapper"><header id="header" class="5grid"> <div class="12u-first"><!-- Logo --> <h1><a href="#">Your Tech Reviews</a></h1> <!-- Nav --> <nav> <a href="access-controlled.php">Home</a> <a href="reviews.php">Reviews</a> <a href="videos.php">Videos</a> <a href="articles.php">Articles</a> <a href="market.php" ">Marketplace</a> <a href="profile.php?uid=<?php echo $user['id'];?>"><?= $fgmembersite->UserFullName(); ?></a> </nav></div> </header> <div id="banner"> <div class="5grid 5grid-alt"> <div class="6u-first"><!-- Banner Copy --> <p>Your Technology. Your Reviews.</p> <form method="get" action="http://www.google.com/search"><input type="text" value=" Start Searching Now!" size="31" onfocus="this.value=''" name="q" maxlength="200" class="button-big" /><input type="submit" value="Google Search" /><input type="radio" name="sitesearch" value="" /> The Web <input type="radio" name="sitesearch" value="yourtechview.com" checked="checked" /> Your Tech Reviews</form></div> <div class="6u"><!-- Banner Image --><!-- HTML --> <div id="slider"> <div class="viewer"> <div class="reel"> <div class="slide"><img src="/images/banner.jpg"/> </div> <div class="slide"><img src="/images/rsz_beats.jpg" /></div> <div class="slide"><img src="http://www.popsci.com/files/imagecache/ ... 931732.jpg" /></div> <div class="slide"><img src="http://i.haymarket.net.au/News/xbox-360 ... lass.jpg"/> </div> <div class="slide"><img src="http://cdn01.cdn.egotastic.com/wp-conte ... 00x450.jpg" /></div> </div> </div> </div> <!-- JS --> <script type="text/javascript">// <![CDATA[ $('#slider').slidertron({ viewerSelector: '.viewer', reelSelector: '.viewer .reel', slidesSelector: '.viewer .reel .slide', advanceDelay: 3000, speed: 'slow' }); // ]]></script> </div> <div class="5grid-clear"></div> </div> </div> </div> <p><!-- Features --></p> <div id="features-wrapper"> <div id="features"> <div class="5grid"> <div class="3u-first"><!-- Feature #1 --><section><a href="#" class="bordered-feature-image"><img src="/images/pic01.jpg" /></a> <h2>The new Macbook Pro RD</h2> <p>Introducing the next generation of computers. This thing is no joke.</p> </section></div> <div class="3u"><!-- Feature #2 --><section><a href="#" class="bordered-feature-image"><img src="/images/pic02.jpg" /></a> <h2>A Microsoft Tablet?</h2> <p>Yes! Should we be surprised that Microsoft is competing against their own hardware partners? <strong>You decide</strong></p> </section></div> <div class="3u"><!-- Feature #3 --><section><a href="#" class="bordered-feature-image"><img src="/images/pic03.jpg" /></a> <h2>Another Galaxy</h2> <p>Some are seriously debating on this phone. Buy this sweet toy..or wait for Iphone 5?</p> </section></div> <div class="3u"><!-- Feature #4 --><section><a href="#" class="bordered-feature-image"><img src="/images/pic04.jpg" /></a> <h2>Black Ops 2</h2> <p>The first one was pretty good but this is what we want to see in November.</p> </section></div> </div> </div> </div> <p><!-- Content --></p> <div id="content-wrapper"> <div id="content"> <div class="5grid"> <div class="4u-first"><!-- Box #1 --> <div class="4u"><!-- Box #2 --> <div class="4u"><!-- Box #3 --></div> </div> </div> </div> <!-- Footer --> <div id="footer-wrapper"><footer id="footer" class="5grid"> <div class="8u-first"><!-- Links --><section> <h2>Links to Important Stuff</h2> <div class="3u-first"> <ul class="link-list last-child"> <li><a href="/about">About Your Tech Views</a></li> <li><a href="/contact">Contact Us</a></li> <li><a href="#">Privacy Policy</a></li> <li><a href="#">Jobs</a></li> </ul> </div> <div class="3u"> <ul class="link-list last-child"> <li><a href="#">Terms of Use</a></li> <li><a href="#">Guidelines </a></li> <li><a href="#">Reputation </a></li> <li><a href="#">Point System </a></li> </ul> </div> <div class="3u"></div> <div class="3u"></div> <br /><br /><br /><br /><br /><br /></section></div> <div class="4u"><!-- Blurb --></div> </footer></div> <!-- Copyright --> <div id="copyright">(c) 2012 Untitled Website. All rights reserved. Design by <a href="http://nodethirtythree.com/">nodethirtythree</a> + <a href="http://www.freecsstemplates.org/">FCT</a>. Images by <a href="http://fotogrph.com/">Fotogrph</a>.</div> </div> </div> </body> </html>here is the profile.php page
<?php include('init.inc.php'); $user_info = fetch_user_info($_GET['uid']); echo mysql_error(); ?> <!DOCTYPE HTML> <!-- Halcyonic 1.0 by nodethirtythree + FCT http://nodethirtythree.com | @nodethirtythree Released under the Creative Commons Attribution 3.0 license (nodethirtythree.com/license) --> <html> <head> <title><?php echo $user_info['username']; ?>'s Profile</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="description" content="" /> <meta name="keywords" content="" /> <!--5grid--><script src="/js/viewport.js"></script><!--[if lt IE 9]><script src="/js/ie.js"></script><![endif]--><link rel="stylesheet" href="/css/responsive.css" /><!--/5grid--> <link rel="stylesheet" href="/css/style.css" /> <!--[if lte IE 9]><link rel="stylesheet" href="/css/style-ie9.css" /><![endif]--> </head> <body class="subpage"> <!-- Header --> <div id="header-wrapper"> <header id="header" class="5grid"> <div class="12u-first"> <!-- Logo --> <h1><a href"">Profile</a></h1> <!-- Nav --> <nav> <a href="access-controlled.php">Home</a> <a href="reviews.html">Reviews</a> <a href="videos.html">Videos</a> <a href="articles.html">Articles</a> <a href="/market.html">Marketplace</a><a href="/source/login.php">Login</a> </nav> </div> </header> </div> <!-- Content --> <div id="content-wrapper"> <div id="content"> <div class="5grid"> <div class="3u-first"> <!-- Sidebar --> <section> <header> <h2><?php echo $user_info['username']; ?></h2> </header> <div> <?php if ($user_info === false){ echo 'That user does not exist.'; } else { ?> <p></p> <p> Gender: <?php echo ($user_info['gender'] == Male) ? 'Male' : 'Female'; ?></p> <p>Location:<?php echo $user_info['location']; ?></p> <?php } ?> </div> </section> <section> <header> <h2>About</h2> </header> <p> About: <?php echo $user_info['about']; ?></p> </section> </div> <div class="9u"> <!-- Main Content --> <section> <header> <h2>Currently Empty Space</h2> <h3>Nothing to do here</h3> </header> This is just going to be empty space </section> </div> </div> </div> </div> <!-- Footer --> <div id="footer-wrapper"> <footer id="footer" class="5grid"> <div class="8u-first"> <!-- Links --> <section> <h2>Links to Important Stuff</h2> <div class="3u-first"> <ul class="link-list last-child"> <li><a href="#">Neque amet dapibus</a></li> <li><a href="#">Sed mattis quis rutrum</a></li> <li><a href="#">Accumsan suspendisse</a></li> <li><a href="#">Eu varius vitae magna</a></li> </ul> </div> <div class="3u"> <ul class="link-list last-child"> <li><a href="#">Neque amet dapibus</a></li> <li><a href="#">Sed mattis quis rutrum</a></li> <li><a href="#">Accumsan suspendisse</a></li> <li><a href="#">Eu varius vitae magna</a></li> </ul> </div> <div class="3u"> <ul class="link-list last-child"> <li><a href="#">Neque amet dapibus</a></li> <li><a href="#">Sed mattis quis rutrum</a></li> <li><a href="#">Accumsan suspendisse</a></li> <li><a href="#">Eu varius vitae magna</a></li> </ul> </div> <div class="3u"> <ul class="link-list last-child"> <li><a href="#">Neque amet dapibus</a></li> <li><a href="#">Sed mattis quis rutrum</a></li> <li><a href="#">Accumsan suspendisse</a></li> <li><a href="#">Eu varius vitae magna</a></li> </ul> </div> </section> </div> <div class="4u"> <!-- Blurb --> <section> <h2>An Informative Text Blurb</h2> <p> Duis neque nisi, dapibus sed mattis quis, rutrum accumsan sed. Suspendisse eu varius nibh. Suspendisse vitae magna eget odio amet mollis. Duis neque nisi, dapibus sed mattis quis, sed rutrum accumsan sed. Suspendisse eu varius nibh lorem ipsum amet dolor sit amet lorem ipsum consequat gravida justo mollis. </p> </section> </div> </footer> </div> <!-- Copyright --> <div id="copyright"> (c) 2012 Untitled Website. All rights reserved. Design by <a href="http://nodethirtythree.com/">nodethirtythree</a> + <a href="http://www.freecsstemplates.org/">FCT</a>. Images by <a href="http://fotogrph.com/">Fotogrph</a>. </div> </body> </html>
now the profile system I got from the youtube tutorials and uses a very different session method than the one I am using.
I've tried many things and nothing works.
I was able to make profile pages appear for all of my users and you can navigate through each via changing the uid at the end. However, I want to establish a link from the currently logged in user..directly to their profile page from the access-controlled.php page.
notice <a href="profile.php?uid=<?php echo $user['id'];?>"><?= $fgmembersite->UserFullName(); ?></a>
which shows your full name but links to no user.
let me know if you need to see more code.
Thank you all in advance.