Designing Index Page With Target - - the table instead of using frame

Pages: 1, 2
free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

Designing Index Page With Target - - the table instead of using frame

mike_savoie
QUOTE(BuffaloHELP @ Aug 30 2005, 12:16 AM)
I have been reading up on search engine's ability to cache one's site and I realized that FRAME is something these search engines don't really like. You can read it on Google's search FAQ and just recently my page was cached by Yahoo after taking down my frame index page to no frame page. So here is what I would like to do and I would like you super coders help.

PHP seems to be the best choice since when using INCLUDE command my index page includes not only my three separate pages in one, but it helps to have content rather than showing only
HTML
<FRAMESET name=topFrame rows=68,* frameBorder=0 framespacing="0" border="0">
<FRAME name=treetop src="EN_treeTop.htm" noResize target="mainpage" scrolling="no">
<FRAMESET name=mainFrame cols=200,*>
<FRAME name=contents src="EN_Tree.htm" target="mainpage" scrolling="no" noresize>
<FRAME name=mainpage src="EN_intro.htm" scrolling="auto" noresize>
</FRAMESET>
as a main page.

This is how I had my page laid out. I designed it this way to resemble your regular Windows help familiarity navigation.
Attached figure 1.
user posted image

I had it this way so that the BOX 1 and BOX 2 were never reloaded when a selection from BOX 2 (a tree style expandable/collapsible menu) occurs and only BOX 3 will load the intended page. It was fine and it worked beautifully. But now, I would like to have this as PHP. This is how my index page's code is:
HTML
<html>
<?

include 'top.html' ;
include 'menu.php' ;
include 'main.html' ;

?>
</html>

I already have the PHP navigation menu made for BOX 2 but whenever I click on the link, it opens up in new page. Instead of using FRAME, I have those laid out as TABLE.

My questions are:
1)Is there anyway I can target the link to the BOX 3 using TABLE's command (like name="main") from menu click on BOX 2?
2)Could I still use JAVA coded menu.html (the original menu) instead of menu.php?
3)If TABLE isn't the answer, could you recommend me the right one?

For a working demo (not mine) please refer to http://www.esat.kuleuven.ac.be/~tvandera/phpmenu/ page and see the concept that I have in my mind. Except that I would like to refrain from using FRAMEs.

Thank you.
*





Your best bet would be to use <div> tags, and dynamically load the innerHTML. You could hold the html in a database, then when the main page loads, grab all your code from the database, throw it into javascript variables and use the links to call a load function. Or you could use an iframe to throw the other pages in.

Keep in mind the following example probably doesn't work. If you want a working example I'll try to finish the script this afternoon...

CODE
<?php

//Your query would go here, and you would simply echo the results to javascript variables. I won't do all the coding in this example.

?>


<html>
<script>

//these variables have been echo'd with php, filled using a php query from the //database.
var page1 = "some html";
var page2 = "other html";
function loadContent(pagename){

if( pagename == "page1.html")
document.getElementById('content').innerHTML = page1;
//and so on, you could use a switch statement here as well.

}

</script>
<body>
<div name='content'></div>
</body>
</html>


Notice from cmatcmextra:
Use code tags for code

 

 

 


Reply

littleweseth
mike_savoie, kick me if i'm wrong - but did you say pull all the content from the database at load? If the guy has any more than say, 500k of html in his site, that's going to be a little expensive. I've never used JS, but i'm sure they provide some functions to query a database - if so, i think a better solution would be to load the index page at load time, then get the JS script to ask for the other pages as needed.

Reply

Tyssen
QUOTE(littleweseth @ Sep 9 2005, 03:42 PM)
I've never used JS, but i'm sure they provide some functions to query a database

You can't query a database with javascript - it's all client side.

QUOTE(Lozbo @ Sep 7 2005, 04:22 PM)
is this site loading only content based on the querystring and leaving all data which has loaded alone, or you mean it actually reloads the exact same page, and places the content where it belongs? Couse if so (not loading the page again), could you point out how you manage to do that (which i think you must have fixed with JavaScript)?

It is actually reloading the page each time you click on a link because the links all load up a different querystring. But I guess because the basic page layout isn't changing, it seems like the background never changes (well it seems like that for me - maybe people on slower connections will notice a reloading of the background).

