Click to See Complete Forum and Search --> : Show me the path to greatness


goofy78270
05-20-2008, 06:22 PM
:confused:
I am new to the Web development world and I am looking to create a website as listed below. I would appreciate any direction or examples that anyone could give.

I would like to create a frame website with 3 frames:
1. A title bar that never change - simply holds the department name and an image

2. A Left side Menu bar that dynamically pulls in a list of products from an excel sheet or database and creates a link to documents containing the name in the title.
ie.. C02, C03, C04 is pulled into the menu ber from a database. The C02would then link to a document on a shared drive named C02 - Current Profile

3. Once a link is selected, the C02 from above, the document referenced, should be opened in the third frame. These documents are currently a .doc or .xls format.

I would like the documents to open within the frame and not using the default application if possible.

ryanbutler
05-21-2008, 12:54 PM
It would be almost easier to avoid frames and construct a simple table or CSS layout to accomplish this. You could create a simple table that had a header for your logo, and then a row that contained your navigation and content area.

<body>
<table width="760" cellspacing="0">
<tr>
<td>MY LOGO HERE</td>
</tr>
<tr>
<td>NAVIGATION HERE</td>
<td>CONTENT AREA HERE</td>
</tr>
</table>
</body>

Pulling the links into your navigation section from a database would require a server-side language, SQL query and a loop. You could probably Google and find that answer pretty easy or post back with the language and I could probably give you a start.

If you want the stuff from Excel and Word to appear as web pages, it would be the easiest just to copy the stuff out and paste in separate web pages.

goofy78270
05-21-2008, 01:43 PM
I created an export from the DB that creates seperate documents for the items I desire.

How could I write a script that will fill in a menu or body of a webpage, with the files located within a folder? Also, would it be possible to assign an image to the file based on the extention, ie... text.doc shows a doc.gif and .xls shows a xls.gif?

ryanbutler
05-21-2008, 04:23 PM
The easiest way to do part one would be to create a database table with three fields:


ID
FileLocation
FileDescription


Make ID the primary key, FileLocation will be the path to the folder from the web page that queries for it and FileDescription will be the textual description for the link. I really don't like to write a script w/out knowing the language but I'll assume it's PHP/MySQL. In the web page where you want the menu to show you'll write this script:

<?php

//declare database connection string

$db=mysql_connect("localhost", "<username>", "<password>") or die ("Can't connect to the database because: ") . mysql_error());

//select the database to use
mysql_select_db("my_database");

//declare query variable

$sql="SELECT * FROM Navigation";

//run the query against mysql result function

$result=mysql_query($sql);

//loop through the array of result

while($row=mysql_fetch_array($result)){
$FileLocation=$row['FileLocation'];
$FileDescription=$row['FileDescription'];

//output the results

echo "<a href=\"" . $FileLocation . "\">" . $FileDescription . "</a>\n";
}
?>

To match up the image to each one, I think what might work is to have an additional field in the database table that went to a path with the image icon for either a word or excel document and include that in the loop and output. So you would just add an extra line inside the loop called $ImageIcon. Then append inside the output where ever you want it to appear.