Welcome Guest, Not a member yet? Register   Sign In
problem with the tutorial
#1

[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
#2

[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;
#3

[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
#4

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




Theme © iAndrew 2016 - Forum software by © MyBB