Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    May 2008
    Posts
    2
    Member #
    16868
    I'm not sure if this is the right place to post it but i figure it must be able to be done in html. I'm just wondering what the simplest way to have one page forward you to another page is. That is, when you open up say www.genericsite.com/forward it will send you to www.anothersite.com without ever even opening up www.genericsite.com/forward. Thanks in advance

  2.  

  3. #2
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    You need to send a page header to change the location. To do it with PHP:

    <?php header("Location: http://www.anothersite.com"); ?>

  4. #3
    Junior Member
    Join Date
    May 2008
    Posts
    2
    Member #
    16868
    So what does that mean? I put that code in the "head" part of the html code and it doesn't do anything.. Could you explain it as if you were talking to a complete idiot?

  5. #4
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    No, if you were doing this as a PHP page, that's all you'd put in the document. The HTTP header is different than the HTML head - it is information that is transmitted to the browser prior to it even seeing the document. It has to be done at the server side, though, thus the need to use code (in this case PHP) to do it.

    We're using the "Location" portion of the HTTP header to tell the browser to redirect to the URL you want to go to.

  6. #5
    Senior Member diddy's Avatar
    Join Date
    Jun 2008
    Location
    Sydney, Australia
    Posts
    502
    Member #
    16955
    using META tags might work, check it out below:
    HTML Code:
    <META http-equiv="refresh" content="2; URL=http://www.ASpamSite.com/">
    what you need to do, is after the conent=", where the 2 is, ad the number of seconds you want the browser to refresh the page to the new URL. Use 0 for immediate refreshment. in the URL section, add the page address of the website you wish to get refreshed to Hope this helps

  7. #6
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    Personally, if you have PHP I'd go with Steven's suggestion as it's less dependent on the browser.

    Why it is not working for you may be because you've called your file .html

    Try renaming it to .php

    Sean


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:25 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com