WesleyA Posted February 15, 2016 Share Posted February 15, 2016 (edited) Hi, I'm making a menu script with several options. With ul and li. The script works but I cant find a way to have a start up page or so selected. What happens now is that the last chosen page is showing in the browser unless < a href "somepage"> is used and targeted in the obtained name attribute. <ul class="slideuptabs"> <li><a href="http://localhost/MyLocation/home.php" target="lcell"><span>Home</span></a></li> <li><a href="http://localhost/MyLocation/home2.php" target="lcell"><span>Home2</span></a></li> <li><a href="http://localhost/MyLocation/home3.php" target="lcell"><span>Home3</span></a></li> <li><a href="http://localhost/MyLocation/home4.php" target="lcell"><span>Home4</span></a></li> <li><a href="http://localhost/MyLocation/home5.php" target="lcell"><span>Home5</span></a></li> <li><a href="http://localhost/MyLocation/home6.php" target="lcell"><span>Home6</span></a></li> </ul> <br><br> <table class = "maincell" border="2" cellpadding="2" cellspacing="2"> <tbody> <tr> <td class="lcell" name ="lcell"><iframe src=" " name="lcell" width="99%" height="99%" framebo rder="0"> </iframe> </td> <td class="rcell" name ="rcell"><iframe src=" " name="rcell" width="99%" height="99%" framebo rder="0"> </iframe><br> </td> </tr> </tbody> </table> Is there a solution do this at loading the site or frame page? Can it be done in html or should I use another language? . Edited February 15, 2016 by WesleyA Link to comment Share on other sites More sharing options...
dsonesuk Posted February 15, 2016 Share Posted February 15, 2016 The home/startup page that you land on entering the domain such as for example in your case http://localhost/MyLocation/ or example.com by default would be index. or default. with extensions html, htm, asp, php, aspx. Link to comment Share on other sites More sharing options...
WesleyA Posted February 15, 2016 Author Share Posted February 15, 2016 That doesnt work for me. I can choose one of the menu options but then I only choose the value in the name attribute: lcell. The rcell doesnt change automatically. How is this done? With html or PHP? I would like to find some answers to this. Link to comment Share on other sites More sharing options...
davej Posted February 16, 2016 Share Posted February 16, 2016 Rename home.php to index.php or default.php Set the src attributes of the iframes to the initial pages that you want to load. Link to comment Share on other sites More sharing options...
dsonesuk Posted February 16, 2016 Share Posted February 16, 2016 DON'T CHANGE YOUR ORIGINAL POST SO MUCH THAT IT MAKE FOLLOWING POSTS obsolete! Remove name attribute from td elements, that is ridiculous since the main point is to target the iframe. IF this page is the home page name IT index.html or if using php code within this page or you wish use php extension use index.php these are usually the first default page looked for first followed by default.* pages. IF the home.php link IS supposed to be this! page, DON'T TARGET THE iframe, do a normal link which will reopen itself! the index.* page. But! You will have to set the src of iframe to home.php. So index.* page will open and home.php will open in in iframe, user selects other links otherthan index.* link, it will show that page in iframe, if user clicks index.* page this page will reload and again show page predefined in src of iframe i.e home.php. Link to comment Share on other sites More sharing options...
WesleyA Posted February 17, 2016 Author Share Posted February 17, 2016 ok I change that. But the menu is not working properly. If i change from home2 to home the lcell show the good page, but it does not automatically take the rcell with 'em. Here the old value (chosen in home2 with <a href > stays there. Link to comment Share on other sites More sharing options...
dsonesuk Posted February 17, 2016 Share Posted February 17, 2016 I literally don't know what you want? What, where? does rcell come into it, theres is no reference by ANY links, theres NO indication from code in post#1 OR anywhere else! on how this iframe pick up url to show page within it. Link to comment Share on other sites More sharing options...
WesleyA Posted February 17, 2016 Author Share Posted February 17, 2016 I think it isnt necesssary to show that with code. It are just pages. Like when I click on home the lcell is targeted. So there the page changes. The rcell remains the same. I would like to change it automatically. Is there an html element or attribute to change it? Can I use PHP? Or do I have to use javascript, like onLoad? Please I would like to know that I'm not sure what language and code to choose. Link to comment Share on other sites More sharing options...
davej Posted February 17, 2016 Share Posted February 17, 2016 Clearly describe what you want to happen. Link to comment Share on other sites More sharing options...
WesleyA Posted February 18, 2016 Author Share Posted February 18, 2016 I was thinking about using javascript onLoad. I think it will work, but I would like to know if PHP also offers a solution to make a page load and call it from another page. It is not easy to give an exact script, because there might be more solutions. It could be the solution is html or javascript, but I hope for PHP. So is it possible to do onLoad and target a page in a specific frame with PHP? Link to comment Share on other sites More sharing options...
dsonesuk Posted February 18, 2016 Share Posted February 18, 2016 I think it isnt necesssary to show that with code. It are just pages. Like when I click on home the lcell is targeted. So there the page changes. The rcell remains the same. I would like to change it automatically. Is there an html element or attribute to change it? Can I use PHP? Or do I have to use javascript, like onLoad? Please I would like to know that I'm not sure what language and code to choose. About as clear as tax evading starbucks coffee, so you don't want to supply code for rcell because it never changes, but you want to know if rcell can be changed with php or javascript on onload event? Is what i just read :-s Link to comment Share on other sites More sharing options...
WesleyA Posted February 18, 2016 Author Share Posted February 18, 2016 About as clear as tax evading starbucks coffee, so you don't want to supply code for rcell because it never changes, but you want to know if rcell can be changed with php or javascript on onload event? Is what i just read :-s To speak the truth: I dont have any code for rcell. Link to comment Share on other sites More sharing options...
dsonesuk Posted February 18, 2016 Share Posted February 18, 2016 Link to comment Share on other sites More sharing options...
WesleyA Posted February 21, 2016 Author Share Posted February 21, 2016 Link to comment Share on other sites More sharing options...
davej Posted February 21, 2016 Share Posted February 21, 2016 You don't seem to be able to describe what you want, so how are we supposed to guess? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now