CodeIgniter Forums
strange problem in my view,has anyone help me? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: strange problem in my view,has anyone help me? (/showthread.php?tid=13468)



strange problem in my view,has anyone help me? - El Forum - 11-24-2008

[eluser]chmod[/eluser]
I have complete yesterday night in my notebook computer.
then i unzip it in my woking computer PC.
the strange thing is display,the method form_open,form_close,and so on
in <??> which are not be output html,but php code directly,

I try other php file,the display is normal.
why ?

my view file is:
filename: login_tpl.php

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
        &lt;title&gt;&lt;?=isset($title)?$title:'';?&gt;&lt;/title&gt;
        &lt;!--css link--&gt;
        &lt;link type="text/css" rel="stylesheet" href="&lt;?=CSS_URL;?&gt;index.css" /&gt;
        &lt;!--javascript--&gt;
        [removed][removed]
     &lt;/head&gt;
&lt;body&gt;

    <div id="">
        &lt;?=form_open('center/login/ilogin',array('id' => 'loginform','class' => 'loginform'));?&gt;
            <div><span class="">Username:</span>&lt;input id="user_name" type="text" name="user_name" class="" /&gt;&lt;/div>
            <div><span class="">Password:</span>&lt;input id="password" type="password" name="password" class="" /&gt;&lt;/div>
            <div>&lt;input type="submit" value="go!" /&gt;&lt;/div>
        &lt;?=form_close();?&gt;
    </div>
&lt;/body&gt;
&lt;/html&gt;

the image is belowed:


strange problem in my view,has anyone help me? - El Forum - 11-24-2008

[eluser]thecancerus[/eluser]
this may happen if short tags are disabled. try to enable the short tags in php.ini or replace "&lt;?=" this with "&lt;?php echo".


strange problem in my view,has anyone help me? - El Forum - 11-24-2008

[eluser]chmod[/eluser]
But I change the filename:

Code:
function index(){
            $data = array('title' => $this->lang->line('title_center_index'));
            $this->load->view('center/loginto_tpl',$data);
        }

login_tpl to loginto_tpl or test_tpl and so on,
the problem is disapper.my god!!!
why?


strange problem in my view,has anyone help me? - El Forum - 11-24-2008

[eluser]thecancerus[/eluser]
you can also try changing following configuration 'rewrite_short_tags' in config.php file to true.

$config['rewrite_short_tags'] = true;