GStwin.com GS500 Message Forum

Main Area => Odds n Ends => Topic started by: john on June 20, 2006, 12:47:47 AM

Title: php experts - question
Post by: john on June 20, 2006, 12:47:47 AM
I need/want to add an index.php file in the old forum folder to redirect to this new forum.  How do I make it?  Can I just use htm code to redirect?  If not what is the code needed to create this file?  any help is appreciated.
Title: Re: php experts - question
Post by: makenzie71 on June 20, 2006, 12:55:15 AM
Just use standard code...same as any other redirect or "link"...or, anyway, I can't see why that wouldn't work.  It's what we did with pacnet.
Title: Re: php experts - question
Post by: Mitch on June 20, 2006, 06:28:25 AM
This would be probly the easiest
or if you want to make it php just slap the php stuff and make it all echo statements.
<html>
<head>
<title>redirect</title>
<META HTTP-EQUIV="Refresh"
      CONTENT="1; URL=whereto.html">
</head>
<body>
</body>
</html>
Title: Re: php experts - question
Post by: john on June 20, 2006, 06:50:49 AM
Quote from: Mitch on June 20, 2006, 06:28:25 AM
This would be probly the easiest
or if you want to make it php just slap the php stuff and make it all echo statements.
<html>
<head>
<title>redirect</title>
<META HTTP-EQUIV="Refresh"
      CONTENT="1; URL=whereto.html">
</head>
<body>
</body>
</html>


Thanks.  That worked like a charm.  I didn't realize that you could use all standard html code in a .php file.
Title: Re: php experts - question
Post by: calamari on June 20, 2006, 10:13:46 AM
to reinforce the redirection, I always use a combination of meta and javascript:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=windows-1250">
  <title>redirecting...</title>
  <meta http-equiv="refresh" content="0.5;url=http://gstwins.com/gsboard/">
  <SCRIPT LANGUAGE="JavaScript">
  <!-- Begin
  redirTime = "500";
  redirURL = "http://gstwins.com/gsboard/";
  function redirTimer() { self.setTimeout("self.location.href = redirURL;",redirTime); }
  //  End -->
  </script>
  </head>
  <body onLoad="redirTimer()">
redirecting...
  </body>
</html>


or you can always use .htaccess  :icon_mrgreen:
Title: Re: php experts - question
Post by: john on June 20, 2006, 11:16:29 PM
Yea.  htaccess has a lot of advantages that I really haven't explored.  I tried your code and it also worked.  If you say it's better then I believe you.

I notices quite a few requests for the old php board requesting the index.php file.  It went nowhere.  Now at least it will redirect here.