barefootsanders Posted April 4, 2007 Share Posted April 4, 2007 Hey everyone. I've been stuck on this problem for some time now. I have a web server that I run on my computer and I have been developing my own user login database. The problem that I am having is viewing the user info page. Each user has their own unique user ID and I would like to have that ID used in the link for their userinfo page. Here is the format of my page. I have a main index.php. On each click the page is reloaded and in the center I have the following switch statement. <?php $page = $_GET['page']; switch ($page) { case register: //Register was clicked include("register.php"); break; case welcome: //The main home page include("welcome.php"); break; case forgotpass: //Forgot password was clicked include("forgotpass.php"); break; case userinfo: //User info page include("userinfo.php?id"); break; case useredit: //User edit page include("useredit.php"); break; case admincenter: //Admin center - FOR ADMINS ONLY! include("admin/admin.php"); break; default: include("welcome.php"); } ?> Links are set up like this: echo "<a href=\"index.php?page=userinfo\">My Account</a>"; Now I have been trying for about a week or so to incorporate the ID's into the link but to no avail. I have tried to include things like: echo "<a href=\"index.php?page=userinfo?id=$_SESSION['userid']\">My Account</a>"; But it does not work. At the top of my userinfo page I would like to take the id passed through the link clicked and use that to search the database and retrieve the array with the userinfo. Using this array I would print to the screen the information stored in that array. Has anyone else seen this type of navigation before and if so could you show me how to get through this?? Thanks a lot in advance. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.