The Castle Doctrine Forums

Discuss the massively-multiplayer home defense game.

You are not logged in.

#1 2014-03-04 12:53:46

it_twit
Member
Registered: 2014-03-04
Posts: 3

Server Help?!?!?!?!?!?

I Have The MySQL Server Setup But Whenever I Try To Add A Ticket I Get The Error " Bad referrer header " Can Anyone With Experience With PHP Help Me?

Offline

#2 2014-03-04 14:35:48

PlasmaChroma
Member
Registered: 2014-02-01
Posts: 39

Re: Server Help?!?!?!?!?!?

It's something to do with checking where a request came from.  In this case I think somewhere you have something off about the hostname somewhere, or the IP you are accessing it from or running the server on, possibly in the web server config or the machine itself.  I think as a workaround you can perhaps turn off or comment out this referrer checking to just make it work, but at the risk of some other vulnerabilities.

I had this problem at some point but I can't recall the exact solution I used.

Offline

#3 2014-03-04 16:19:02

iceman
Member
Registered: 2013-11-09
Posts: 687
Website

Re: Server Help?!?!?!?!?!?

I had this same problem when setting my server on 000webhost (I'm not sure if that's what you're using).  The duct-tape solution is to do what PlasmaChrona said - open up server.php, search for "Bad referrer header".  It will be a line that says "die "Bad referrer header" " or something - just put // before that line to make it a comment, and the server will work.

If you're using 000webhost, there'll be another problem you'll most likely run int, where it takes forever to load, then doesn't load, and you get an email about long queries from 000webhost.  If that happens, search for "function cd_getTotalSpace", and on the line just below that, type "return 0;"  Another duct tape fix, but I haven't seen any bad side effects from doing it yet.


Fortress Theory Mod - New objects, tools, and paintings!

I keep dying of a natural cause - Stupidity
The biggest thing that Castle Doctrine has taught me is that the price of your house is proportional to the stupidity of the mistake that kills you.

Offline

#4 2014-03-05 08:24:07

jasonrohrer
Administrator
Registered: 2013-04-01
Posts: 1,235

Re: Server Help?!?!?!?!?!?

You need to make sure the URL that you're adding tickets from (whatever the admin interface is loaded as in your browser address bar) matches the server URL in the settings.php file.

Some web hosts may automatically redirect you to the "www." version of the url.  If that's the case, make sure the "www." version appears in settings.php.

No need to muck around in the server.php file to fix this!  And really important to leave this check in place for security reasons.

Offline

#5 2014-03-05 11:35:14

it_twit
Member
Registered: 2014-03-04
Posts: 3

Re: Server Help?!?!?!?!?!?

Is There Any Way To Automate This Process? - I'm Aiming At Creating A Public Server

Offline

#6 2014-03-05 11:40:42

it_twit
Member
Registered: 2014-03-04
Posts: 3

Re: Server Help?!?!?!?!?!?

jasonrohrer wrote:

You need to make sure the URL that you're adding tickets from (whatever the admin interface is loaded as in your browser address bar) matches the server URL in the settings.php file.

Some web hosts may automatically redirect you to the "www." version of the url.  If that's the case, make sure the "www." version appears in settings.php.

No need to muck around in the server.php file to fix this!  And really important to leave this check in place for security reasons.

Thanks - Seems To Be Working Now big_smile

Offline

#7 2014-03-10 11:22:46

jasonrohrer
Administrator
Registered: 2013-04-01
Posts: 1,235

Re: Server Help?!?!?!?!?!?

You mean automating account creation?

It would be pretty easy to write a little PHP script that lets people type in their email address in a form and "create account."

Offline

Board footer

Powered by FluxBB 1.5.8