[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • Last Modified:

path to element

Hi,

I am using a CMS system which generates an html page dynamically. I echo'd out the path it thinks it's using and I'm left with the following:

    /home/mysite/public_html/index.php
 
I have an applet class sitting at:

    public_html/test/applet.class

so shouldn't I be able to link to it directly in the page by doing:

    <applet code=test/applet.class width=400 height=400></applet>

I can't seem to resolve the path....

Thanks
0
DJ_AM_Juicebox
Asked:
DJ_AM_Juicebox
1 Solution
 
hieloCommented:
Using the absolute path on the links will not help because only the server knows how to search for it. You need to use relative paths. Try:
$_SERVER['SCRIPT_FILENAME']

EX:
<a href="<?php echo($_SERVER['SCRIPT_FILENAME']) ?>">Some link </a>
0
 
darron_chapmanCommented:
<applet code="applet.class" codebase="test/" width=400 height=400></applet>
0
 
DJ_AM_JuiceboxAuthor Commented:
@darron_chapman:

that was it

Thanks all
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now