I am getting this error while deploy php project in wamp server.Actually i used codeigniter php framework.
request URL is http://localhost:80/index.php
below is the code.
<?
if(isset($js)){
if(is_array($js)){
if(count($js) >= 1){
foreach($js as $file){
if(file_exists("../www/js/{$file}")){
?>
<script type="text/javascript" language="javascript" src="<?php echo
base_url();?>js/<?=$file?>"></script>
<?
}
}
}
} else {
?>
<script type="text/javascript" language="javascript" src="<?php echo
base_url();?>js/<?=$js?>"></script>
<?
}
}
?>
This is showing error on browser like
GET http://localhost/js/%3C?=$file?%3E
GET http://localhost/js/%3C?=$js?%3E
Why is this error occurring.Please help me.
This is probably because you are using PHP
short_open_tags
i.e.
But in its default out of the box state PHP has the parameter turned off.
Edit php.ini to make sure you edit the correct php.ini file there are normally 2
Use the wampmanager menus -
Search for
and change it to
However the better solution would be to not use short tags, therefore your code will be universally transportable. So you could instead change the code to be
It's a bit longer, but will work on any PHP configuration.