Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Problem z petlą, Smarty
DR.GhostRider
post
Post #1





Grupa: Zarejestrowani
Postów: 72
Pomógł: 1
Dołączył: 27.01.2009

Ostrzeżenie: (0%)
-----


Witam mam kod
  1. <?php
  2. if(is_array($errors))
  3.    {
  4.        echo '<p class="perex2"><b>Następujące błędy zostały podane w formularzu:</b><br />';
  5.        while (list($key,$value) = each($errors))
  6.        {        
  7.  
  8. $smarty->assign('Show_errors',$value.'<br />');
  9.  
  10.        }
  11.    echo '<br /><a href="index.php?p=contact&email='.$_GET['email'].'&temat='.$_GET['temat'].'&tresc='.$_GET['tresc'].'"><b>Popraw</b></a> </p>';
  12.    }
  13. ?>


Problem w tym ze nie pokazuje mi listy błędów tylko jeden
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
AngelusPL
post
Post #2





Grupa: Zarejestrowani
Postów: 16
Pomógł: 3
Dołączył: 16.08.2007
Skąd: Oświęcim

Ostrzeżenie: (0%)
-----


Witam

Kod
$smarty->assign('errors',$errors);


a w html

Kod
<p class="perex2"><b>Następujące błędy zostały podane w formularzu:</b><br />
{foreach name=bledy from=$errors key=k item=v}
    {$smarty.foreach.bledy.iteration}.&nbsp;{$v}<br/>
{/foreach}
</p>


Ten post edytował AngelusPL 15.05.2009, 08:53:25
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 10.12.2025 - 00:15