Activity Stream
48,167 MEMBERS
62513 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 7 of 7
  1.     
    #1
    Member
    Website's:
    Nerdy-Tutorials.com Mp3viddown.com Filmlab.eu

    Default Javascript Redirect help

    Hello can someone please help me out redirecting by using Javascript?

    not for my site, but would like to create a script.

    I Would like

    Site.com/index.php?something=*

    TO

    site.com/

    Thanks!
    ibby Reviewed by ibby on . Javascript Redirect help Hello can someone please help me out redirecting by using Javascript? not for my site, but would like to create a script. I Would like Site.com/index.php?something=* TO Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Too busy :|
    Website's:
    L337Fx.com BeastieBay.net
    You're trying to track clicks or something ?

  4.     
    #3
    Member
    Website's:
    eotips.com

  5.     
    #4
    Member
    Website's:
    Elite.SO Defendos.com Motionite.com
    Why would you use JS for this?

    Defendos BETA3 Released! Thread - Official Website

  6.     
    #5
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    ^ Exactly, htaccess would do it more efficiently

    Anyway, add this php code in the document and it will work (code is untested but should work)
    PHP Code: 
    <?php
    if (isset($_GET['something'])) {
    $baseurl 'http://' $_SERVER['HTTP_HOST'];
    echo 
    '<script language="javascript" type="text/javascript">window.location.href="' $baseurl '";</script>';
    }
    ?>

  7.     
    #6
    Member
    Website's:
    Elite.SO Defendos.com Motionite.com
    I would use header redirect

    Defendos BETA3 Released! Thread - Official Website

  8.     
    #7
    Respected Member
    If headers in his code weren't already sent...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. JavaScript help
    By Keosoft90 in forum Web Development Area
    Replies: 4
    Last Post: 4th Sep 2012, 04:23 PM
  2. [WordPress] How to do this in javascript/php?
    By thizzladen in forum Web Application/Script Support
    Replies: 0
    Last Post: 16th Mar 2012, 12:05 AM
  3. JavaScript Kit
    By Daniel in forum Useful Sites
    Replies: 0
    Last Post: 7th Mar 2011, 06:48 PM
  4. Help About JavaScript
    By macypro in forum Technical Help Desk Support
    Replies: 1
    Last Post: 7th Dec 2010, 12:23 AM
  5. help with some javascript
    By bumilad20 in forum Web Application/Script Support
    Replies: 2
    Last Post: 3rd Jun 2010, 05:01 AM

Tags for this Thread

BE SOCIAL