PHP Help?

ok here is a member profile link…
how can i change it to only this /user/
and not the long URL

print "<tr><td width='100%' bgcolor='#CCCCFE'><b><a href='view_profile.php?member_id=$_SESSION[member_id]' class='style11'>View My Profile</a></b></td></tr>";

You can use url rewrite rules if you have mod rewrite. Something like this (add this to .htaccess):

RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^/]+)/?$ /view_profile.php?member_id=$1

it is set to that… but i am in there profile it shows that link…
i want to know how i can remove that and make it more short

You need to modify link “in there profile” :slight_smile:


but do i just do this only href=’/$user/’

Based on your code, the short version of link should be this:
[php]View My Profile[/php]

yea that did not work. its just shows up wrong… or URL not found

do u know any more that can work?

this is it… sorry…

[php]<a href=“view_profile.php?member_id=<?=$_SESSION["member_id"]?>”>View My Profile[/php]

:slight_smile: Im a beginner and it helped me too ,thanks! :slight_smile: :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service