Use of undefined constant

0

witam
mam skrypt, który po poprawnym wpisaniu hasła wczytywal plik. Niestety na obecnych platformach (bo dawniej działał) wyrzuca:

Notice: Use of undefined constant Przejdz - assumed 'Przejdz' in C:\xampp\htdocs\firma\statystyka\statystyka.php on line 46
Notice: Undefined variable: action in C:\xampp\htdocs\firma\statystyka\statystyka.php on line 46

to te linijki:

switch($action){
case Przejdz:
if($password==$pwrd){
include("index.php");
exit;

}
else {
login("Złe hasło");
}
break;
}

będę wdzięczny za pomoc

1

Prawdopodobnie chciałeś tam użyć stringa:

case "Przejdz":
0

zmieniłem na:

switch($action){
case 'Przejdz':
if($password==$pwrd){
include("index.php");
exit;

}
else {
login("Złe hasło");
}
break;
}

i teraz mam:

Undefined variable: action in C:\xampp\htdocs\portal-slider-2\pl\statystyka\statystyka.php on line 31

linia 31 to własnie ta:

case 'Przejdz':
3

No bo pewnie nie istnieje taka zmienna jak $action.

0

sęk w tym, że to działa, ale na serwerach, gdzie można ustawic starszą wersję PHP, haj Superhost np.
ale z moja wiedza PHP chyba na nowszych jednak nie ruszymy....
action jest później:
<input type="submit" name="action" value="Przejdz"

2
dzialko napisał(a):

sęk w tym, że to działa, ale na serwerach, gdzie można ustawic starszą wersję PHP

Ale błąd musi pojawiać się gdzieś wcześniej w skrypcie ustawiającym wartość tej zmiennej, a dopiero tutaj się wywala.

0

gdyby tak było, coś by przestawało działac
tymczasem są wciąż strony na tym systemie postawione i wszystko tam działa (pod warunkiem, ze dało radę ustawić wcześniejsze PHP)
chyba najbardziej znaną by była:
http://www.karatetsunami.eu/

system stary, kiedyś posklejałem z różnych plików skrypty, często działając na intuicję
teraz próbuję go reanimować i zastosować do stron responsywnych, ale chyba figa wyjdzie z moja wiedzą
ideą była "brzytwa Ockhama"-żadnych Joomli i Wordpresów, 5 guzików miało starczyć do obsłużenia portalu.....

0

Pokaż cały kod. Kilka rzeczy:

  • w pierwszym poście pokazujesz, że błąd jest w linijce 46 dla zmiennej $action i stałej, a przedstawiony kod pokazuje 2 różne linie.
  • skoro to działało to może faktycznie gdzieś jest zadeklarowana stała i może ma zupełnie inną wartość niż nazwa
  • bardzo nie podoba mi się porównanie hasła wyglądającego na nie hashowane. To pewnie nie ma nic do obecnego problemu, ale haseł poprzez jawny tekst się nie trzyma. No chyba, że to gdzieś tam się dzieje ale tego nie widzimy.

Podsumowując, pokaż cały kod to może uda się pomóc.

0
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<?php

	extract(array_merge($_POST, $_GET, $_FILES, $_COOKIE));

