keissfootball Posted October 29, 2005 Report Share Posted October 29, 2005 (edited) īsāk, man ir balsošanas administrēšana, bet kaut kas neiet, raksta, ka Warning: Cannot modify header information - headers already sent by (output started at /usr/home/lfka-ftp/poll/admin.php:3) in /usr/home/lfka-ftp/poll/admin.php on line 62 Warning: Cannot modify header information - headers already sent by (output started at /usr/home/lfka-ftp/poll/admin.php:3) in /usr/home/lfka-ftp/poll/admin.php on line 63 bet es tur neko nemainīju, nesaprotu, kāpēc viņš tur kļūdu rāda??? es ieliku kodu šeit: http://paste.php.lv/2760 Edited October 29, 2005 by keissfootball Link to comment Share on other sites More sharing options...
v3rb0 Posted October 29, 2005 Report Share Posted October 29, 2005 atrodi 3 atskiriibas starp http://php.lv/f/index.php?showtopic=3307&pid=25842&st=0 un http://php.lv/f/index.php?showtopic=3305&pid=25834&st=0 :) Link to comment Share on other sites More sharing options...
bubu Posted October 29, 2005 Report Share Posted October 29, 2005 (edited) Tikko tāda pat tēma taču bija jau: http://php.lv/f/index.php?showtopic=3305&hl= Ah.. v3rb0 jau pasteidzās :) Edited October 29, 2005 by bubu Link to comment Share on other sites More sharing options...
keissfootball Posted October 29, 2005 Author Report Share Posted October 29, 2005 (edited) varbūt, ja es redzētu, kā ir atrisināta tā situācija, tad zinātu kā atrisināt šo :D un kas te man ir outputs, šitais if ($_POST["password"]==$PASSWORD) ??? if ($_POST["password"]==$PASSWORD) { header("Set-Cookie: USER_AUTH[auth]=1; Max-Age=3600; Domain=.$DOMAIN; Path=/;"); header("Location: admin.php?action=menu"); } else { es nesaprotu, ko bija kļūda jau pašā sākumā skriptā, jo es te neko nemainīju? PSC man besii ka neko nerubiiju, kas vispaar bija outputs? outputs bija tjipa echo? :( nu tur tjipa ir viens headers no 13-16 rindai pirms tiem diviem headeriem, bet vai tad visi dati netiek sūtīti??? :blink: :blink: :blink: 1.. edit: tad man jāliek pašā koda augšā hederi un tad tikai jāsūta tā pārējā informācija kā title utt. ??? Edited October 29, 2005 by keissfootball Link to comment Share on other sites More sharing options...
bubu Posted October 29, 2005 Report Share Posted October 29, 2005 A kāpēc tu domā ka tur IR outputs? Outputs jau nedrīkst būt jebkur pirms pirmā headera. Tas ir jebkur augstāk (faila sākumā piemēram). Tas koda fragments, ko tu iekopēji nekā mums neizsaka. Link to comment Share on other sites More sharing options...
php_Stopp Posted October 29, 2005 Report Share Posted October 29, 2005 sākumā tev takš uz pārlūku tiek aizsūtīts šitais: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> #23 #24 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="sv" lang="sv"> #25 <head> #26 #27 <meta http-equiv="Content-Type" content="text/html; charset=windows-1257"> #28 <title>Balsošanas administrēšana</title> #29 <style type="text/css" media="screen">@import "admin.css";</style> #30 </head> #31 <body> #32 #33 <div id="adminbody"> #34 <h1>Balsošanas administrēšana</h1> ne ? un pēc tam ir tas if $action==login { visi headeri } Link to comment Share on other sites More sharing options...
php_Stopp Posted October 29, 2005 Report Share Posted October 29, 2005 13.-16. rindā ir funkcija, tātad tas headeris nepildās, ja tu neesi to funkciju kaukur izsaucis.. un tad varbūt tās cik rindiņas iekopē katrā outputa sākumā. visu kodu neiešu pētīt, kā būs izdevīgāk. Link to comment Share on other sites More sharing options...
keissfootball Posted October 29, 2005 Author Report Share Posted October 29, 2005 (edited) nu a ja es tā ielieku: <?php if (!isset($_GET["action"])) { $action = $_POST["action"]; } else { $action = $_GET["action"]; } if(!isset($action)) { // ########## Login form ########## ?> <?php require 'settings.php'; require 'pollcode.php'; function checkAuth() { if (!$_COOKIE["USER_AUTH"]["auth"]=='1') { header("Location: admin.php"); } } ob_start(); ?> <?php } elseif($action=='login') { // ########## Login procedure ########## if ($_POST["password"]==$PASSWORD) { header("Set-Cookie: USER_AUTH[auth]=1; Max-Age=3600; Domain=.$DOMAIN; Path=/;"); header("Location: admin.php?action=menu"); } else { ?> Tad it kā jau visu rāda normāli, tikai nez kāpēc viņš saka, ka pareizā parole ir nepareiza :huh: Edited October 29, 2005 by keissfootball Link to comment Share on other sites More sharing options...
php_Stopp Posted October 29, 2005 Report Share Posted October 29, 2005 (edited) nu a ja es tā ielieku: <?php require 'settings.php'; require 'pollcode.php'; function checkAuth() { if (!$_COOKIE["USER_AUTH"]["auth"]=='1') { header("Location: admin.php"); } } ob_start(); ?> <?php } elseif($action=='login') { // ########## Login procedure ########## if ($_POST["password"]==$PASSWORD) { header("Set-Cookie: USER_AUTH[auth]=1; Max-Age=3600; Domain=.$DOMAIN; Path=/;"); header("Location: admin.php?action=menu"); } else { ?> Tad it kā jau visu rāda normāli, tikai nez kāpēc viņš saka, ka pareizā parole ir nepareiza :huh: 25855[/snapback] eemm.. uz ko tur attiecinās } simbols ? baidos, ka šādi kods nestrādās gan. kā var būt elseif, ja nau if ? Edited October 29, 2005 by php_Stopp Link to comment Share on other sites More sharing options...
keissfootball Posted October 29, 2005 Author Report Share Posted October 29, 2005 (edited) es esmu laikam iebraucis auzās :( Edited October 29, 2005 by keissfootball Link to comment Share on other sites More sharing options...
keissfootball Posted October 29, 2005 Author Report Share Posted October 29, 2005 jautājums ne par tēmu, php_Stopp kāpēc ja tik daudz zini par php, tava web-lapa ir samērā vienkārša? Link to comment Share on other sites More sharing options...
bubu Posted October 29, 2005 Report Share Posted October 29, 2005 uhh, es gan to nesaukt par vienkāršu lapu. Tajā navigācijā pa to divas reizes apmaldījos ;) Link to comment Share on other sites More sharing options...
keissfootball Posted October 29, 2005 Author Report Share Posted October 29, 2005 ;D jā, bet kas te man traucē headera izvadīšanai? Link to comment Share on other sites More sharing options...
bubu Posted October 29, 2005 Report Share Posted October 29, 2005 settings/pollcode .php faili? unicodes 3-baitu headeris? Link to comment Share on other sites More sharing options...
php_Stopp Posted October 29, 2005 Report Share Posted October 29, 2005 (edited) oj shit, ku es sen to lapu taisīju ;) man liekas gads jau drīz būs kopš pēdējā update :P tagad ar WAP krāmējos, Web apnika. bet jā - vai tajos divos inclūdotajos failos nav neviena outputa ? ps. output ir tā informācija, kas tiek aizsūtīta uz pārlūkprogrammu ;) echo, print un viss ārpus <? ?>. jā, arī inclūdot kādu txt documentu. Edited October 29, 2005 by php_Stopp Link to comment Share on other sites More sharing options...
Recommended Posts