The links look like this:
CODE
<ul id="links">
<li id="news"><a href="?page=news" title="News"><span>news</span></a></li>
<li id="about"><a href="?page=about" title="About GRiT"><span>about</span></a></li>
</ul>

Then the main content area is like this:
CODE

<div id="text">
<h1 id="<?echo$qString?>hd"><?echo$qString?></h1>
<?php include ("$path.inc"); ?>
</div>

I've used an if...else and a switch statement at the top of the page to work out what $path is based on the querystring. Each include then contains the HTML that is unique to each page. The links on the left are also generated the same way but they're a bit more complicated cos they're actually reading the directory and then printing the links based on which files it finds (and using the file names as the names for the links). This way the links are automatically generated each time you create a new include and the person who I did the site for doesn't have to worry about adding links into the HTML.

 

 

 


Reply

Lozbo
QUOTE(Tyssen @ Sep 9 2005, 12:00 AM)
The links on the left are also generated the same way but they're a bit more complicated cos they're actually reading the directory and then printing the links based on which files it finds (and using the file names as the names for the links). This way the links are automatically generated each time you create a new include and the person who I did the site for doesn't have to worry about adding links into the HTML.
*


Wow, that is really cool... could you explain a little more that? how did you achieve that? i supose it has something to do with php file reading functions right?

And this threads question in the first place i think has not been completely answered, so is there a way to load content into divs or table cells without reloading the rest of the page? and without having to load all content into js the first time a user enters the site?

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Pages: 1, 2
Recent Queries:-
  1. php include page target - 6.89 hr back. (1)
  2. from menu link to div page include - 38.78 hr back. (1)
  3. pull external html page into page without frames - 62.19 hr back. (1)
  4. traget same page without frames - 69.56 hr back. (2)
  5. "instead of frames" html php includes - 97.64 hr back. (1)
  6. using target feature in tables without frames - 101.07 hr back. (1)
  7. html use div instead of frames - 128.35 hr back. (1)
  8. use php div tags as target frames - 162.45 hr back. (1)
  9. page target without frames - 178.50 hr back. (1)
  10. target index page - 197.98 hr back. (1)
  11. php div instead of frame - 285.03 hr back. (1)
  12. sample index page for an opinion - 349.74 hr back. (1)
  13. target div instead of frame - 351.05 hr back. (1)
Similar Topics

Keywords : designing, index, page, target, table, frame

  1. Question About Php Includes
    How would you include a frame AROUND the page? (17)
  2. The Artists Tutorials :mysql Basic Commands
    The Artists is an online programming unit and gfx designing clan. (0)
    Let's Talk about basic mysql commands used in php. I will now show you a list of the most common
    MySQL FUNCTIONS : QUOTE mysql_connect(MySQL server name,username,password) - opens a connection
    to a MySQL server. mysql_select_db(database name,connection id) - selects a database residing on
    the MySQL server. The database name parameter referes to an active database on the MySQL server that
    was opened with the mysql_connect function. The connection identifier is a reference to the current
    MySQL connection. mysql_query(sql query) - sends a query to the currently ac....
  3. Becoming Notice: Undefined Index:
    becoming Notice: Undefined index: (0)
    I am cleaning the erros of a php script with the line error_reporting(E_ALL); in the begginig of it.
    But i am becoming several notices based on the same issue: Notice: Undefined index: add in
    C:\xampp\htdocs\webshop\index.php on line 27 27: if($_POST ) 28: {
    I do not understad why i am becoming this error. Add is a variable sent with the post method by a
    formular. Add is not declared before the POST call in index.php but it should not. If anyone knows
    the answer it would be great so i can clean those notices. Thanks in advanced.....
  4. Php Single Page W/ 'index.php?page=4' Stuff..
    Just read, cuz it's hard to explain.. (11)
    There are alot of sites out there with the index.php as the main page right? (Namely all of them)
    However when some coders create sites, they create separate entitites and pages with a ?page=4
    modifier, or whatever page they want it to be. I don't know how to do that, because each page
    is 'based' off of the index.php page, when I find an example, i'll post it here, but
    Does anyone know how to do this? Panda Like I said, this is hard to explain, so when I get an
    example, I"ll post it here. Panda....

    1. Looking for designing, index, page, target, table, frame

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for designing, index, page, target, table, frame

*MORE FROM TRAP17.COM*
advertisement



Designing Index Page With Target - - the table instead of using frame



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE