Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem ze znakiem chr(92)
inf16
post
Post #1





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 10.09.2014

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


Witam
wie ktoś może jak zamienić znak \ na \n ? bo mi w żaden sposób nie wychodzi i tylko błedy wywala jak próbuje za pomoc str_replace zamieniać (IMG:style_emoticons/default/sad.gif)
syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
myślałem że jak skorzystam z chr(92) to mi przejdzie to wyrzuciło
unexpected T_STRING

Dzięki z góry za pomoc
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
inf16
post
Post #2





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 10.09.2014

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


pisze sobie prosty edytor
  1. <form action="editor.php?create=save" method="post">
  2. <table border="0" bordercolor="black" cellspacing="0" cellpadding="0" width="708" style="margin-left:40px; margin-top:20px;">
  3. <tr><td width="221" height="53" valign="top" class="newfile">
  4. <input type="text" name="plik" class="pole2">
  5. </td><td width="113" height="53" valign="top">
  6. <input type="submit" class="newfile1" value=" " title="kliknij by zapisac" hidefocus=true style="outline:none">
  7. </td><td width="371" height="53" valign="top" class="newfile2"><a href="editor.php?oki=zarzadzaj" class="linki" style="margin-left:340px;" hidefocus=true style="outline:none"></a></td></tr></table>
  8. <table border="0" bordercolor="black" cellspacing="0" cellpadding="0" width="708" style="margin-left:40px;">
  9. <tr><td width="708" height="184" valign="top" class="newfile3">
  10. <textarea name="tekst" style="margin-left:15px; width:677px; height:335px; background-color:#e5e4e4; border: 1px solid #6e6666;">
  11. </td></tr></table>
  12. <table border="0" bordercolor="black" cellspacing="0" cellpadding="0" width="708" style="margin-left:40px;">
  13. <tr><td width="708" height="22" valign="top" class="newfile4"></td></tr></table>
  14. </form>

  1. if($_GET['create']==save){
  2. $csfile=$_POST['plik'];
  3. $text=$_POST['tekst'];
  4. $plik=fopen($csfile,"w+");
  5. $plik2=fopen("tmp.txt","w");
  6. $tmp=nl2br($text);
  7. $proba=str_replace('<br />','',$tmp);
  8. fputs($plik,$proba);
  9. fputs($plik2,$csfile);
  10. echo'<meta http-equiv="refresh" content="0; url=editor.php?conti=nued">';
  11. }

i podczas wczytywanie z pliku *.php którego tworze za pomocą skryptu
  1. <title>proba</title>
  2. </head>
  3. <?
  4. echo\"aaa\"; # i tych dwóch znaczników \\ chce się pozbyć
  5. ?>
  6. </body>
  7. </html>


Ten post edytował inf16 10.09.2014, 21:59:28
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: 14.10.2025 - 22:58