1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

open link with firefox in php

Discussion in 'PHP' started by guif, Feb 6, 2009.

  1. guif

    guif New Member

    Joined:
    Jul 25, 2008
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    I have a row in mysql that the content is:

    insert into Link (Id_Link,Link) values (1,'//server/folder/documentum.doc');

    I would like to make a link and I put this:

    <a href="file:///<?php echo $row['Link']; ?>" target="_blank" title="<?php echo $row['Link']; ?>">

    the link as: file://///server/folder/documentum.doc That's right!

    why i can't open the DOC file directly with my Firefox??
    If I copy this direction and put into the toolbar the file is open!
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,285
    Likes Received:
    364
    Trophy Points:
    83
    file:///

    and not

    file://////

    Try if it works
     
  3. guif

    guif New Member

    Joined:
    Jul 25, 2008
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    for a path in another server it's necesary put 5 "/" and 3 "/" for a local path.

    If i put file://///server/folder/documentum.doc firefox open correctly, but the problem is the link.
    I see the correct link but it doesn't open.
     
  4. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    If the link displays as file://///server/folder/documentum.doc then that must mean <?php echo $row['Link']; ?> prints file://///server/folder/documentum.doc, and since your href specifies file:///<?php echo $row['Link']; ?> then you'll be getting file:///file://///server/folder/documentum.doc.

    So try not adding file:/// yourself, then it should work.
     
  5. guif

    guif New Member

    Joined:
    Jul 25, 2008
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    0
    are you sure??? I think that the problem is Firefox.

    In the taskbar of Firefox i see file://///server/folder/documentum.doc this is correct, no?
    If I set left button and "open in another tab" the file is open!!!! But if I make a simple click (the right button) the document don't open.
     

Share This Page