Forum Moderators: coopster

Message Too Old, No Replies

strange problem

please help

         

nishant322

11:01 pm on Feb 11, 2009 (gmt 0)

10+ Year Member



Hi everybody,
i am new to this forum. I have seen that this forum is very interactive. well i am having a strange problem with php. I had a website hosted in linux environment it was fine. I then shifted to my own server, which i configured for php and apache.

Now the problem is the php functions that i am using occupy space in the webpage. This was not happening in the previous hosted server.

Please help.

thanks
nishant

rob7591

11:35 pm on Feb 11, 2009 (gmt 0)

10+ Year Member



I'm not sure exactly what your problem is, but I'm assuming you mean the PHP code is showing up in the browser window. Try adding this line to .htaccess
AddHandler application/x-httpd-php .php

And make sure your files have a .php file extension.

nishant322

11:43 pm on Feb 11, 2009 (gmt 0)

10+ Year Member



Hi,
Thank you very much for your reply.

I have files in .php extensions , thats fine and the web is database driven,everything is perfectly fine.

The issue is that suppose i have a kind of following code :

<?php
check something from database here
if(something=soemthing)
{
Html code goes here, like text or whatever
?>
<?php
}?>

Now the issue is that whatever php code i have in front and after the html takes up extra white space after the html code.
Suppose i display some text only if something=something in database , then what happens is like blank space comes after the html thing and makes my web page required to be scrolled. when i host the same page in another server, then there is no such issue.
I isntalled the apache and php in my own server and i am having problem in my server.

So i was wondering if you could help me , as far as i guess,i think i need to install any package with php something like php-mbstring or anything like that?
Please suggest.

thank you
Nishant

nishant322

3:29 am on Feb 13, 2009 (gmt 0)

10+ Year Member



Hi,
Any one please ? it seems to be because of php.ini file, in linux. The php codes take up space. please help .

thanx

coopster

8:21 pm on Feb 13, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You are getting extra whitespace? That is the problem? View Source in your browser to see what is happening.