Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [domdocument] różne działanie kodu na dwóch serwerach
kacpero1094
post
Post #1





Grupa: Zarejestrowani
Postów: 87
Pomógł: 0
Dołączył: 22.12.2008

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


Mam w panelu swojej strony taki kod:
  1. <?php
  2. //....
  3. //funkcja switch...
  4. case "articles":
  5. $table=$doc->appendChild($doc->createElement("table"));
  6. $table->setAttribute("class","arts");
  7. $sql=mysql_query("SELECT `id` FROM `arts` ORDER BY `id` DESC");
  8. while ($row=mysql_fetch_assoc($sql)) {
  9. $art=new arts($row['id']);
  10. $tr=$table->appendChild($doc->createElement("tr"));
  11. $tdId=$tr->appendChild($doc->createElement("td",$row['id']));
  12. $tdName=$tr->appendChild($doc->createElement("td"));
  13. $link=$tdName->appendChild($doc->createElement("a",$art->getData("title")));
  14. $link->setAttribute("href","/czytaj/" . $art->getData("url") . "/"); //to powoduje błąd!!
  15. $tdActions=$tr->appendChild($doc->createElement("td"));
  16. $editLink=$tdActions->appendChild($doc->createElement("a"));
  17. $editLink->setAttribute("href","index.php?section=add_article&id=" . $row['id']);
  18. $editImg=$editLink->appendChild($doc->createElement("img"));
  19. $editImg->setAttribute("src","images/edit.png");
  20. $delLink=$tdActions->appendChild($doc->createElement("a"));
  21. $delLink->setAttribute("href","index.php?section=article&action=del_article&id=" . $row['id']);
  22. $delImg=$delLink->appendChild($doc->createElement("img"));
  23. $delImg->setAttribute("src","images/delete.png");
  24. }
  25. $template->add("main.content",$doc->saveXML($table));
  26. break;
  27. //...inne opcje case
  28. //...koniec funkcji
  29. //zwaca kod html
  30. ?>

Dlaczego linia oznaczona komentarzem powoduje to że nawet reszta kodu się nie nie wyświetla? Na domowym serwerze wszystko działa.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
fander
post
Post #2





Grupa: Zarejestrowani
Postów: 231
Pomógł: 22
Dołączył: 6.10.2008

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


a masz w bazie danych w tabelce arts kolumne o nazwie url ?

A dleczego się nie wyświetla może gdziesz masz
Kod
try{

}catch(Exception e){

}

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: 24.12.2025 - 05:18