Noob needs a slap, or help... whichever you can provide

:smiley:

hi!

ok i have a script i obtained. i got it all going, BUT… i couldnt work out why its images dont work… or any of the /admin /etc etc etc linnks…

i figured i would just go in and manually set the URL and hey presto it would be fixed… but i cant find ANY script that has any of the source info in it?? i have read EVERY php file in the folders. not knowing what i am looking for sucks a snip

if i could just get a clue as to what to look for, or some advice on what to do…?
some code below? dont know if it is useful at all…

help us obiwan kenobi… you’re our only hope!

<tr> <td><IMG SRC="/images/template_04.jpg" WIDTH=770 HEIGHT=97 ALT=""></td> </tr> <tr> <td><TABLE WIDTH=700 BORDER=0 CELLPADDING=0 CELLSPACING=0> <TR> <TD> <a href="/"><IMG SRC="/images/template_06.jpg" ALT="" WIDTH=56 HEIGHT=22 border="0"></a></TD> <TD> <IMG SRC="/images/template_07.jpg" WIDTH=6 HEIGHT=22 ALT=""></TD> <TD> <a href="/show/all.html"><IMG SRC="/images/template_08.jpg" ALT="" WIDTH=56 HEIGHT=22 border="0"></a></TD> <TD> <IMG SRC="/images/template_09.jpg" WIDTH=6 HEIGHT=22 ALT=""></TD>

Hi there,

I would imagine it’s because you are running this from localhost/project/ or similar (the page that you view these links on is not in the root of the host). If that is the case, then the reason that the links aren’t working is because they are prefixed with a “/”. This tells the browser to truncate anything after the host and then add the link e.g:

http://www.mysite.com/a-folder/index.html

With a link of “/contact.html”, will go to:

http://www.mysite.com/contact.html

Whereas a link of “contact.html” would go to:

http://www.mysite.com/a-folder/contact.html

So either change the links to “/myfolder/the-link…” or remove the beginning “/”.

If you are still confused (or more confused!) let me know.

yes, i kinda thought as much. but i cant actually see any code or file to change this information.

i want to just remove all the “/”

but as i said i have looked through the code and cannot for the life of me see where the code is.

that “source” i pasted i had to use chrome to display. i was under the impression there shoudl be a config file somewhere. but i opened each .php and see no “images” or paths at all… as i said im a total noob, so i was looking for something familiar to me from html 1.0 lol

if i could just find where to change it i would be set!!

thanks so much for your help! (: at least i know im on the right track.

I’m guessing you aren’t using your own code, or you’ve just forgotten it very well.

If you are using some sort of framework / web software there may well be a config.php or configuration.php (something along those lines) somewhere that will store your web address - some will have site url (locally would be “http://localhost/myproject/”) and a ‘root path’ or something similar (which would be “/myproject/”). If these configurations are available, then the echoing of the image/link paths should automatically prepend the links with the value given in those configuration variables. (The configs could be in a MySQL table by the way, if there is one).

Let me know how you get on.

Sponsor our Newsletter | Privacy Policy | Terms of Service