coding links in my PHP - tag - (sorry if a bit confusing)

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


I've come up with a problem that may be directed to an HTML forum but as my
app is PHP and I'm in that mindset I'm going to start here because it's one
of those things where I think I have lots of options.

Basically I had an application website which all worked great. However, we
have now created a different version of that website for different region.
There will actually be two separately hosted database applications with
almost identical code hosted on two different sites (but still only one main
website for the company and the customer is redirected depending on which
database they need to register on)

So customers can now register on either the North database or the South
database and they get a choice when they first enter the registration

Now within the registration section there are lots of links back to the main
website. These all work fine on the original database, but because the new
database registration pages are hosted on a different database which is
stored on a different server, we now have a problem.

Lets say the original website was hosted at
and this is where the actual website is as well as the original DB is.

We now have a new DB site and these are accessed via

All links within the page were coded to be relative. So for example the
contact us page is found at and so the actual
link to the contact page was simply /contact.htm

However when we move the registration pages over to the new server, suddenly
the links no longer work because they go to

So this is the very long way of explaining what I'm trying to fix (Sorry I
just do not know all the correct terminology)

Also I'm trying to make it so that I only have to maintain one set of code.
I do not want to have different registration pages for the different regions
(especially as we get more).

So at first I thought simple, just use the BASE HTML tag to set the links as However this has the problem that other links such as form
submits they I DO want to go to the local version always go back to the main
website version.
For example, say I had a form action of ./action.php
depending on which database I want it to call the appropriate version of

So in this case I want it to take the local one.

Writing this email I realise I've just go too close to the problem and there
must be an easy way of doing this and I'm in a complete muddle. But any
suggestions are welcome and I hope I make sense.

Any guidance out there welcome.


Re: coding links in my PHP - tag - (sorry if a bit confusing) wrote:
Quoted text here. Click to load it

And your PHP question is?

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Re: coding links in my PHP - tag - (sorry if a bit confusing)

On Oct 27, 12:14=A0am, <> wrote:
Quoted text here. Click to load it
Quoted text here. Click to load it

As Jerry says - this is nothing to do with PHP.

Out of the myriad of ways in which you could have separated you
application into 2, you have chosen one of the few approaches which
doesn't work.

I'd suggest that the first thing to do is to separate out all the
pages which are common to both applications.

A quick fix would be to copy the pages across to the new site.

Alternatively use mod_rewrite to setup redirection for these sites
(but that rather depends on whether you need to propogate session

But both of these are rather messy.

A better solution would be to run he same set of pages on both sites
and design the script to behave differently at runtime depending on
the URL selected.

Alternatively separate the application into three entities - the two
seperate aplications and the common part.


Re: coding links in my PHP - tag - (sorry if a bit confusing)

OK thanks. Always looking for the easy fix but sometimes it just does not

I just had to face up to having to change the code to check which server it
was on and behave accordingly. Chore to update the code but once I settled
on doing it and started I got it done.

Thanks again.

Site Timeline