Simple JavaScript question

SAbsar

Mac Graduate
Hi.
I just created a community website for my old school friends to share memories and stuff with each other.

Well, they all use Windows (and IE :(), so I designed the website on a Windows machine (another reason was that I forgot my laptop CHARGER at home while on vacation, and only had access to a windows machine for a whole month!).
The website forwards to a lot of pages. I mean after the user is asked for the password, he is authenticated at login.php and then forwarded to home.php and so on.
I used the following JS to forward:
window.document.URL=........

Now this function doesnt work with any mozilla browser on windows (niether on the mac). What substitute is there to make it work with ALL browsers.
 
You can also do the forward (a.k.a. "redirect") with PHP by sending the correct HTTP header:
PHP:
<?php
  header("Location: http://www.example.com/"); /* Redirect browser */
 
 /* Make sure that code below does not get executed when we redirect. */
 exit;
 ?>
This defaults to the 302 (Permanent) type of redirect... but you can also do others:
PHP:
<?php
   header("HTTP/1.0 307 Temporary redirect");
 header("Location: https://myserver.redcetus.com/otherlocation");
 ?>
This way you user does not even have to have JavaScript enabled.</div>
 
okay, so does this.location work well with IE and other windows browsers? coz I dont want others to be kept away from the webstie

tommy thats nice, but it will just be easier to substitute a JS for a JS :)
 
Back
Top