User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 429,842 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,739 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Redirect page function problem with Firefox browser

Join Date: Sep 2005
Posts: 689
Reputation: digital-ether has a spectacular aura about digital-ether has a spectacular aura about 
Rep Power: 6
Solved Threads: 41
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Practically a Master Poster

Re: Redirect page function problem with Firefox browser

  #3  
May 10th, 2008
Originally Posted by tanha View Post
Hi everybody,
I am using a java script function which redirect to the page according to the given parameter, and it is working as desired in IE, but I found that it not work with Firefox browsers, so some one plz guide me how it is possible to have the same function which could work on IE and Mozilla firfox.

The function code:

<?php
function reDirect($page)
{
     $s = "<script language = 'javascript'>
     window.navigate('$page');
     </script>";
     return $s;
}

Thanks


Unless there is a specific need for using javascript, you could redirect the browser using HTTP headers.

  1. <?php
  2.  
  3. function reDirect($page)
  4. {
  5. header("Location: $page"); // tell the browser to go to the new location..
  6. die; // die so we can flush http output immediately
  7. }
  8.  
  9.  
  10. ?>
Last edited by digital-ether : May 10th, 2008 at 5:05 am.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote  
All times are GMT -4. The time now is 6:32 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC