Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] generowanie pliku bash
zaba12
post 5.02.2009, 22:26:53
Post #1





Grupa: Zarejestrowani
Postów: 223
Pomógł: 0
Dołączył: 29.08.2003
Skąd: Gliwice

Ostrzeżenie: (10%)
X----


Witam mam taki kod

  1. <?php
  2. $dane = "#!/bin/bash";
  3. $q2 = "SELECT * FROM erds WHERE login='admin'";
  4. $r2 = mysql_query ($q2);
  5. while ($ser = mysql_fetch_array($r2))
  6. {
  7. $text = $ser['text'];
  8. $dane .= "
  9. lynx -nopause \"http://194.24.175.8:8022/admin.cgi?mode=updinfo&pass=debil&song=$text\"
  10. sleep 10
  11. ";
  12.  
  13. }
  14.  
  15. $cs_file=fopen("/var/www/erds/".$port.".erds","w");
  16.   $fp=fputs($cs_file,$dane);
  17.   $fc=fclose($cs_file);
  18. ?>

w bazie jest tabel text w ktorej mam jakis tam text np:

asdgfg
asdgg
asdg
itp
i chcialbym zrobic aby plik mi sie generowal tak
  1. <?php
  2. lynx -nopause &#092;"http://194.24.175.8:8022/admin.cgi?mode=updinfo&pass=debil&song=$text\"
  3. lynx -nopause &#092;"http://194.24.175.8:8022/admin.cgi?mode=updinfo&pass=debil&song=$text\"
  4. ?>


lecz jak narazie generuje mi sie plik tak ;/

  1. <?php
  2. #!/bin/bash
  3. lynx -nopause "http://194.24.175.8:8022/admin.cgi?mode=updinfo&pass=debil&song=sadsa\n
  4. asddsgsdg\n
  5. dupa\n
  6. gej\n
  7. pedal\n
  8. cwel\n"
  9. ?>


prosze o pomoc ;(
Go to the top of the page
+Quote Post
ddiceman
post 6.02.2009, 16:35:42
Post #2





Grupa: Zarejestrowani
Postów: 326
Pomógł: 121
Dołączył: 23.07.2008
Skąd: Wrocław

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


  1. <?php
  2. $dane = "#!/bin/bash";
  3. $q2 = "SELECT * FROM erds WHERE login='admin'";
  4. $r2 = mysql_query ($q2);
  5. while ($ser = mysql_fetch_array($r2))
  6. {
  7. $text = explode('\n', $ser['text']);
  8. foreach($text as $var){
  9.    $dane .= "
  10.    lynx -nopause \"http://194.24.175.8:8022/admin.cgi?mode=updinfo&pass=debil&song=$var\"
  11.    sleep 10
  12.    ";
  13. }
  14. }
  15.  
  16. $cs_file=fopen("/var/www/erds/".$port.".erds","w");
  17.  $fp=fputs($cs_file,$dane);
  18.  $fc=fclose($cs_file);
  19. ?>
Go to the top of the page
+Quote Post
zaba12
post 8.02.2009, 23:48:25
Post #3





Grupa: Zarejestrowani
Postów: 223
Pomógł: 0
Dołączył: 29.08.2003
Skąd: Gliwice

Ostrzeżenie: (10%)
X----


niestety nic to nie dalo, sprawdzalem ale nadal zapisuje tak jak podalem ;/

Ten post edytował zaba12 8.02.2009, 23:48:47
Go to the top of the page
+Quote Post

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 Wersja Lo-Fi Aktualny czas: 21.06.2025 - 15:48