Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Refresh strony, po nacisnieciu na button
tenior
post
Post #1





Grupa: Zarejestrowani
Postów: 58
Pomógł: 2
Dołączył: 16.11.2008

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


Kod
<?php
if ($_POST['restart']){
$stop = file_get_contents('ventrilo_srv.pid');
exec('kill ' . $stop);
exec("./ventrilo_srv"); {
$refresh = ($_GET['index.php']);
if ($refresh)
$message = "Serwer został zrestartowany"; } }
?>


jak zrobic odswiezenie strony po nacisnieciu buttonu restart

Ten post edytował tenior 16.11.2008, 13:20:10
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 6)
dsk
post
Post #2





Grupa: Zarejestrowani
Postów: 30
Pomógł: 3
Dołączył: 7.03.2006

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


  1. <?php
  2. if ($_POST['restart'])
  3. {
  4. $stop = file_get_contents('ventrilo_srv.pid');
  5. exec('kill ' . $stop);
  6. exec("./ventrilo_srv");
  7.  
  8. header('Location: index.php?restart=1');
  9. }
  10. ?>


Ten post edytował dsk 16.11.2008, 13:49:57
Go to the top of the page
+Quote Post
tenior
post
Post #3





Grupa: Zarejestrowani
Postów: 58
Pomógł: 2
Dołączył: 16.11.2008

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


nic z tego, nie dziala, chodzi mi o odswiezenie strony, bo jak nacisne button restart program wykona sie ale wywala mi blad strony 500, a jak bym ja odswiezyl to by nie zdazyl, probowalem nawet zrobic druga strone, "index1.php" ale nie chce do niej przekierowac tylko zaraz blad wyskakuje
Go to the top of the page
+Quote Post
dsk
post
Post #4





Grupa: Zarejestrowani
Postów: 30
Pomógł: 3
Dołączył: 7.03.2006

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


w takim razie trzeba sprawdzic czego error 500 wywala

funkcja exec dziala ? tzn. ventrilo_srv zostaje zresetowany ?

pokaz reszte kodu w tym indexie
Go to the top of the page
+Quote Post
tenior
post
Post #5





Grupa: Zarejestrowani
Postów: 58
Pomógł: 2
Dołączył: 16.11.2008

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


  1. <?php
  2. if ($_POST['restart'])
  3. {
  4. $stop = file_get_contents('ventrilo_srv.pid');
  5. exec('kill ' . $stop);
  6. exec("./ventrilo_srv");
  7.  
  8. header('Location: index.php');
  9. }
  10.  
  11.  
  12. if ($_POST['stop']){
  13. $stop = file_get_contents('ventrilo_srv.pid');
  14. exec('kill ' . $stop);
  15. }
  16.  
  17.  
  18. if ($_POST['start']){
  19. $start = exec("./ventrilo_srv");
  20. }
  21. ?>




ventrilo_srv robi najpierw stop, ale przy startowaniu ten blad wyskakuje czyli 500

Ten post edytował tenior 16.11.2008, 20:32:03
Go to the top of the page
+Quote Post
dsk
post
Post #6





Grupa: Zarejestrowani
Postów: 30
Pomógł: 3
Dołączył: 7.03.2006

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


exec("./ventrilo_srv");

wywal './' z komendy
jesli masz wlaczony safemode to zanim uruchomi execa, argument jest filtrowany przez escapeshellcmd
i ./ zostanie zamienione na .\/

wiec, sprobuj po prostu
exec("ventrilo_srv");

chyba ze to jakis skrypt, to dodaj do wywolania komendy interpreter

moze zadziala...
edit: btw. jak uruchamiasz $_POST['start'] to tez jest err 500 ?

Ten post edytował dsk 16.11.2008, 22:34:33
Go to the top of the page
+Quote Post
tenior
post
Post #7





Grupa: Zarejestrowani
Postów: 58
Pomógł: 2
Dołączył: 16.11.2008

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


Cytat(dsk @ 16.11.2008, 22:32:59 ) *
edit: btw. jak uruchamiasz $_POST['start'] to tez jest err 500 ?


tak, zaraz sprawdze czy tamto dziala

/edit
program jest wtedy nie wykonywalny

Ten post edytował tenior 17.11.2008, 20:54:03
Go to the top of the page
+Quote Post

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.08.2025 - 16:57