phprocket Posted June 1, 2008 Share Posted June 1, 2008 I am tring to create a php file on the fly, everything else works except this line.. $contents .="\tif(parse_url(PUMMS_GLOBAL_INSTALLED_URL,1) !='localhost') {\$pumms_domain_cookie=ereg_replace('^[^\.]*\.([^\.]*)\.(.*)$', '\1.\2',parse_url(PUMMS_GLOBAL_INSTALLED_URL,1));}else{\$pumms_domain_cookie='';}\n"; print $contents; For some reason the output is like this. if(parse_url(PUMMS_GLOBAL_INSTALLED_URL,1) !='localhost') {$pumms_domain_cookie=ereg_replace('^[^\.]*\.([^\.]*)\.(.*)$', '.',parse_url(PUMMS_GLOBAL_INSTALLED_URL,1));}else{$pumms_domain_cookie='';} well the forum will not post the results but what it looks like is a BOX.BOX where '\1.\2' used to be. does anyone know how I can stop this ? Thanks. Link to comment https://forums.phpfreaks.com/topic/108202-solved-weird-boxes-but-no-error-and-it-still-does-not-work-but-no-error/ Share on other sites More sharing options...
radar Posted June 1, 2008 Share Posted June 1, 2008 just get rid of the \'s in it @ the 1.2 part they are encapsulated in '''s already so theoretically it should just pass 1.2... maybe that'll fix the boxes in your output? Link to comment https://forums.phpfreaks.com/topic/108202-solved-weird-boxes-but-no-error-and-it-still-does-not-work-but-no-error/#findComment-554624 Share on other sites More sharing options...
sasa Posted June 1, 2008 Share Posted June 1, 2008 try $contents .="\tif(parse_url(PUMMS_GLOBAL_INSTALLED_URL,1) !='localhost') {\$pumms_domain_cookie=ereg_replace('^[^\.]*\.([^\.]*)\.(.*)$', '\\1.\\2',parse_url(PUMMS_GLOBAL_INSTALLED_URL,1));}else{\$pumms_domain_cookie='';}\n"; Link to comment https://forums.phpfreaks.com/topic/108202-solved-weird-boxes-but-no-error-and-it-still-does-not-work-but-no-error/#findComment-554654 Share on other sites More sharing options...
phprocket Posted June 1, 2008 Author Share Posted June 1, 2008 @sasa That works.. I made another version that works also but I like yours better. $contents .="\t".'if(parse_url(PUMMS_GLOBAL_INSTALLED_URL,1) !=\'localhost\') {$pumms_domain_cookie=ereg_replace(\'^[^\.]*\.([^\.]*)\.(.*)$\', \'\1.\2\',parse_url(PUMMS_GLOBAL_INSTALLED_URL,1));}else{$pumms_domain_cookie=\'\';}'; Link to comment https://forums.phpfreaks.com/topic/108202-solved-weird-boxes-but-no-error-and-it-still-does-not-work-but-no-error/#findComment-554722 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.