Jump to content

Recommended Posts

I'm having a problem with php scripts, whenever there's a ' > ' operator, what comes after is displayed as text. For example :

 

 

<?php

if( isset($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR'])> 0 )

{

echo '<ul class="err">';

foreach($_SESSION['ERRMSG_ARR'] as $msg)

{

echo '<li>',$msg,'</li>';

}

echo '</ul>';

unset($_SESSION['ERRMSG_ARR']);

}

?>

 

 

displays the following on the page:

 

 

0 ) { echo '

 

    * '; foreach($_SESSION['ERRMSG_ARR'] as $msg) { echo '',$msg,'

      '; } echo '

 

'; unset($_SESSION['ERRMSG_ARR']); } ?>

 

I just don't get it, do I have to change the settings? or am I doing something wrong? why does it consider the '>' operator as the start of a text?

 

I'd really appreciate your help on this.

 

Link to comment
https://forums.phpfreaks.com/topic/189840-operator-displays-text/
Share on other sites

Yes, I doubt you have PHP configured. Are you viewing the file directly via browser? Or are you doing localhost/to/file.php?

 

"<?phpif( isset($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR'])>"

 

The browser may see that all as one HTML tag (that does not exist, obviously. And only display the stuff after it, Another pointer that you're not running PHP!

yes the extension is .php and I'm viewing it with http. Also the httpd.config file seems to have all the entries necessary:

 

ServerName localhost:80

 

LoadModule php5_module "C:/Program Files/EasyPHP5.3.0/php/php5apache2_2.dll"

 

AddType application/x-httpd-php .php5

AddType application/x-httpd-php .php4

AddType application/x-httpd-php .php

 

am I forgetting something?

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.