shamilsons Posted April 12, 2014 Share Posted April 12, 2014 (edited) Hello Everyone, I have strange problem. I am using bluehost as my hosting service and php version: 5.4.27. I have a file header.php which includes ufunc.php, the problem is the contents of ufunc.php are beign display in the browser why ? header.php <?phpsession_start();echo 'Current PHP version: ' . phpversion().'<br>';//Creating proper path to configuration files$incdir = "../config/";//Including various filesinclude $incdir."ufunc.php"; ... ?> ufunc.php Contains user-define functions You can see problem here. Can anyone help me what is the problem ? Thank you Edited April 12, 2014 by shamilsons Quote Link to comment Share on other sites More sharing options...
shamilsons Posted April 12, 2014 Author Share Posted April 12, 2014 I guess I solved the problem, unfunc.php -> the insides were like function add($x,$y){ .... } But I guess in php 5.4 we need to define php tags, because in one my application in php 5.2 it is working without defining the tags. <php? function add($x,$y){ .... } ?> Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted April 12, 2014 Share Posted April 12, 2014 because in one my application in php 5.2 it is working without defining the tags I doubt that. PHP code must always be enclosed in PHP tags, although the closing tag can be left off. Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted April 12, 2014 Share Posted April 12, 2014 php tags were always required around any php code, in an include file or not. the only exception would be some sort of template system where the 'php' code is being 'evaluated' by a part of your php script itself. Quote Link to comment Share on other sites More sharing options...
shamilsons Posted April 12, 2014 Author Share Posted April 12, 2014 strangely I have tested the same issue in php 5.2 and it is working, make there are some configurations in php.ini Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted April 12, 2014 Share Posted April 12, 2014 make there are some configurations in php.ini What does that mean? strangely I have tested the same issue in php 5.2 and it is working Post example code. Quote Link to comment Share on other sites More sharing options...
Solution shamilsons Posted April 12, 2014 Author Solution Share Posted April 12, 2014 I have checked thoroughly there is an intermediate code that processes the php file and adds the tags. It is always a trouble while working in poor documented project. Guys thank you for your posts Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.