FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Loading time?





NewGuyinTown
Hello, guys... I don't really have any good experiences in web design, but I do have programming experiences. I know the following computer languages: HTML, ASP, JAVA, CSS, and javascript, but I have not designed any pages efficiently using ASP (a forum that is horribly done).


Objective: I want to load the site's logo, navigation bar,... things that will be loaded over and over for every page.

Difficulties + Problems: I used javascript, ( document.write("<BR>") ), to load the navigation bar and site logos. It seems like it has to load the whole javascript file or download the file before it starts loading the script. Doing the way I did it, I see a colored background for 5 seconds before the site loads. I am wondering if there is a better way to do this and have a better loading time. I do not like frames, but if it is the only way to and does the job, I probably use it. I do not like editing the navigation bars, site logos, etic. on every page.

Thank you,
Simon Tang
Marston
Code:
<? include ('yourfile.php') ?>
Use PHP, not JavaScript...
virtualpointer
NewGuyinTown wrote:
Hello, guys... I don't really have any good experiences in web design, but I do have programming experiences. I know the following computer languages: HTML, ASP, JAVA, CSS, and javascript, but I have not designed any pages efficiently using ASP (a forum that is horribly done).


================================================

It sounds good enough !

================================================


NewGuyinTown wrote:
Objective: I want to load the site's logo, navigation bar,... things that will be loaded over and over for every page.



================================================

Are you trying to build a website by your own ?

================================================

NewGuyinTown wrote:
Difficulties + Problems: I used javascript, ( document.write("<BR>") ), to load the navigation bar and site logos.


================================================

Why did you choose javascript to do that ?
There are other ways to do it. The best way I think you'd better write a header and footer files seperately if you planed to put the same logon and navigation bar on each page.

================================================
NewGuyinTown wrote:
It seems like it has to load the whole javascript file or download the file before it starts loading the script. Doing the way I did it, I see a colored background for 5 seconds before the site loads. I am wondering if there is a better way to do this and have a better loading time. I do not like frames, but if it is the only way to and does the job, I probably use it. I do not like editing the navigation bars, site logos, etic. on every page.

================================================

Besides using frame, you can also use php, cgi or asp to realize what you said.

Cheers!
NewGuyinTown
virtualpointer wrote:

Are you trying to build a website by your own ?

Yes... I am building a website on my own.

virtualpointer wrote:

Why did you choose javascript to do that ?
There are other ways to do it. The best way I think you'd better write a header and footer files seperately if you planed to put the same logon and navigation bar on each page.

The javascript codes are on separate files: top.java, bottom.java. I just load the script on each of my page. Unless you're talking about using HTML, <head> or something else, to do... Javascript is my dominant computer language that I can use for web design, but I rarely see JAVA or C++ are used for designing a webpage.

Marston wrote:

Code:
 
<? include ('yourfile.php') ?>

Use PHP, not JavaScript...


Thanks... I'll try php to resolve the issue when I have the time to make changes.

Thanks guys.
NewGuyinTown
I have a few run-time questions with sessions and cookies?

Does it take long to load a webpage with:

sessions with variables defined?
sessions with no variables defined?

This is my script for the header file:
Code:

<? session_start(); ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" media="screen" href="../css/tab.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" media="screen" href="../Tab Files/v1.css" />
<center><div id="header"><ul><table width="700" align="center" cellspacing="0">
<tr align=center><td align=center><li><a>Malden High School</a></li></td></tr>
</table></ul></div>

<table width="700" align="center">
<td align="left" valign="top" width="150" height="100%">
<?php
//$user = $HTTP_COOKIE_VARS["user"];
if( !session_is_registered("user") ){
     ?>
     <font size="2">
     <form action="log.php" method="post">
     <b>Login:</b><br />
     Username:<br />
     <input type="text" name="username" size="15"><br />
     Password:<br />
     <input type="password" name="pass" size="17"><br />
     <input type="submit" value="Login"><br />
     <div align="right"><font size="1px"><a href="registration.php">Register</a></font></div>
     <?
}
else{
     echo "Welcome, " . $_SESSION["user"] . "."; ?>
     <div align='right'><font size=1px><a href='logout.php'>Logout</a></font></div><?
}

?>

Each page includes the header file.

I formerly did the login session with cookies...
Just by replacing cookies with sessions, I experience a slower loading speed and encounter blank pages.
Is that true or is it just me...?

Click here to see the website I'm working on. Explore it and tell me if the page loads quickly or not and if there any problems loading the pages.

To test the login:
Username: tester
Password: testing

BTW how do I clear all the variables in a session or end a session?

Thank you.
kv
Use these functions

session_unset();
session_destroy();

to remove the session.
Related topics
page loading time
A script for Loading
Fatster flash loading.
Site Loading Time (and size)
Does any know how to create a loading screen in Flash?
Size, loading time and design...?
Speeding Up Starup Taskbar Items Loading...
Loading bar in Liberty Basic
Problem Loading Page
certain web sites re' not loading
Loading Pages?
MYPNet
Suicidio Colectivo Basket Club
I need a loading bar that appears while (read inside)
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.