Jump to content

Oscommerce ! $_SERVER['HTTP_HOST'];


eth0g

Recommended Posts

Hi all,


I am building a virtual appliance of Oscommerce. Which is a shopping cart platform for building online stores (built with PHP and html). I have built a similar Mambo virtual appliance, and with mambo i managed to fix a problem which had me stumped for a while, but not with oscommerce.

Because the ip address can vary based on the preferences of the user who loads the virtual appliance, i need Oscommerce to dynamicly pick up the ip address that server currently holds. With mambo i changed the live site path to the following:

[b]$mosConfig_live_site = $_SERVER['HTTP_HOST']; [/b]

(wheras ussualy this would be similar to this:
$mosConfig_live_site =  'http://www.bigshop.com.au' ; ) 


So my question is how do i do this for oscommerce. I need to replace the "http://www.yourdomain.com"  below with somthin like $_SERVER['HTTP_HOST']; ?????? . I have tried lots of variations of what i used for mambo to no avail.


Line i need to fix:
[b]
define('HTTP_SERVER', 'http://www.yourdomain.com'); // eg, http://localhost - should not be empty for productive servers[/b]



Cheers for any help, hope someone who is a PHP expert can sort this form me.

Keith
Link to comment
Share on other sites

Have you tried this:

[code=php:0]define('HTTP_SERVER', 'http://' . $_SERVER['HTTP_HOST']); // eg, http://localhost - should not be empty for productive servers[/code]

The reason being that HTTP_HOST doesn't include the leading "http://"
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.