Open new window using javascript with php

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Arivu PHP

    Open new window using javascript with php

    I have to open new window without clicking link or url.. i need to
    open autometically when entered the inside of my webpage. can any one
    help this task..
  • raashid bhatt

    #2
    Re: Open new window using javascript with php

    On Aug 14, 12:18 am, Arivu PHP <arivusudar...@ gmail.comwrote:
    I have to open new window without clicking link or url.. i need to
    open autometically when entered the inside of my webpage. can any one
    help this task..
    <?php

    $url = 'http://someplace.com/someresource.ht ml';

    echo "<script>window .location=$url; <script>";

    ?>

    or Only by using php

    <?php

    $url = 'http://someplace.com/someresource.ht ml';

    header("Locatio n: $url");

    ?>

    Thanks!!!
    Raashid bhatt
    2008

    Comment

    • raashid bhatt

      #3
      Re: Open new window using javascript with php

      On Aug 14, 12:23 am, raashid bhatt <raashid_...@ya hoo.comwrote:
      On Aug 14, 12:18 am, Arivu PHP <arivusudar...@ gmail.comwrote:
      >
      I have to open new window without clicking link or url.. i need to
      open autometically when entered the inside of my webpage. can any one
      help this task..
      >
      <?php
      >
      $url = 'http://someplace.com/someresource.ht ml';
      >
      echo "<script>window .location=$url; <script>";
      >
      ?>
      >
      or Only by using php
      >
      <?php
      >
      $url = 'http://someplace.com/someresource.ht ml';
      >
      header("Locatio n: $url");
      >
      ?>
      >
      Thanks!!!
      Raashid bhatt
      2008
      if u want to open new window
      <?php

      $url = 'http://someplace.com/someresource.ht ml';
      $str =
      "<script>
      window.open($ur l,'New window');</script>";

      echo $str;

      ?>

      Comment

      • Ulf Kadner

        #4
        Re: Open new window using javascript with php

        raashid bhatt wrote:
        $url = 'http://someplace.com/someresource.ht ml';
        echo "<script>window .location=$url; <script>";
        results in wrong js-code! JS also requires string literals enclosed by
        Single- or Doublequotes.

        So long, Ulf

        Comment

        • Jerry Stuckle

          #5
          Re: Open new window using javascript with php

          Arivu PHP wrote:
          I have to open new window without clicking link or url.. i need to
          open autometically when entered the inside of my webpage. can any one
          help this task..
          >
          Whether the javascript is created by PHP or just in the file is immaterial.

          Try comp.lang.javas cript for the javascript code. Then just place it in
          the file. No PHP required.

          Just beware that it won't work for people who have disabled javascript.
          It also won't work for those with popup blockers installed.

          --
          =============== ===
          Remove the "x" from my email address
          Jerry Stuckle
          JDS Computer Training Corp.
          jstucklex@attgl obal.net
          =============== ===

          Comment

          Working...