gurpreetsgill Posted January 14, 2010 Share Posted January 14, 2010 Hi Guys, I need you help on merging a url with username : url is : www.example.com/people/hello.php I need to merge it with the current user who is logged in say (it gets stored in username) So finally i need : www.example.com/people/hello.php?user=gurpreet Please suggest me how to do it? Quote Link to comment Share on other sites More sharing options...
trq Posted January 14, 2010 Share Posted January 14, 2010 session_start(); if (isset($_SESSION['logged_in'])) { echo "<a href='http://example.com/people/hello.php?user={$_SESSION['username']}'>{$_SESSION['username']}</a>"; } Quote Link to comment Share on other sites More sharing options...
gurpreetsgill Posted January 14, 2010 Author Share Posted January 14, 2010 I need to use this in .tpl file Quote Link to comment Share on other sites More sharing options...
gurpreetsgill Posted January 14, 2010 Author Share Posted January 14, 2010 ACTUAL LINK : <a href='{$url->url_create('profile', $user->user_info.user_username)}'> where i need to replace "profile" with "http://freeadvertise.org/hello.php" + username "profile" is calling user profile page buy instead i need to call "hello.php" simply inserting "hello" instead of "profile" is not working...... how to do it guys ? Quote Link to comment Share on other sites More sharing options...
trq Posted January 14, 2010 Share Posted January 14, 2010 A .tpl aren't part of php. What template library are you using? Quote Link to comment Share on other sites More sharing options...
gurpreetsgill Posted January 14, 2010 Author Share Posted January 14, 2010 hi, I am calling this function from .tpl to .php Llibrary i dont have any idea......its from socialengine...... Quote Link to comment Share on other sites More sharing options...
trq Posted January 14, 2010 Share Posted January 14, 2010 Well, .tpl files aren't a built in to php is what I'm getting at (so there format isn't common). My example is actual PHP, if that won't work for you you'll need to take a look at the docs for this socialengine. Quote Link to comment Share on other sites More sharing options...
trq Posted January 14, 2010 Share Posted January 14, 2010 We would need to see how the $url object's url_create() method works. My guess, is that it looks within a specific set of directories for the file mentioned within the first argument. 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.