Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Undefined index
ilov3
post
Post #1





Grupa: Zarejestrowani
Postów: 31
Pomógł: 0
Dołączył: 12.07.2013

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


Witam, mam problem z uruchomieniem stronki którą kiedyś napisał kolega.
Pluje errorami.

  1. Notice: Undefined index: action in C:\xampp\htdocs\index.php on line 239
  2.  
  3. Notice: Undefined index: action in C:\xampp\htdocs\index.php on line 325
  4.  
  5. Notice: Undefined index: action in C:\xampp\htdocs\index.php on line 455
  6.  
  7. Notice: Undefined index: action in C:\xampp\htdocs\index.php on line 461


239:
  1. else if($_GET['action'] === "editprofile")
  2. {
  3. if(empty($_SESSION['username']) || empty($_SESSION['password']))
  4. {
  5. header("Refresh:0; url=index.php");
  6. echo "<script language='javascript'>alert('Musisz być zalogowany!');</script>";
  7. return 0;
  8. }


  1. else if($_GET['action'] === "newauction")
  2. {
  3. $query = mysql_query("SELECT * FROM categories");
  4. while ($row = mysql_fetch_array($query))
  5. {
  6. $auctionCategories .= '
  7. <option value="'.$row[id].'">'.$row[name].'</option>
  8. ';
  9. }


Połączenie z bazą:

  1. <?php
  2.  
  3. $connection = @mysql_connect("localhost", "root", "") or die("Brak połączenia z serwerem MySQL.<br />Błąd: ".mysql_error());
  4. $db = @mysql_select_db("zpi_project", $connection) or die("Nie mogę połączyć się z bazą danych<br />Błąd: ".mysql_error());
  5. mysql_query ('SET NAMES utf8');
  6. ?>



W czym może leżeć problem?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Tomplus
post
Post #2





Grupa: Zarejestrowani
Postów: 1 884
Pomógł: 231
Dołączył: 20.03.2005
Skąd: Będzin

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


Nie tłumacz się kolegą. Zostawiaj kod lepszy niż ten który zastałeś. Więc jak są takie ewidentne dziury w bezpieczeństwie, to nawet nie ma co dopuszczać później w internety.

Kod
\xampp\apache\logs\error.log
Go to the top of the page
+Quote Post
ilov3
post
Post #3





Grupa: Zarejestrowani
Postów: 31
Pomógł: 0
Dołączył: 12.07.2013

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


Cytat(Tomplus @ 27.11.2019, 22:19:24 ) *
Nie tłumacz się kolegą. Zostawiaj kod lepszy niż ten który zastałeś. Więc jak są takie ewidentne dziury w bezpieczeństwie, to nawet nie ma co dopuszczać później w internety.

Kod
\xampp\apache\logs\error.log


Na bezpieczeństwie mi nie zależy, chcę jedynie odpalić to lokalnie.

Kod
[Thu Nov 28 09:23:12.683963 2019] [ssl:warn] [pid 4812:tid 612] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Nov 28 09:23:12.731950 2019] [core:warn] [pid 4812:tid 612] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Thu Nov 28 09:23:12.836334 2019] [ssl:warn] [pid 4812:tid 612] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Nov 28 09:23:13.228240 2019] [mpm_winnt:notice] [pid 4812:tid 612] AH00455: Apache/2.4.37 (Win32) OpenSSL/1.0.2p PHP/5.6.40 configured -- resuming normal operations
[Thu Nov 28 09:23:13.228240 2019] [mpm_winnt:notice] [pid 4812:tid 612] AH00456: Apache Lounge VC11 Server built: Oct 22 2018 14:14:30
[Thu Nov 28 09:23:13.228240 2019] [core:notice] [pid 4812:tid 612] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Thu Nov 28 09:23:13.256227 2019] [mpm_winnt:notice] [pid 4812:tid 612] AH00418: Parent: Created child process 15276
[Thu Nov 28 09:23:14.261850 2019] [ssl:warn] [pid 15276:tid 636] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Nov 28 09:23:14.401825 2019] [ssl:warn] [pid 15276:tid 636] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Thu Nov 28 09:23:14.436410 2019] [mpm_winnt:notice] [pid 15276:tid 636] AH00354: Child: Starting 150 worker threads.
[Thu Nov 28 09:23:54.110543 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: action in C:\\xampp\\htdocs\\index.php on line 49
[Thu Nov 28 09:23:54.110543 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: action in C:\\xampp\\htdocs\\index.php on line 107
[Thu Nov 28 09:23:54.110543 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: action in C:\\xampp\\htdocs\\index.php on line 239
[Thu Nov 28 09:23:54.110543 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: action in C:\\xampp\\htdocs\\index.php on line 325
[Thu Nov 28 09:23:54.114542 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: action in C:\\xampp\\htdocs\\index.php on line 455
[Thu Nov 28 09:23:54.114542 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: action in C:\\xampp\\htdocs\\index.php on line 461
[Thu Nov 28 09:23:54.114542 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: action in C:\\xampp\\htdocs\\index.php on line 533
[Thu Nov 28 09:23:54.114542 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: action in C:\\xampp\\htdocs\\index.php on line 587
[Thu Nov 28 09:23:54.114542 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: action in C:\\xampp\\htdocs\\index.php on line 649
[Thu Nov 28 09:23:54.114542 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: action in C:\\xampp\\htdocs\\index.php on line 754
[Thu Nov 28 09:23:54.114542 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: action in C:\\xampp\\htdocs\\index.php on line 805
[Thu Nov 28 09:23:54.114542 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: action in C:\\xampp\\htdocs\\index.php on line 930
[Thu Nov 28 09:23:54.114542 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: action in C:\\xampp\\htdocs\\index.php on line 961
[Thu Nov 28 09:23:54.118559 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: action in C:\\xampp\\htdocs\\index.php on line 1109
[Thu Nov 28 09:23:54.138534 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined variable: categories in C:\\xampp\\htdocs\\index.php on line 1220
[Thu Nov 28 09:23:54.158558 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: username in C:\\xampp\\htdocs\\index.php on line 1267
[Thu Nov 28 09:23:54.162538 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined index: password in C:\\xampp\\htdocs\\index.php on line 1267
[Thu Nov 28 09:23:54.198519 2019] [:error] [pid 15276:tid 2036] [client ::1:7204] PHP Notice:  Undefined variable: auctions in C:\\xampp\\htdocs\\index.php on line 1316


raczej nic nowego niż to co wyświetla się wraz z stroną główną
Go to the top of the page
+Quote Post

Posty w temacie
- ilov3   Undefined index   25.11.2019, 23:02:21
- - dublinka   Odpowiedzi szukaj w $_GET['action']   26.11.2019, 07:53:40
- - ilov3   tylko dziwna sprawa bo kiedyś to działało bez żadn...   26.11.2019, 08:30:39
- - dublinka   Zmienna z get nie istnieje/brak wartosci   26.11.2019, 10:11:21
- - nospor   Cytattylko dziwna sprawa bo kiedyś to działało bez...   26.11.2019, 10:14:21
|- - ilov3   Cytat(nospor @ 26.11.2019, 10:14:21 )...   26.11.2019, 11:14:24
- - viking   Bo to mysql_query i inne funkcje mysql_ zostały da...   26.11.2019, 11:16:10
|- - ilov3   Cytat(viking @ 26.11.2019, 11:16:10 )...   26.11.2019, 11:16:57
- - nospor   Daj w index.php na samym poczatku phpinfo(); exit...   26.11.2019, 11:18:24
|- - ilov3   Cytat(nospor @ 26.11.2019, 11:18:24 )...   26.11.2019, 11:32:00
- - nospor   Bo przeciez zrobic phpinfo(); exit; to tak dlugo...   26.11.2019, 11:34:27
|- - ilov3   Cytat(nospor @ 26.11.2019, 11:34:27 )...   26.11.2019, 11:54:56
- - nospor   Aktualizowales ostatnio ten wampserver? Jak wygla...   26.11.2019, 12:00:02
- - ilov3   Mam najnowszą dostępną wersję. Próbowałem również ...   26.11.2019, 13:37:24
- - nospor   CytatI obiecana wersja PHP:Nie. Obiecales screena ...   26.11.2019, 15:55:15
|- - ilov3   Cytat(nospor @ 26.11.2019, 15:55:15 )...   26.11.2019, 21:57:39
- - Tomplus   zapytań przed SQL Injection nie chronisz? Sprawdź...   27.11.2019, 09:28:13
|- - ilov3   Cytat(Tomplus @ 27.11.2019, 09:28:13 ...   27.11.2019, 21:30:26
- - dublinka   Przepraszam za trywialne pytanie ale czy wogole w ...   27.11.2019, 13:10:18
- - Tomplus   Nie tłumacz się kolegą. Zostawiaj kod lepszy niż t...   27.11.2019, 22:19:24
|- - ilov3   Cytat(Tomplus @ 27.11.2019, 22:19:24 ...   28.11.2019, 09:28:18
- - Tomplus   Teraz przeanalizuj sobie te logi porównując do swo...   28.11.2019, 10:10:18
- - ilov3   Nic z tego. Dzięki za próbę pomocy.   29.11.2019, 21:21:09


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: 13.10.2025 - 01:33