8 Years
Discussion Span
Last Post by etftw

Hey Marty6,

This will more than likely just be because of how you have coded the links, I imagine they look like this:

<a href="http://localhost/">Link</a>

All you have to do is replace localhost with the actual domain name of the website (in the source code files) and things should be fine.


actually the links that the person before me put into the code look something like..

        echo '<a  href="'.$_SERVER['PHP_SELF'].'?registration_tag=1">Sign up</a>';

and when I look at the source directly from the website through my browser it comes up as:

<a  href="/index.php?registration_tag=1">Sign up</a>

unfortunately the site is not officially launched yet so I'm not allowed to circulate the url just yet. :(

I believe the reason why they want to echo the url dynamically/code generated, is that this is going to be in a side bar that might be located on multiple pages, not just on the index.php, so they want it to link to the specific page you're currently on not just to the index.

but for now I'll hard code the links just so we get something working in the meantime (we haven't added the other pages that need the sidebar yet).


If they just want to attach the query string to the current file in the links they don't need to use PHP_SELF but can just specify the query string like this:

        echo '<a href="?registration_tag=1">Sign up</a>';

sweet, I'll do that instead..

also I just found the problem, apparently the person who was coding the site before me decided to hardcode a global variable with localhost and then buried it in a side file that was accessed by another side file and that value would override pretty much everything.. and that was the reason why everything was being redirected to localhost no matter what I did. And he never told anyone about this, or that it would be needed to be changed to the host name when the site goes live.

thanks for your help :) I'll definitely use the shorter link you suggested.


If you can then try to use full links if you can, if I'm correct it is better for SEO.

But the way I have showed you will be more than sufficient for providing the functionality to the end-user :)

Glad it is all working for you now anyway.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.