Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Długi tekst
baszar
post
Post #1





Grupa: Zarejestrowani
Postów: 24
Pomógł: 0
Dołączył: 3.03.2013

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


Witam, zrobiłem sobie system newsów i mam problem gdyż jak chce wpisać długi tekst taki jak np.:


Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Wtedy pisze, że dodało normalnie informacja, ale wpis nie dodaje się do bazy. Tekst jest wklejany do edytora WYSWiG.


Co może byc?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
baszar
post
Post #2





Grupa: Zarejestrowani
Postów: 24
Pomógł: 0
Dołączył: 3.03.2013

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


Racja sorka


  1. <?php
  2. $tytul = $_POST['tytul'];
  3. $tresc = $_POST['tresc'];
  4. $autor = $_SESSION['nick'];
  5.  
  6.  
  7. if(isset($_POST['dodaj'])){
  8.  
  9. if(!$tytul || !$tresc) {
  10.  
  11. echo '
  12. <div class="nNote nFailure hideit">
  13. <p>Nie wypełniłeś wszystkich pól!</p>
  14. </div>
  15. ';
  16.  
  17. }else{
  18.  
  19. mysql_query("INSERT INTO news SET tytul='$tytul', tresc='$tresc', autor='$autor'");
  20.  
  21. echo '
  22. <div class="nNote nSuccess hideit">
  23. <p>Pomyślnie dodałeś newsa!</p>
  24. </div>
  25. ';
  26.  
  27. }
  28.  
  29. }
  30. ?>


  1. <form action="addNews.php" class="mainForm" method="POST">
  2.  
  3.  
  4.  
  5. <div class="rowElem"><label>Tytuł Newsa:</label><div class="formRight"><input type="text" name="tytul" class="rightDir" title="Wpisz tytuł newsa" /></div><div class="fix"></div>
  6. </div>
  7.  
  8.  
  9. <div class="widget">
  10. <div class="head"><h5 class="iPencil">Treść Newsa</h5></div>
  11. <textarea class="wysiwyg" rows="5" cols="" name="tresc"></textarea>
  12. </div>
  13. <br /><br />
  14. <input type="submit" value="Dodaj Newsa" class="greyishBtn submitForm" name="dodaj"/>
  15. </form>
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: 11.10.2025 - 02:16