Forum Moderators: coopster

Message Too Old, No Replies

Constants working locally but not on the server

constants

         

Matthew1980

5:53 pm on Sep 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello people of webmaster world.

I have a localhost issue I think, something probably not set in the php.ini file or something like that.

first call in the index file is:-

include("setup.php");
//in this file there is a dbcall that uses the SERVER constant to switch a ternary op ie:-

SERVER ? "localuser":"hostuser"; and the same for pass & db selection.

this bit is further down the index file
define('SERVER', '0'); // 0=localserver 1=hostserver

i cannot seem to get this to work the same way as it does on my localserver. I am running php 5.0.5 &Apache/1.3.33 (Win32) PHP/5.0.5. On the host server I am running php 5.2.5

I am just hoping as it is a simple fix, been trying to fix this for 3 days.

Thank you in advance.

MRB

Tommybs

4:10 pm on Sep 19, 2009 (gmt 0)

10+ Year Member



Have you tried defining SERVER before you do the include? The if statement is probably assigning it to local as it hasn't been defined elsewhere yet. Try

define('SERVER','1');
then
include('setup.php');

Matthew1980

8:00 pm on Sep 19, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



TommyBS,

Thanks for the reply, it shows what a fresh pair of eye's can achieve. Works nicely now. Now for the next part!

Cheers,

MRB