Jump to content

need help with a link


runnerjp

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/100904-need-help-with-a-link/
Share on other sites

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 :P  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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.