Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

PHP/HTML

 
   Database Forums (Home) -> PHP RSS
Next:  Noise Words  
Author Message
Lau Lauritzen

External


Since: Mar 30, 2006
Posts: 1



(Msg. 1) Posted: Thu Mar 30, 2006 6:55 am
Post subject: PHP/HTML
Archived from groups: alt>php (more info?)

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

 >> Stay informed about: PHP/HTML 
Back to top
Login to vote
martin80

External


Since: Nov 22, 2004
Posts: 4



(Msg. 2) Posted: Thu Mar 30, 2006 7:55 am
Post subject: Re: PHP/HTML [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In message , Lau
Lauritzen writes
>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

What's <?=$val?> suppose to do?

You'll probably find that your browser is trying to interpret it as an
HTML tag, doesn't understand it, so just ignores it.
--
Martin Jay

 >> Stay informed about: PHP/HTML 
Back to top
Login to vote
Geoff Berrow1

External


Since: Dec 24, 2003
Posts: 145



(Msg. 3) Posted: Thu Mar 30, 2006 7:55 am
Post subject: Re: PHP/HTML [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Message-ID: from Lau
Lauritzen contained the following:

><?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; ?>


You have coded assuming short tags are enabled and they may not be.

You have $form_errorlist and $form_errors. Are they two separate
variables?

Also I've never used that syntax so I will substitute what I normally
use.

Try:

<?php
if($form_errorlist){ ?>
Please correct the following errors:<BR>
<UL>
<?php foreach($form_errors as $val){ ?>
<LI><?php echo $val; ?> </LI>
<?php }?>
</UL>
<?php } ?>

<?php
if($form_errorlist){
echo ' Please correct the following errors:<BR>\n<UL>';
foreach($form_errors as $val){
echo "<LI>$val</LI>";
}
echo '</UL>';
}
?>
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
 >> Stay informed about: PHP/HTML 
Back to top
Login to vote
Geoff Berrow1

External


Since: Dec 24, 2003
Posts: 145



(Msg. 4) Posted: Thu Mar 30, 2006 8:55 am
Post subject: Re: PHP/HTML [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Message-ID: from Geoff
Berrow contained the following:

>Try:
Should have mentioned..two versions.
--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
 >> Stay informed about: PHP/HTML 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
<<<HTML - Let us say I have lots of html-code I want to print.... surrounded by php code. I learned once that I could do like this: <?php $name = empty($_POST['name'] ? "" : $_POST['name']; print <<<HTML <form method="post" act...

PHP in html - Hello, I have a php include command in my website and the script shows up. However, I need for the script to show up on the right side of page (there is enough room there)... but for some reason it shows up at the bottom. I placed the include command...

HTML email using PHP - Hello How do i send a HTML email using PHP. I have tried loads of examples and they are not working. last example was <?php $to = blabla@bla.net; $subject = 'Wakeup bob!'; $message = '<b>yo</b>, whassup?'; $headers = "From:..

HTML Mail - How may I setup a proper HTML mail message with embedded href links using PHP, that follows all the MIME rules? Any examples or links would be appreciated. Thanks!

php & html editor - Hi there, I'm starting to learn php and need a php editor for windows. Can you recommend what you think the best editor available in the market? I've tried some free html editors and was not satisfied with them. I need one that is simple and neat...
   Database Forums (Home) -> PHP All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]