Help with HTTP_HOST ?
Posted 07 July 2006 - 01:33 PM
We are running some project management software that is web based and use's php, we have access to it inside work on a server, the server address is say http://220.127.116.11:80, we can also access it from home on a pass through which is say http://18.104.22.168:80, now the problem is if you work on a project from home and get email notification to your work email that a change has been made, php send out a mail with a link to click to see the changes made but that link is the http://22.214.171.124:80 link and not the http://126.96.36.199:80, so in work you cant click the link to go to the internal server because the 'HTTP_HOST' takes the link from where the web url is ? How can i force the 'HTTP_HOST' to allways be http://188.8.131.52:80 ?
Posted 07 July 2006 - 02:32 PM
<?php print_r($_SERVER); ?>
The HTTP_HOST value can be overridden, but you probably don't want to do that because if the value is used elsewhere it's more than likely that the value you want is the original one.
<?php $_SERVER['HTTP_HOST'] = 'foo'; ?>
You can also put it in a constant yourself for use throughout your script
define('TRUE_HOST', '195.x.x.x'); echo TRUE_HOST;define()
Harcoding the value in the section of the script that creates the link for the email is also an option if it's unlikely that you need the true value anywhere else.
EDIT: You may find it more convenient to create two links. One that's for accessing from home and one for accessing from work. So that if the email is accessed from home you'll still be able to have easy access.
Posted 10 July 2006 - 11:53 AM
to join the string text on to your variable string.
Posted 10 July 2006 - 12:20 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users