-2

Need to open an htm page that is located on my local disk.
I'm running an application using php and xampp server.
I've tried in every way and not make it.
My application path is C:\xampp\htdocs\portal
My htm file path is C:\sistemas\test.htm

I can't move my test file and put it into portal folder.
when I click on the link just nothing happens.

here's my code

<li>
    <a target="_new" href="file:///C:/SISTEMAS/test.htm"> 
      <span class="ui-icon ui-icon-suitcase">&nbsp;</span> Test 
    </a>
</li>

I've tried in Firefox 25 and IE10. Same result.

bgs
  • 3,061
  • 7
  • 40
  • 58
martin.softpro
  • 435
  • 6
  • 21
  • Could it be that there's nothing between your tags? – scrblnrd3 Nov 14 '13 at 12:43
  • This is not related to PHP in any way. You can't get out of a virtual host (which probably points to `C:\xampp\htdocs\portal`) with the Apache default settings. Please get yourself an overview on basic Apache server configuration and how to work with vHosts. Or just move that file to the `portal` directory. – feeela Nov 14 '13 at 12:43
  • did you try anything else then your file ? may be google.com ?? see if it opens ! – Ronak K Nov 14 '13 at 12:45
  • 1
    Aside from permissions problems, virtual host access problems, and the missing text in your anchor, maybe your file:// URI needs some love. See: http://stackoverflow.com/questions/5317834/workaround-for-href-file-in-firefox – bishop Nov 14 '13 at 12:45
  • 1
    @martin.softpro Don't paste that code into comments, but edit your question! – feeela Nov 14 '13 at 12:47
  • "http://google.com" works good. – martin.softpro Nov 14 '13 at 12:54

1 Answers1

3

You cannot actually do like this but I guess your requirement is just including the content of test.htm. Using php your code can go something like this.

<li>
    <a target="_new" href="test.php"> 
      <span class="ui-icon ui-icon-suitcase">&nbsp;</span> Test 
    </a>
</li>

and test.php would be including the content of test.htm

<?php require('../../sistemas/test.htm');  ?>
Asim
  • 452
  • 5
  • 18
  • I don't think you can do it in any other way. At least without using a server scripting language like php or asp. – Asim Nov 14 '13 at 14:05