Jump to content
WesleyA

set startup page with iframe

Recommended Posts

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 by WesleyA

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...