Posted by Andy
2016-07-01

Hi Tom,

Even I changed both of the codes:
<script type="text/javascript" src="http://www.uswebcity.com/polls2/jquery.js"></script>
<script type="text/javascript" src="http://www.uswebcity.com/polls2/ajax-poll.php"></script> .

It still does not work (http://www.uswebcity.com/polls2/poll-simple/polltest.html). If you click on the URL: http://www.uswebcity.com/polls2/ajax-poll.php , you will see the urls in the code were not changed which generated by the script.

//----------------------------------------------------------------
// CApp
//----------------------------------------------------------------
var app_object_selector = '.ajax-poll';
function CApp( jobj )
{
this.children = [];

this.jobj = jobj;
this.tclass = this.getAttr( 'tclass', jobj );
this.tid = this.getAttr( 'tid', jobj );
this.url_app_entry = 'http://uswebcity.com/polls2/ajax-poll.php';
this.url_app_root = 'http://uswebcity.com/polls2/';
this.url_app_img = 'http://uswebcity.com/polls2/app.img/';
this.appid = this.makeRandomString( 64 );

Could you please tell me how to fix it? Thank you.
Posted by Tom
2016-07-02

The domain name is reported by $_SERVER["SERVER_NAME"] at
web/app.code/CTClassSys.inc.php, line 62.

I believe your server is returning a wrong domain in $_SERVER["SERVER_NAME"]. If you don't want to fix your server, then the only way to solve the problem is replacing it with a hard coded value (www.uswebcity.com).

Of course, you would still get trouble with other scripts that use $_SERVER["SERVER_NAME"].