Welcome Guest, Not a member yet? Register   Sign In
I can see php codes in html output
#1

[eluser]ApranaxFortress[/eluser]
I was write my codes in Linux and i'd copy my files into windows (with wamp server) but when i open my project i can see php codes in browser


This is html output of my project.
Code:
<html>
<head>
<title>A site</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
[removed][removed]


[removed][removed]
<link rel="stylesheet" type="text/css" href="<?=base_url()?>theme/theme.css">
</head>
<body>
<div id="first_div">
<div id="header_div">
  <a href="&lt;?=site_url(">Register</a> - <a href="&lt;?=site_url(">Login</a>  - <a href="&lt;?=site_url(">Logout</a> - <a href="&lt;?=site_url(">New Signal</a>

  <br/>&lt;?=$this->session->userdata('username');?&gt;
  </div>
<div id="container_div"> </div>
<div id="footer_div">Footer text</div>
</div>
&lt;/body&gt;
&lt;/html&gt;
#2

[eluser]Tom Schlick[/eluser]
do you have php enabled and running? try turning short tags on or in the config have it rewrite the short tags
#3

[eluser]ApranaxFortress[/eluser]
I changed this line in config

$config['rewrite_short_tags'] = TRUE; (it was false :red: )

My problem is solved now. Thank you for your help.
#4

[eluser]Tom Schlick[/eluser]
not a problem. im glad it was something simple and not some error which we couldnt help solve. now you can use it this way or if you wanna turn on short tags in the php config im pretty sure it will save you some slight resources but thats up to you. good luck with what your working on!
#5

[eluser]meridimus[/eluser]
I use short tags too, CI used to advise to turn it on but now they suggest you leave it off and instead of using:

Code:
&lt;?=$variable?&gt;

It's advised to do

Code:
&lt;?php echo $variable; ?&gt;

But, of course just do what you prefer. I prefer the short-hand of short-tags




Theme © iAndrew 2016 - Forum software by © MyBB