?>
<HTML><head><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=iso-8859-2"><title>Zmiana hasła</title>
<link href="styl.css" rel="stylesheet" type="text/css"><link rel="shortcut icon" href="../ikonka.ico" type="image/x-icon">
</head>
<body bgcolor="#FFFFB3"><?php
if (file_exists('../pl/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-PL\" onClick=\"parent.location.href='../pl/obsluga_strony.php'\"><br><br>";
}

else
{
echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-PL\" onClick=\"parent.location.href='../obsluga_strony.php'\"><br><br>";
}

if (file_exists('../en/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-EN\" onClick=\"parent.location.href='../en/obsluga_strony.php'\"><br><br>";
}

if (file_exists('../de/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-DE\" onClick=\"parent.location.href='../de/obsluga_strony.php'\"><br><br>";
}
if (file_exists('../rus/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-RUS\" onClick=\"parent.location.href='../rus/obsluga_strony.php'\"><br><br>";
}
if (file_exists('../cs/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-CS\" onClick=\"parent.location.href='../cs/obsluga_strony.php'\"><br><br>";
}
include ("pass.php");
function login($alert){
 global $password;
 echo("<center>$alert</center>"); ?>
 <center><form action="index.php" method='post'>
<table style="color: black; font-size: 10pt; font-weight: bold; background-color: #DFDCD7; border: 4px double black; margin: 2px;" ><tr><td align=center>Hasło:  <input type='password' name='password' value="<?php echo($password); ?>"><br><br>
<input type='hidden' name='file' value="pass.php">
<input type='hidden' name='action' value='edit'><input type='submit' value='Przejdz' class='editor' onMouseOver="this.className='editor1'" onMouseOut="this.className='editor'"></form></td></tr></table></center>
 <?php
}
switch($action){
 case 'show':
 if($password==$pwrd){
 if(!show_source($file)){
 login("<font class=blad>NIE MOŻNA OTWORZYĆ PLIKU Z HASŁEM: <b>$file</b></font>");
 }
 }
 else {
 login("<font class=blad>Złe hasło !</font>");
 }
 break;
 case 'edit':
 if($password==$pwrd){
 $edfile=@fopen($file, "r");
 $fc=fread($edfile, filesize($file));
 fclose($edfile); ?>
 <form action='index.php' method='post'>
 <input type='hidden' name='action' value='add'><input type='hidden' name='password' value="<?php echo($password); ?>">
<div align="center"><table align="center"><tr><td><p>W polu czerwonym masz dotychczasowe hasło, zmień je sobie na nowe. Nie ma żadnych ograniczeń, mozna używać dowolnych znaków. Jedyna zasada: <b>zapamiętaj nowe hasło !</b></p><tr><td bgcolor="#F89C8E" align="center"><br><nobr>Tutaj zmień hasło: <input type='text' size=30 name="fc" value='<?php echo ($pwrd); ?>'></nobr><br> <br>Jesli zapomnisz hasła, to szukaj go w pliku: <input type='text' size='30' name='file' value="<?php echo ($file); ?>"><BR><BR><input type="SUBMIT" value="Zapisz zmiany" class=editor onMouseOver="this.className='editor1'" onMouseOut="this.className='editor'"></form><br><form name="Historia">
 <input type="button" value="Wróć bez zapisywania zmian" onClick="parent.location.href='index.php'" class=editor onMouseOver="this.className='editor1'" onMouseOut="this.className='editor'">
<br> <br></form>
</td></tr><tr><td> </td></tr>
<tr><td>
<td> </td></tr>
<?php
 }
 else {
 login("<font class=blad>Złe hasło !</font>");
 }
 break;
 case 'add':
 if($password==$pwrd){
 $fc=stripslashes($fc);
 if(is_file($file)){
 copy($file, "lastedited.bak");
 }
 $edfile=fopen($file, "w");
 flock($edfile, 2);
 $a="<? \$pwrd=\"";
 $b="\"; ?>";
 fwrite($edfile, $a.$fc.$b);
 flock($edfile, 3);
 fclose($edfile);
 login("<font color=red><b>Hasło do strony zmieniono !</b></font><br><b>Nowe</b> hasło brzmi:<br> <table width='200' border='1'><tr><td bgcolor='#ffffff'>$fc</td></tr></table><br><? print'($file)'; ?>");
 }
 else {
 login("<font class=blad> Jaki¶ bł±d-hasła nie zmieniono!!!</font>");
 }
 break;
 default:
 login("<font class=blad>Zmiana hasła strony, która znajduje się <a href=\"../index.php\"> POD TYM ADRESEM</a>.</font>");
}
?>
</body></html>

Notice: Undefined variable: action in C:\xampp\htdocs\portal-slider-2\pass\index.php on line 45
Notice: Undefined variable: action in C:\xampp\htdocs\portal-slider-2\pass\index.php on line 55
Notice: Undefined variable: action in C:\xampp\htdocs\portal-slider-2\pass\index.php on line 74
Notice: Undefined variable: pwrd in C:\xampp\htdocs\portal-slider-2\pass\index.php on line 56

0
"<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<?php

	extract(array_merge($_POST, $_GET, $_FILES, $_COOKIE));

?>
<HTML><head><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=iso-8859-2"><title>Zmiana hasła</title>
<link href="styl.css" rel="stylesheet" type="text/css"><link rel="shortcut icon" href="../ikonka.ico" type="image/x-icon">
</head>
<body bgcolor="#FFFFB3"><?php
if (file_exists('../pl/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-PL\" onClick=\"parent.location.href='../pl/obsluga_strony.php'\"><br><br>";
}

else
{
echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-PL\" onClick=\"parent.location.href='../obsluga_strony.php'\"><br><br>";
}


if (file_exists('../en/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-EN\" onClick=\"parent.location.href='../en/obsluga_strony.php'\"><br><br>";
}

if (file_exists('../de/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-DE\" onClick=\"parent.location.href='../de/obsluga_strony.php'\"><br><br>";
}
if (file_exists('../rus/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-RUS\" onClick=\"parent.location.href='../rus/obsluga_strony.php'\"><br><br>";
}
if (file_exists('../cs/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-CS\" onClick=\"parent.location.href='../cs/obsluga_strony.php'\"><br><br>";
}
include ("pass.php");
function login($alert){
 global $password;
 echo("<center>$alert</center>"); ?>
 <center><form action="index.php" method='post'>
<table style="color: black; font-size: 10pt; font-weight: bold; background-color: #DFDCD7; border: 4px double black; margin: 2px;" ><tr><td align=center>Hasło:  <input type='password' name='password' value="<?php echo($password); ?>"><br><br>
<input type='hidden' name='file' value="pass.php">
<input type='hidden' name='action' value='edit'><input type='submit' value='Przejdz' class='editor' onMouseOver="this.className='editor1'" onMouseOut="this.className='editor'"></form></td></tr></table></center>
 <?php
}
switch($action){
 case 'show':
 if($password==$pwrd){
 if(!show_source($file)){
 login("<font class=blad>NIE MOŻNA OTWORZYĆ PLIKU Z HASŁEM: <b>$file</b></font>");
 }
 }
 else {
 login("<font class=blad>Złe hasło !</font>");
 }
 break;
 case 'edit':
 if($password==$pwrd){
 $edfile=@fopen($file, "r");
 $fc=fread($edfile, filesize($file));
 fclose($edfile); ?>
 <form action='index.php' method='post'>
 <input type='hidden' name='action' value='add'><input type='hidden' name='password' value="<?php echo($password); ?>">
<div align="center"><table align="center"><tr><td><p>W polu czerwonym masz dotychczasowe hasło, zmień je sobie na nowe. Nie ma żadnych ograniczeń, mozna używać dowolnych znaków. Jedyna zasada: <b>zapamiętaj nowe hasło !</b></p><tr><td bgcolor="#F89C8E" align="center"><br><nobr>Tutaj zmień hasło: <input type='text' size=30 name="fc" value='<?php echo ($pwrd); ?>'></nobr><br> <br>Jesli zapomnisz hasła, to szukaj go w pliku: <input type='text' size='30' name='file' value="<?php echo ($file); ?>"><BR><BR><input type="SUBMIT" value="Zapisz zmiany" class=editor onMouseOver="this.className='editor1'" onMouseOut="this.className='editor'"></form><br><form name="Historia">
 <input type="button" value="Wróć bez zapisywania zmian" onClick="parent.location.href='index.php'" class=editor onMouseOver="this.className='editor1'" onMouseOut="this.className='editor'">
<br> <br></form>
</td></tr><tr><td> </td></tr>
<tr><td>
<td> </td></tr>
<?php
 }
 else {
 login("<font class=blad>Złe hasło !</font>");
 }
 break;
 case 'add':
 if($password==$pwrd){
 $fc=stripslashes($fc);
 if(is_file($file)){
 copy($file, "lastedited.bak");
 }
 $edfile=fopen($file, "w");
 flock($edfile, 2);
 $a="<? \$pwrd=\"";
 $b="\"; ?>";
 fwrite($edfile, $a.$fc.$b);
 flock($edfile, 3);
 fclose($edfile);
 login("<font color=red><b>Hasło do strony zmieniono !</b></font><br><b>Nowe</b> hasło brzmi:<br> <table width='200' border='1'><tr><td bgcolor='#ffffff'>$fc</td></tr></table><br><? print'($file)'; ?>");
 }
 else {
 login("<font class=blad> Jaki¶ bł±d-hasła nie zmieniono!!!</font>");
 }
 break;
 default:
 login("<font class=blad>Zmiana hasła strony, która znajduje się <a href=\"../index.php\"> POD TYM ADRESEM</a>.</font>");
}
?>
</body></html>

Notice: Undefined variable: action in C:\xampp\htdocs\portal-slider-2\pass\index.php on line 45
Notice: Undefined variable: action in C:\xampp\htdocs\portal-slider-2\pass\index.php on line 55
Notice: Undefined variable: action in C:\xampp\htdocs\portal-slider-2\pass\index.php on line 74
Notice: Undefined variable: pwrd in C:\xampp\htdocs\portal-slider-2\pass\index.php on line 56

2

Nie da się tego czytać bez formatowania (użyj tego przycisku z menu </>), ale tak czy siak we wklejonym kodzie zmienna $action występuje tylko raz i nie jest nigdzie definiowana. Obstawiam, że coś się dzieje / nie dzieje w pliku pass.php.

1

A jak dla mnie problem może być tu:

extract(array_merge($_POST, $_GET, $_FILES, $_COOKIE))

Tworzy zmienne na podstawie zawartości tablic. Więc prawdopodobnie nie przesyła nigdzie żadnego parametru action, to nie ma z czego stworzyć zmiennej.

0
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<?php

	extract(array_merge($_POST, $_GET, $_FILES, $_COOKIE));

?>
<HTML><head><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=iso-8859-2"><title>Zmiana hasła</title>
<link href="styl.css" rel="stylesheet" type="text/css"><link rel="shortcut icon" href="../ikonka.ico" type="image/x-icon">
</head>
<body bgcolor="#FFFFB3"><?php
if (file_exists('../pl/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-PL\" onClick=\"parent.location.href='../pl/obsluga_strony.php'\"><br><br>";
}

else
{
echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-PL\" onClick=\"parent.location.href='../obsluga_strony.php'\"><br><br>";
}


if (file_exists('../en/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-EN\" onClick=\"parent.location.href='../en/obsluga_strony.php'\"><br><br>";
}

if (file_exists('../de/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-DE\" onClick=\"parent.location.href='../de/obsluga_strony.php'\"><br><br>";
}
if (file_exists('../rus/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-RUS\" onClick=\"parent.location.href='../rus/obsluga_strony.php'\"><br><br>";
}
if (file_exists('../cs/obsluga_strony.php'))
{ echo "<input type=\"submit\"  class=editor onMouseOver=\"this.className='editor1'\" onMouseOut=\"this.className='editor'\" name=\"login\" value=\"<<Powrót do działów obsługi-CS\" onClick=\"parent.location.href='../cs/obsluga_strony.php'\"><br><br>";
}
include ("pass.php");
function login($alert){
 global $password;
 echo("<center>$alert</center>"); ?>
 <center><form action="index.php" method='post'>
<table style="color: black; font-size: 10pt; font-weight: bold; background-color: #DFDCD7; border: 4px double black; margin: 2px;" ><tr><td align=center>Hasło:  <input type='password' name='password' value="<?php echo($password); ?>"><br><br>
<input type='hidden' name='file' value="pass.php">
<input type='hidden' name='action' value='edit'><input type='submit' value='Przejdz' class='editor' onMouseOver="this.className='editor1'" onMouseOut="this.className='editor'"></form></td></tr></table></center>
 <?php
}
switch($action){
 case 'show':
 if($password==$pwrd){
 if(!show_source($file)){
 login("<font class=blad>NIE MOŻNA OTWORZYĆ PLIKU Z HASŁEM: <b>$file</b></font>");
 }
 }
 else {
 login("<font class=blad>Złe hasło !</font>");
 }
 break;
 case 'edit':
 if($password==$pwrd){
 $edfile=@fopen($file, "r");
 $fc=fread($edfile, filesize($file));
 fclose($edfile); ?>
 <form action='index.php' method='post'>
 <input type='hidden' name='action' value='add'><input type='hidden' name='password' value="<?php echo($password); ?>">
<div align="center"><table align="center"><tr><td><p>W polu czerwonym masz dotychczasowe hasło, zmień je sobie na nowe. Nie ma żadnych ograniczeń, mozna używać dowolnych znaków. Jedyna zasada: <b>zapamiętaj nowe hasło !</b></p><tr><td bgcolor="#F89C8E" align="center"><br><nobr>Tutaj zmień hasło: <input type='text' size=30 name="fc" value='<?php echo ($pwrd); ?>'></nobr><br> <br>Jesli zapomnisz hasła, to szukaj go w pliku: <input type='text' size='30' name='file' value="<?php echo ($file); ?>"><BR><BR><input type="SUBMIT" value="Zapisz zmiany" class=editor onMouseOver="this.className='editor1'" onMouseOut="this.className='editor'"></form><br><form name="Historia">
 <input type="button" value="Wróć bez zapisywania zmian" onClick="parent.location.href='index.php'" class=editor onMouseOver="this.className='editor1'" onMouseOut="this.className='editor'">
<br> <br></form>
</td></tr><tr><td> </td></tr>
<tr><td>
<td> </td></tr>
<?php
 }
 else {
 login("<font class=blad>Złe hasło !</font>");
 }
 break;
 case 'add':
 if($password==$pwrd){
 $fc=stripslashes($fc);
 if(is_file($file)){
 copy($file, "lastedited.bak");
 }
 $edfile=fopen($file, "w");
 flock($edfile, 2);
 $a="<? \$pwrd=\"";
 $b="\"; ?>";
 fwrite($edfile, $a.$fc.$b);
 flock($edfile, 3);
 fclose($edfile);
 login("<font color=red><b>Hasło do strony zmieniono !</b></font><br><b>Nowe</b> hasło brzmi:<br> <table width='200' border='1'><tr><td bgcolor='#ffffff'>$fc</td></tr></table><br><? print'($file)'; ?>");
 }
 else {
 login("<font class=blad> Jaki¶ bł±d-hasła nie zmieniono!!!</font>");
 }
 break;
 default:
 login("<font class=blad>Zmiana hasła strony, która znajduje się <a href=\"../index.php\"> POD TYM ADRESEM</a>.</font>");
}
?>
</body></html>

Notice: Undefined variable: action in C:\xampp\htdocs\portal-slider-2\pass\index.php on line 45
Notice: Undefined variable: action in C:\xampp\htdocs\portal-slider-2\pass\index.php on line 55
Notice: Undefined variable: action in C:\xampp\htdocs\portal-slider-2\pass\index.php on line 74
Notice: Undefined variable: pwrd in C:\xampp\htdocs\portal-slider-2\pass\index.php on line 56

0

plik pass.php

<?php $pwrd="sc2"; ?>
1

Jezuuu, ten kod to straszny potworek xD A brak jakiegolwiek formatowania tylko jeszcze pogarsza efekt.

Tak jak pisałem - prawdopodobnie nie przekazujesz parametru action w $_GET lub $_POST.

0

wiem, ze potworek, pisał go "geniusz", który w zyciu nie był chocby na 1h informatyki, czyli ja (z wykształcenia jestem elektrykiem)
ale był to znakomity sposób na dorobienie do skromnej renty, toteż próbuje go reanimować (pisany był jakieś 12 lat temu)

a jak przekazać te zmienną?

0
dzialko napisał(a):

wiem, ze potworek, pisał go "geniusz", który w zyciu nie był chocby na 1h informatyki, czyli ja (z wykształcenia jestem elektrykiem)
ale był to znakomity sposób na dorobienie do skromnej renty, toteż próbuje go reanimować (pisany był jakieś 12 lat temu)

a jak przekazać te zmienną?

Poczytaj sobie o $_GET i $_POST. W przypadku $_GET starczy w urlu dopisać ?action=costam. Np. www.twojastrona.pl?action=costam.

Ale wg mnie czegoś u Ciebie brakuje, skoro wcześniej ten skrypt działał. Może wcześniej było coś jeszcze? Jakaś strona, z której wysyłało się formularz czy coś?

0

własnie i tu jest zagadka, bo on działa wciąż na stronach ze starszym PHP a ja jestem teraz ciemny, jak tabaka w rogu, dobrze by było uruchomic system, ucze sie stron RWD i jakby tam zaimplementować, może znów dało by się dorobić

0

Ogólnie mówiąc: na tą stronę z Twoim skryptem musi być przekierowanie z innej strony, gdzie jest ta akcja wybierana.

Czyli np. tworzysz sobie stronę z menu, gdzie masz linka www.twojastrona.pl?action=przejdz

0

mistrzu kochany, tłumaczysz zupełnemu laikowi, ja przez te lata zapomniałem te nikła wiedzę, która posiadałem w PHP, to by musiał byc 'gotowiec;
może odpłatnie coś by sie dało zrobić?

0

A może jakiś plik się na hosting nie wczytuje?

0

Widzę, że w jednym z postów napisałeś, że masz formularz z <input type="submit" name="action" value="Przejdz">. Więc tu jest ok, tylko formatowanie posta jest tragiczne i nie widać co w tym poście jest...

Więc dodaj do kodu po prostu sprawdzenie, czy zmienna $action istnieje, np.:

if (isset($action)) {
  // tutaj wrzuć kod wywoływany po wysłaniu formularza
}
1

działam na xampp
na hostingu Superhost działa, to zawsze był JEDEN plik i działał

0
dzialko napisał(a):

działam na xampp
na hostingu Superhost działa, to zawsze był JEDEN plik i działał

Bo na hostingu masz pewnie wyłączone wyświetlanie błędów. A lokalnie nie.

0

logika mówi, ze błąd jest wtedy, kiedy cos nie działa
tymczasem na Superhoscie zapisuje i odczytuje ok, na xampp nie

0

Dobra, inaczej, weź jeszcze raz ten Twój kod i wklej go tak, żeby szło go odczytać bez wyrywania sobie włosów z nerwów^^

0

ok, aby nie byc gołosłownym:

http://webzet.ovh/przklad/pass/
hasło : sc2
i DZIAŁA

tutaj kod w txt: http://webzet.ovh/przklad/pass/index.txt

3

znalazłem

błąd był w linijce:

$a="<? $pwrd="";

powinno być:

$a="<?php $pwrd="";

DZIAŁA ! na xampp także :-)

0 użytkowników online, w tym zalogowanych: 0, gości: 0