runnerjp Posted April 13, 2008 Share Posted April 13, 2008 hey guys i use this to direct users to their profile page <a href="<?php echo get_username($_SESSION['user_id']);?>">profile</a> so if users is bob it will send bob to www.mywebsite.com/members/bob i also and a script that makes the pages show within an area on my website like so <a href=\"index.php?page=newsupdate\"> what a want is so the users profile appears within the area iv marked out on website ususly done by method 2.... i have added profile.php into the include file so how can i chnage link for it too work i hope this makes sence as its hard to explain Quote Link to comment https://forums.phpfreaks.com/topic/100904-need-help-with-a-link/ Share on other sites More sharing options...
poleposters Posted April 13, 2008 Share Posted April 13, 2008 makes no sense. Although I think I could help if you explained exactly what you wanted a little clearer. I'm doing something similare myself. Quote Link to comment https://forums.phpfreaks.com/topic/100904-need-help-with-a-link/#findComment-516027 Share on other sites More sharing options...
runnerjp Posted April 13, 2008 Author Share Posted April 13, 2008 haha ok ermmm maybe ill talk you through it and post the code ok so on my main page i have this <? $page = $_GET['page']; if (ereg('[A-Za-z0-9]',$page) ) { if (file_exists('include/'.$page.'.php')) { include('include/'.$page.'.php'); } else { include('include/main.php'); } } else { include('include/main.php'); }?> so everything in my include folder gets placed here.... i have my profile.php which is the users profile ok right to look at your profile you go by the link... www.mywebsite.com/members/yourname this is done by this <a href="<?php echo get_username($_SESSION['user_id']);?>">profile</a> but for my to get the file to appear on the include file scirpt (the top 1) you have to have this in the url <a href=\"index.php?page=??(what ever page it is so profile ???\"> so how can i do it lol that make betetr sence? Quote Link to comment https://forums.phpfreaks.com/topic/100904-need-help-with-a-link/#findComment-516031 Share on other sites More sharing options...
dezkit Posted April 13, 2008 Share Posted April 13, 2008 <a href="http://www.mywebsite.com/members/yourname/<?php echo get_username($_SESSION['user_id']); ?>">profile</a> Quote Link to comment https://forums.phpfreaks.com/topic/100904-need-help-with-a-link/#findComment-516041 Share on other sites More sharing options...
runnerjp Posted April 13, 2008 Author Share Posted April 13, 2008 dezkit sorry it has to be something likeee <a href="<?php index.php?page= echo get_username($_SESSION['user_id']);?>">profile</a> Quote Link to comment https://forums.phpfreaks.com/topic/100904-need-help-with-a-link/#findComment-516050 Share on other sites More sharing options...
dezkit Posted April 13, 2008 Share Posted April 13, 2008 <a href="<?php echo 'index.php?page='; echo get_username($_SESSION['user_id']);?> ">profile</a> or <a href=" <?php echo 'index.php?page='; echo get_username($_SESSION['user_id']); ?> ">profile</a> Quote Link to comment https://forums.phpfreaks.com/topic/100904-need-help-with-a-link/#findComment-516055 Share on other sites More sharing options...
runnerjp Posted April 13, 2008 Author Share Posted April 13, 2008 nah does not work....might have to dump this idea lol and think new unless any 1 else has any other ideas Quote Link to comment https://forums.phpfreaks.com/topic/100904-need-help-with-a-link/#findComment-516287 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.