Nilpez Posted March 21, 2006 Share Posted March 21, 2006 I am quite a novice with php so please have some patience with me. I have a site that I administer which is going to be integrating with another outside site. I need to track and pass on through URL users that have logged into the external site and are brought to my site. Their login name needs to be added to all pages as they traverse my site, and bring it with them when they leave again. All my pages are already php pages mostly just so I can use php includes for the navigation. I have heard about using hidden form fields to do this but I really have no idea how. The webmaster of the external site has no patience for me and just wants to make me look bad, so I really want to get this working (with your help).All my navigation is in one navigation.php file and one .js file for the drop menus. I just don't know where to start, and I don't want to build a huge additional script to do it if possible.I need to pass on ?user=userloginname through the whole site. Do I use a hidden field somehow, and if so how exactly?Your help is greatly appreciated. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Humpty Posted March 22, 2006 Share Posted March 22, 2006 Still unsure exactly the whole story here.If you use a hidden field then it must be in a form and submitted.Other than that you can pass the variable to each page using the $_GET coding.You would probably be best using sessions though.As the user comes into your site from the external site use the $_GET (from a URL) or the $_POST (from a form).Retrieve his username and start a session and store it. (think of sessions as a way to store and hold data without having to pass it through all the time.Things to search / look for:$_GET$_POSTsession_start(); ...or is that sessionstart(); ..(you'll find it)and setting and retrieving via $_SESSION['variablenameasusedbyyou']I've found it very easy and as a lazy coder I've even used sessions to pass other variables to and from pages.The main thing to watch out for is when you use sessions every page must start with [code]<?sessionstart();[/code]as the first piece of code. 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.