#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    17
    Rep Power
    0
    How would i open a new browser window (like when you use the window.open in javascript) using php? The reason i ask is because i need to open a new window when the user clicks on an image, and then the full size image is displayed in the new window. A while ago i wrote a javascript function that took in the image filename and dimensions, and then created a new window and wrote the html to it with the <img src> and everything. Of course, i can't do this now because the variables i need to pass to the function are dynamically generated, and the javascript is already written to the client's html page.

    If anyone knows any ways around this, thanks in advance!

    Comments on this post

    • Gran Roguismo agrees
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    456
    Rep Power
    14
    Can you post the javascript or URL to a demo page? Myself or someone else may be able to help you then.
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    Take your existing javascript code & then:
    (eg)
    <?php echo "<script>document.write("alert("this can be any valid javascript code with $vars if you want")")</script>";?>



    ------------------
    Simon Wheeler
    FirePages -DHTML/PHP/MySQL

    Comments on this post

    • Gran Roguismo agrees
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    17
    Rep Power
    0
    The function i had was:

    Function ViewImage(imagetitle,filename)
    {
    var ImageView=window.open("", "newwin","height=150,width=200");
    ImageView.document.write("<html>")
    ImageView.document.write("<title>")
    ImageView.document.write(imagetitle)
    ImageView.document.write("</title>")
    ImageView.document.write("<body>")
    ImageView.document.write("<img src='")
    ImageView.document.write(filename)
    ImageView.document.write("'></body></html>")
    }

    This was replicated in each page. But the variables i need to pass to this function are generated from the php code.

    Thanks for any help.

Similar Threads

  1. PHP scripts to run in Javascript continuously
    By linhardt in forum JavaScript Development
    Replies: 0
    Last Post: February 13th, 2004, 02:51 PM
  2. javascript inside php tags
    By andy123 in forum JavaScript Development
    Replies: 5
    Last Post: February 5th, 2004, 04:34 PM
  3. Javascript in PHP
    By tintintin in forum JavaScript Development
    Replies: 5
    Last Post: January 28th, 2004, 05:40 AM
  4. Passing string from PHP to Javascript
    By ka8oad in forum JavaScript Development
    Replies: 4
    Last Post: January 17th, 2004, 03:12 PM
  5. php and javascript together??
    By gursharn in forum JavaScript Development
    Replies: 9
    Last Post: January 13th, 2004, 03:40 PM

IMN logo majestic logo threadwatch logo seochat tools logo