overlordofevil Posted March 11, 2008 Share Posted March 11, 2008 Ok I am trying to figure out how to write a php page that is like a frame set page. Basically what I want to do is have a column on the left that lets me put all the links there and then to the right in the "MAIN" section whatever function or page I call shows up there. I have seen it done just not sure if i need to use javascript or what. any help in pointing out a tutorial on this or suggestions would be appreciated. Quote Link to comment Share on other sites More sharing options...
haku Posted March 11, 2008 Share Posted March 11, 2008 What do you mean "write a php page that is like a frame page"? Php is just a scripting language that outputs text. Most people use it to output (x)html. If you really want frames, use it to output html that has frames. I personally wouldn't (I don't like frames) but if you want to do it, you definitely can. Quote Link to comment Share on other sites More sharing options...
overlordofevil Posted March 12, 2008 Author Share Posted March 12, 2008 Your right Php is a script language. I didn't explain myself correctly. I am not sure how to explain it any different that using an html frame set. I will look it up some more but to try and explain a bit more. I have a members DB web interface. The interface allows for different access levels such as member and admin. What I want to do is set up a page which is the users screen. On the left would be the links of what the person can do based on their access level and to the right in the "main" section would show up pages or functions that the user is trying to do. now the reason why I am trying to do this is the admins have standard functions so that is easy enough to program in but when a user logs in they have specific functions based on their info. Such as they can check their personal account, update their info etc. which based on the members id i could "specialize" the menu to reflect their information. So for example on the left instead of the link saying "edit member info" it could say something like "edit mike's info". I think I may need to use javascripts to do this but I am unsure and still trying to find info on this. I hope I explained what I want to do a bit better. Thanks Quote Link to comment Share on other sites More sharing options...
haku Posted March 12, 2008 Share Posted March 12, 2008 Yes you did. Displaying the different functions that are available to the user can (and should) be done with PHP. When the user logs in, you put a cookie on their computer (or start a session) that holds their user ID. Then you check their user ID when they log into the page you are talking about. Depending on that ID, you set a number of different functions that are available to them. Then you put those all into a div, and then use CSS to set postion: fixed; left: 0; width: Xpx; //set X to be some width in pixels and you put all the rest of your content into another div, and give that div left margin using: margin-left: Ypx // set Y to be some width in pixels This will put your menu in the left div, and your content to the right of that. Quote Link to comment Share on other sites More sharing options...
overlordofevil Posted March 12, 2008 Author Share Posted March 12, 2008 cool thanks for the assist. Quote Link to comment Share on other sites More sharing options...
overlordofevil Posted March 12, 2008 Author Share Posted March 12, 2008 ok i have been looking over the info and seen how to write this up with the CSS page and how to name the div and it works out nicely but i don't know how to set up the links to show up in the main page. For example with a frameset I would use <a href="Page1.htm" target="center">Page One</a> to show the function.page in the main section to the right. how do i do this with the css div tags or do i have to set the css to show up in the new page as well ? Thanks Quote Link to comment Share on other sites More sharing options...
haku Posted March 12, 2008 Share Posted March 12, 2008 You can't do this without reloading the whole page. You could using frames, but frames just bring on a bunch of their own problems. Build $_GET variables into each of the links, and then use those $_GET variables to decide which data to use to populate the 'frame' on the right. Note: What you want to do can actually be done with javascript, but get it working in php exclusively first, and then come back here, and I'll point you in the right direction on how to add the javascript over top. 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.