View Full Version : Bad urls with Dynamic Ajax Content script

01-03-2007, 10:49 PM
1) Script Title:
Dynamic Ajax Content

2) Script URL (on DD):

3) Describe problem:
I am using this script to show the forum which is located on 'domainname'/folder1/index.php on the server.

The page is showing up, but now the links on the forum is pointing to the folder I am calling the forum from ('domainname'/folder2/index.php) not the folder where the php file is located (folder1).

i.e. the url for logging in should be: 'domainname'/folder1/login.php. But with this script, the url becomes 'domainname'/folder2/login.php, which obviously doesn't work, since that file is located inside folder1.

Is there a way to set the links in the called php file to point to another directory than the directory where the page is called from?

I was originally using the SSI Iframe script, but the height resizing doesn't work in Opera, but this script works.

01-04-2007, 05:36 AM
Sounds like the paths are being correctly interpreted. If you have a link like so:

<a href="login.php">Login</a>

on a page in folder2, folder2 is here the browser should ordinarily look for it.

I'm not sure if this will work, but it is worth a shot. First off, you will need to specify the complete path to any pages, external css files, and external javascript files not to be loaded in the base path. With that in mind, try this - put a base href tag in the head of your 'top' page (just below the <title></title> tag, and if your page is organized correctly, after any meta tags which should immediately follow the title tag). I'm talking about on the page with the Ajax Content Script on it. From what you are saying, the base href tag should be like:

<base href="http://www.domainname.com/folder1/>

Now, of course, any other hrefs and paths on that 'top' page that should not start with that href should have their complete paths spelled out. The only other alternative (short of moving your Ajax page to folder1) I can think of would be to make sure that all of the external pages have all of their links' complete paths spelled out on them.

01-04-2007, 07:49 PM
That worked for the Ajax Includes script (http://www.dynamicdrive.com/dynamicindex17/ajaxincludes.htm) (it did not work for the above script) but when I click on a link inside the div, the new page that loads is not loaded into the div, but opens the page in full screen. Is there a way to make everything open in the same div?

01-05-2007, 05:01 AM
ove.a - maybe you can make forum link starting with "<a href="javascript:ajaxpage" too (I mean that forum link should be just like "menu" links?

Maybe it'll work your way. :)