Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> funkcje
pys1986
post
Post #1





Grupa: Zarejestrowani
Postów: 233
Pomógł: 0
Dołączył: 18.01.2005

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


mam funkcje w pliku conf.php:

  1. <?php
  2. function fun()
  3. {
  4. echo&#092;"funkcja!!!\";
  5. }
  6. ?>


i teraz w pliku index.php mam napisane include('conf.php'); i jak wywolam funkcje fun(); to niedziala DLACZEGO (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) i jak to zrobic (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)

---
(IMG:http://forum.php.pl/uwaga.gif)
hwao
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
pys1986
post
Post #2





Grupa: Zarejestrowani
Postów: 233
Pomógł: 0
Dołączył: 18.01.2005

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


Plik db.php

  1. <?php
  2. $conn=mysql_connect(&#092;"localhost\",\"admin\",\"\");
  3. mysql_select_db(&#092;"strona\", $conn);
  4.  
  5. function fun(){
  6. echo ('FUNKCJA');
  7. }
  8.  
  9. ?>


i plik left.php

  1. <?php
  2. include('config/db.php');
  3.  
  4.  
  5. $result=mysql_query(&#092;"SELECT * FROM cms_block WHERE side='left' ORDER BY position \", $conn);
  6.  
  7. while ($myrow=mysql_fetch_assoc($result))
  8. {
  9.  
  10. if($myrow[&#092;"path\"]==''){
  11.  
  12. echo&#092;"<table border=0 width=95% cellpadding=0 cellspacing=0 >\";
  13. echo&#092;"<tr><td background=\"image/left.jpg\" width=3></td>
  14. <td background=&#092;"image/pas.jpg\" height=20 class=\"nav\">\";
  15. echo &#092;"&nbsp;&nbsp;\".$myrow[\"title\"];
  16. echo&#092;"</td><td background=\"image/right.jpg\" width=3></td></tr>
  17. <tr><td width=1 background=&#092;"image/pasek_l.jpg\"></td>
  18. <td>&#092;";
  19. [php]
  20. echo&#092;"\".$myrow[\"text\"];
  21. fun();
  22.  
  23. echo&#092;"</td><td width=1 background=\"image/pasek_r.jpg\"></td>
  24. <tr><td height=1 colspan=3 background=&#092;"image/pasek.jpg\"></td></tr>
  25. </tr>
  26. <tr><td height=10></td></tr></table>&#092;";
  27.  
  28. }else{
  29.  
  30. echo&#092;"<table border=0 width=95% cellpadding=0 cellspacing=0 >\";
  31. echo&#092;"<tr><td colspan=3 background=\"image/pasek.jpg\" height=20 class=\"nav\">\";
  32. echo &#092;"&nbsp;&nbsp;\".$myrow[\"title\"];
  33. echo&#092;"</td></tr>
  34. <tr><td width=1 background=&#092;"image/pasek.jpg\"></td>
  35. <td>&#092;";
  36. include($myrow[&#092;"path\"]);
  37. echo&#092;"</td><td width=1 background=\"image/pasek.jpg\"></td>
  38. <tr><td height=1 colspan=3 background=&#092;"image/pasek.jpg\"></td></tr>
  39. </tr>
  40. <tr><td height=10></td></tr></table>&#092;";
  41.  
  42. }
  43. }
  44.  
  45. ?>


i cos tu jest nie tak tylko co (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) zadne bledy sie nie wyswietlaja (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)

Ten post edytował pys1986 28.02.2005, 11:39:05
Go to the top of the page
+Quote Post

Posty w temacie


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: 11.10.2025 - 21:01