Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php] Zmienna jako parametr
Gwaihir
post
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 14.09.2007

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


Witam. Chciałbym, aby tłem komórki była zmienna $color. Próbowałem coś takiego, ale nie wychodzi ^^

  1. <?
  2. $color='red'
  3. ?>
  4.  
  5. <table border=0 cellpadding=0 cellspacing=0>
  6. <td width="7" height="7" bgcolor='<? $red ?>' ></td>


Dzięki, już sobie poradziłem ^^
Głupi jestem, omg haha.gif

Poprawny kod:

  1. <?
  2. $color='red';
  3. ?>
  4.  
  5. <table border=0 cellpadding=0 cellspacing=0>
  6. <td width="7" height="7" bgcolor=<? echo "$color" ?> ></td>

Może komuś się przyda tongue.gif

Ten post edytował Gwaihir 14.09.2007, 21:25:28
Go to the top of the page
+Quote Post
chico
post
Post #2





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 11.09.2007
Skąd: KrK

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


czemu $red a nie $color?
Go to the top of the page
+Quote Post
atomek4
post
Post #3





Grupa: Zarejestrowani
Postów: 179
Pomógł: 1
Dołączył: 8.03.2007
Skąd: Łódź

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


Cześć,
spróbuj może tak:

  1. <?
  2. $color='red'
  3. ?>
  4. <table border=0 cellpadding=0 cellspacing=0>
  5. <td width="7" height="7" bgcolor='<?=$color ?>' ></td>


Powinno zadziałać smile.gif

Ten post edytował atomek4 14.09.2007, 21:27:45
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 20.08.2025 - 14:19