Professional Web Applications Themes

php version of java : self.location.replace("www.url.com"); ?? - PHP Development

Hi, inside html, before <head>, you can put something like this : <script type="text/javascript"> self.location.replace(www.url.com/newpage.htm); </script> which basically instructs the browser to start loading another page asap (www.url.com/newpage.htm); This has some limitations, especially when the user has restricted use of java etc. Is there a way to do this in PHP ? like, if there is a link to link.php, this page then starts loading www.url.com/newpage.htm instead ?...

  1. #1

    Default php version of java : self.location.replace("www.url.com"); ??

    Hi,

    inside html, before <head>, you can put something like this :

    <script type="text/javascript">
    self.location.replace(www.url.com/newpage.htm);
    </script>

    which basically instructs the browser to start loading another page asap
    (www.url.com/newpage.htm);
    This has some limitations, especially when the user has restricted use of
    java etc.

    Is there a way to do this in PHP ?
    like, if there is a link to link.php, this page then starts loading
    www.url.com/newpage.htm instead ?


    Peter Guest

  2. #2

    Default Re: php version of java : self.location.replace("www.url.com");??

    Peter Van Hove said the following on 02/06/2005 19:36: 

    Please note, there is an *enormous* difference between Java and
    Javascript! They are not related in any way. You are talking about
    Javascript.
     

    If you use:

    header("Location: http://example.com/blurgh.htm");

    before *any* other script output, then this will redirect the user's
    browser. Note that the URL *must* be absolute, i.e. you cannot simply
    use something like /blurgh.htm.


    --
    Oli
    Oli Guest

  3. #3

    Default Re: php version of java : self.location.replace("www.url.com"); ??

    Thanks for the java vs javascript correction.

    What do you mean before any output ?
    Do you mean before any html is echoed or printed ?
    I mean, I can still do php internal scripting before I call header() ...
    right ?




    "Oli Filth" <co.uk> wrote in message
    news:NtIne.5764$ntli.net... 
    >
    > Please note, there is an *enormous* difference between Java and
    > Javascript! They are not related in any way. You are talking about
    > Javascript.

    >
    > If you use:
    >
    > header("Location: http://example.com/blurgh.htm");
    >
    > before *any* other script output, then this will redirect the user's
    > browser. Note that the URL *must* be absolute, i.e. you cannot simply use
    > something like /blurgh.htm.
    >
    >
    > --
    > Oli[/ref]


    Peter Guest

  4. #4

    Default Re: php version of java : self.location.replace("www.url.com");??

    Peter Van Hove said the following on 02/06/2005 19:53: 

    Yup.
     

    Yup. Also make sure that there are no characters (including whitespace)
    before the opening <?php delimiter.


    --
    Oli
    Oli Guest

  5. #5

    Default Re: php version of java : self.location.replace("www.url.com"); ??


    It work but one more question,
    because in the end the user's browser is responsible for loading the new
    page, is this guaranteed to work with all browsers ?
    Or so some browsers get stuck at this point ?


    Peter Guest

Similar Threads

  1. "extract pages" greyed out (version 9pro...but also in version 7!)
    By Darren_Linkin@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 2
    Last Post: August 3rd, 03:56 PM
  2. Replace(myVar,":",":<br>","all") does not work
    By xSist in forum Coldfusion - Getting Started
    Replies: 3
    Last Post: May 24th, 06:46 PM
  3. "replace pages" / "rotate pages" orientation issue
    By mr_feroz@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 0
    Last Post: April 23rd, 04:38 PM
  4. FScommand("Exec","myapplication.exe") doesnot work on Trial version MX?
    By yn webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 1
    Last Post: January 13th, 08:45 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139