This discussion is archived
3 Replies Latest reply: May 18, 2012 4:46 AM by Sudipto Desmukh RSS

What is the current path before the login to get (image) files?

user10047839 Newbie
Currently Being Moderated
Hello,

once I login , I can get background images providing relative paths to the tag in the page, like this:
inlineStyle="background-image:url('Images/welcome.jpg');
which points to:
C:\Myproject\public_html\Images\welcome.jpg

Note that I have not specified any "/" root in the above path. It works.

Now the problem is before logging in, that is in the login page. There, for some reasons, the above image is not found and loaded.

The curious thing is that, once I am logged in, if I go back to the initial login page with the back button of the browser, now the image is found and loaded! Of course, now the only difference is that I do have a current session, since I am already logged in .

For this reason, I suspect I have to specify a different relative path, since paths vary according to the status of the session (no session vs current session) or maybe paths need to be absolute (but different from /Images/welcome.jpg, since this does not work either)...

Do you have any idea?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points