PHP/HTML



Hope there is someone out there how can help me.
I got a small problem, as you will properly see i'm a newbi.
I'm running php 5.1.2 and apacheserver 2.0.55 on a winxp installation.

The following code is not displaying anything in the browser:

<?php
if($form_errorlist): ?>
Please correct the following errors:<BR>
<UL>
<?php foreach($form_errors as $val): ?>
<LI><?=$val?> // Here is the problem
<?php endforeach; ?>
</UL>
<?php endif; ?>

I have changed the above code to the follow code, and it works, how come the
above don't?

<?php
/* Display any errors that occured during validation */

if($form_errorlist): ?>
Please correct the following errors:<BR>
<UL>
<?php foreach($form_errors as $val): ?>
<LI><?php echo "$val" // Here i changed?>
<?php endforeach; ?>
</UL>
<?php endif; ?>

Best regards


.



Relevant Pages

  • Re: how does php parse actually this?
    ... <?php endif; ?> ... PHP peculiar and likely to be dropped in later versions of PHP. ... It certainly produces cleaner scripting on occasion. ...
    (comp.lang.php)
  • Re: Input form
    ... > display an asterisk and change the text to red. ... <?php endif; ?> ...
    (comp.lang.php)
  • Re: PHP/HTML
    ... <?php endforeach; ?> ... <?php endif; ?> ... You have coded assuming short tags are enabled and they may not be. ...
    (alt.php)
  • Re: [PHP] File Upload problem
    ... I'm running PHP version 4.2.2 ... manual has in the file uploads section. ... contains no data" and as far as I know the php script isn't even run. ... This message is intended solely for the use of the designated recipientand their appointed delegates, and may contain confidential information. ...
    (php.general)
  • PHP "security" issues on hosts
    ... I want to identify which hosts will give me the most flexibility; ... what configuration/style of running PHP ... Should PHP be running as a module or CGI? ...
    (php.general)