Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help fix this code for me!
12-13-2013, 07:38 PM
Post: #1
help fix this code for me!
it shows this as error tonguearse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING .

here is code:


Code:
<?php

if(strtolower($_SERVER['HTTP_HOST'])=='www.tk'){
    header('Location: http://www.tk'.$_SERVER['REQUEST_URI'],TRUE,301);
    exit;
};
define('SF_ROOT_DIR',    realpath(dirname(__FILE__)).'/skyitech');
if(strtolower($_SERVER['HTTP_HOST'])=='www.
    define('SF_ENVIRONMENT', 'wwww'');
};
define('SF_ROOT_DIR',    realpath(dirname(__FILE__)).'/skyitech');
if(strtolower($_SERVER['HTTP_HOST'])=='www.tk'){
    define('SF_APP',         'frontend_m');
    define('SF_ENVIRONMENT', 'www');
};
define('SF_DEBUG', false);

require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.D​IRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
sfContext::getInstance()->getController()->dispatch();

My Facebook - ArrowTxT.In
Visit this user's website Find all posts by this user
Like Post Quote this message in a reply
12-13-2013, 09:43 PM
Post: #2
RE: help fix this code for me!
does it tell you which line is the error like on line 5(example)
Visit this user's website Find all posts by this user
Like Post Quote this message in a reply
12-13-2013, 09:48 PM (This post was last modified: 12-13-2013 11:03 PM by Ghost.)
Post: #3
RE: help fix this code for me!
try this:
Code:
<?php

if(strtolower($_SERVER['HTTP_HOST'])=='www.tk'){
    header('Location: http://www.tk'.$_SERVER['REQUEST_URI'],TRUE,301);
    exit();
}
define('SF_ROOT_DIR',    realpath(dirname(__FILE__)).'/skyitech');
if(strtolower($_SERVER['HTTP_HOST'])=='www.tk'){
    define('SF_ENVIRONMENT', 'www');
}
define('SF_ROOT_DIR',    realpath(dirname(__FILE__)).'/skyitech');
if(strtolower($_SERVER['HTTP_HOST'])=='www.tk'){
    define('SF_APP',         'frontend_m');
    define('SF_ENVIRONMENT', 'www');
}
define('SF_DEBUG', false);

require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.D​IRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
sfContext::getInstance()->getController()->dispatch();


you was ending "IF" statements with ";" which will cause errors

wrong way:
if(something) {

};

correct way:
if(something) {

}

there was also a slight error in the second if statement where it was not formed properly. so i modded that also
to what i think you was trying to do. if not right. then you can mod as you see fit.
Find all posts by this user
Like Post Quote this message in a reply
12-14-2013, 12:22 AM (This post was last modified: 12-14-2013 12:39 AM by waptik.)
Post: #4
RE: help fix this code for me!
ya. Line 12

Here is full code,error is on line 12,checkhttp://watsms.tk:
Code:
<?php

if(strtolower($_SERVER['HTTP_HOST'])=='mysite.tk'){
header('Location: http://www.mysite.tk'.$_SERVER['REQUEST_URI'],TRUE,301);
exit;
}
define('SF_ROOT_DIR',    realpath(dirname(__FILE__)).'/home');
if(strtolower($_SERVER['HTTP_HOST'])=='www.mysite.tk'){
define('SF_APP',         'frontend');
define('SF_ENVIRONMENT', 'home'');
};
define('SF_ROOT_DIR',    realpath.(dirname(__FILE__)).'/home');
if(strtolower($_SERVER['HTTP_HOST'])=='m.mysite.tk'){
define('SF_APP',         'frontend_m');
define('SF_ENVIRONMENT', 'home');
};
define('SF_DEBUG', false);

require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.D​IRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
sfContext::getInstance()->getController()->dispatch();

My Facebook - ArrowTxT.In
Visit this user's website Find all posts by this user
Like Post Quote this message in a reply
12-14-2013, 12:43 AM
Post: #5
RE: help fix this code for me!
Try this

<?php
if(strtolower($_SERVER['HTTP_HOST'])=='www.tk')
{
header('Location: http://www.tk'.$_SERVER['REQUEST_URI'],TRUE,301);
exit;
}
define('SF_ROOT_DIR', realpath(dirname(__FILE__)).'/skyitech');
if(strtolower($_SERVER['HTTP_HOST'])=='www. define('SF_ENVIRONMENT', 'wwww'');
}
define('SF_ROOT_DIR', realpath(dirname(__FILE__)).'/skyitech');
if(strtolower($_SERVER['HTTP_HOST'])=='www.tk')
{
define('SF_APP', 'frontend_m');
define('SF_ENVIRONMENT', 'www');
}
define('SF_DEBUG', false);
require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.D​​IRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
sfContext::getInstance()->getController()->dispatch();
Find all posts by this user
Like Post Quote this message in a reply
12-14-2013, 04:38 AM (This post was last modified: 12-14-2013 04:43 AM by NEPSALONE.)
Post: #6
RE: help fix this code for me!
Waptik and omi this script not working in shared hosting u need by vps or dedicatd

All code r ok bt your hosting not support symfory u need symfony checker like http://nayasaathi.com/check.php
Visit this user's website Find all posts by this user
Like Post Quote this message in a reply
12-14-2013, 09:51 AM
Post: #7
RE: help fix this code for me!
(12-14-2013 04:38 AM)NEPSALONE Wrote:  Waptik and omi this script not working in shared hosting u need by vps or dedicatd

All code r ok bt your hosting not support symfory u need symfony checker like http://nayasaathi.com/check.php

ok,tnx. Thats even good. I have a CentOS v6.5 VPS,http://smsdot.tk. Can somebody help me with full guidance from A-Z? Am a newbie in vps. I installed LAMP on it yesterday!

My Facebook - ArrowTxT.In
Visit this user's website Find all posts by this user
Like Post Quote this message in a reply
12-14-2013, 10:21 AM (This post was last modified: 12-14-2013 10:23 AM by NEPSALONE.)
Post: #8
RE: help fix this code for me!
Install php acceleretor in your hosting.or goto your cpanel> service and software install apc or symfony in your hosting

Or use nginx server for run symfony apps
Visit this user's website Find all posts by this user
Like Post Quote this message in a reply
12-14-2013, 01:53 PM
Post: #9
RE: help fix this code for me!
Ok. I will try it. So nepsalone,wbt urz? Wat u gonna do with the sms script? Pls pm me ur cpanel details to my fb,i want to download the apps folder in the public_html/apps/ not in public_html/skyitech/apps . Or just download it and send it to [email protected]

My Facebook - ArrowTxT.In
Visit this user's website Find all posts by this user
Like Post Quote this message in a reply
12-15-2013, 04:17 AM (This post was last modified: 02-09-2014 09:03 PM by NEPSALONE.)
Post: #10
RE: help fix this code for me!
I hate symfony My sms sharing site demo http://nepalwap.com/sms
Visit this user's website Find all posts by this user
Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)