CodeIgniter Forums
problem with the tutorial - 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: problem with the tutorial (/showthread.php?tid=13749)



problem with the tutorial - El Forum - 12-04-2008

[eluser]protanqcreator[/eluser]
Hi,

I'm new on code initer. I have a problem with the tutorial that shows how to create a blog.

This is my code :
Code:
<html>
<head>
<title><?=$title?></title>
</head>
<body>
<h1>&lt;?=$heading?&gt;</h1>
&lt;?php foreach($query->result() as $row):?&gt;
<h3>&lt;?=$row->title?&gt;</h3>
<p>&lt;?=$row->body?&gt;</p>
<hr>
&lt;?php endforeach;?&gt;    
&lt;/body&gt;
&lt;/html&gt;

That is the result on my webbrowser

title?&gt;

body?&gt;
title?&gt;

body?&gt;


Is threre somebody that can help me.

Thanks


problem with the tutorial - El Forum - 12-04-2008

[eluser]iainco[/eluser]
Your server doesn't have PHP short tags enabled, you can either use

Code:
&lt;?php echo $row->title;?&gt;

instead of

Code:
&lt;?=$row->title?&gt;

Or you can use the option in your config.php:

Code:
/*
|--------------------------------------------------------------------------
| Rewrite PHP Short Tags
|--------------------------------------------------------------------------
|
| If your PHP installation does not have short tag support enabled CI
| can rewrite the tags on-the-fly, enabling you to utilize that syntax
| in your view files.  Options are TRUE or FALSE (boolean)
|
*/
$config['rewrite_short_tags'] = TRUE;



problem with the tutorial - El Forum - 12-04-2008

[eluser]protanqcreator[/eluser]
hi,

Thanks for your quickly answer!!! It's works very well now.
I am happy to found codeintiter and his community.

Sorry if my English isn't very good.


Bye


problem with the tutorial - El Forum - 12-04-2008

[eluser]iainco[/eluser]
No problem, welcome to CI!