Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Losowy element flash.
kurczak610
post
Post #1





Grupa: Zarejestrowani
Postów: 87
Pomógł: 2
Dołączył: 3.05.2009

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


Witam ponownie (IMG:http://forum.php.pl/style_emoticons/default/tongue.gif) P Mam taki skrypt:

  1. <?php
  2.  
  3.   $partie = $row_statistic[partie];
  4.   if($partie == 0) echo ("
  5.  $zdrapki=array('<EMBED src="moon.swf" width="250" height="100"></EMBED>','<EMBED src="moon_30.swf" width="250" height="100"></EMBED>','<EMBED src="moon_50.swf" width="250" height="100"></EMBED>');
  6.  
  7.  
  8.  
  9. do
  10. {
  11.   $los=rand(0,2);
  12.  
  13.   $zdrapka.=$zdrapki[$los];
  14.  
  15.   $i++;
  16. }
  17.  
  18. while($i<=0);
  19.  
  20. $lzdrapka = $zdrapka;
  21.  
  22.  
  23.  
  24. echo $lzdrapka;
  25.  
  26.  if($lzdrapka == '<EMBED src="moon.swf" width="250" height="100"></EMBED>') mysql_query("UPDATE users1 SET points=points+10 WHERE id=$_SESSION[userid]") or die(mysql_error());
  27.  if($lzdrapka == '<EMBED src="moon_30.swf" width="250" height="100"></EMBED>') mysql_query("UPDATE users1 SET points=points+30 WHERE id=$_SESSION[userid]") or die(mysql_error());
  28.  if($lzdrapka == '<EMBED src="moon_50.swf" width="250" height="100"></EMBED>') mysql_query("UPDATE users1 SET points=points+50 WHERE id=$_SESSION[userid]") or die(mysql_error());
  29.  
  30. mysql_query("UPDATE users1 SET partie=partie-1 WHERE id=$_SESSION[userid]") or die(mysql_error());
  31. ");
  32. ?>


Element sie losuje i dodaje pkty. Ale gdy dodałem
  1. <?php
  2. $partie = $row_statistic[partie];
  3.    if($partie == 0) echo ("
  4. ?>

Już pisze ze syntax error co tu poprawić? (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
kurczak610
post
Post #2





Grupa: Zarejestrowani
Postów: 87
Pomógł: 2
Dołączył: 3.05.2009

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


Kod jest ok (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) Dam pomogł, ale mam problem. Mam strone na 2 plikach: gora.php, i dol.php i jak nie mam parti nie wczytuje sie dol.php. Dlaczego??
Go to the top of the page
+Quote Post
nexis
post
Post #3





Grupa: Zarejestrowani
Postów: 1 012
Pomógł: 109
Dołączył: 26.09.2003
Skąd: nexis.pl

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


Cytat(kurczak610 @ 3.06.2009, 21:49:39 ) *
Kod jest ok (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) Dam pomogł, ale mam problem. Mam strone na 2 plikach: gora.php, i dol.php i jak nie mam parti nie wczytuje sie dol.php. Dlaczego??


Bo do komunikatów błędów zastosowałem funkcję exit()" title="Zobacz w manualu PHP" target="_manual, która wstrzymuje wykonywanie kodu. Zamień na echo" title="Zobacz w manualu PHP" target="_manual.
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: 12.10.2025 - 03:18