justus Posted March 28, 2004 Report Share Posted March 28, 2004 kaa lai izviedo redirekteeshanu, man ir: if ("$a ==$b"){ redirekteet uz citu url else echo ("viss OK"); } kaa var izveidot paaradresaaciju, veelams uzreiz bez laika aiztures Link to comment Share on other sites More sharing options...
Aleksejs Posted March 28, 2004 Report Share Posted March 28, 2004 if ("$a ==$b"){ header('Location: citalapa.htm'); echo '<html><head><META HTTP-EQUIV="refresh" content="1;URL=http://hosts/citalapa.htm"></head></html>'; } else{ echo ("viss OK"); } Link to comment Share on other sites More sharing options...
justus Posted March 28, 2004 Author Report Share Posted March 28, 2004 if ("$a ==$b"){ header('Location: citalapa.htm'); echo '<html><head><META HTTP-EQUIV="refresh" content="1;URL=http://hosts/citalapa.htm"></head></html>'; } else{ echo ("viss OK"); } man kautkas nav kaartiiba kur tas redirection izpilde jaaliek? manparaadaas shaads te: Warning: Cannot modify header information - headers already sent by(bla bla blaa); vinsh nav jaaliek pashaa augshaa pirms <HEAD> tagiem? Link to comment Share on other sites More sharing options...
Gacha Posted March 28, 2004 Report Share Posted March 28, 2004 Ieleic lapas pashaa augshaa ob_start(); pirms <html> Link to comment Share on other sites More sharing options...
justus Posted March 28, 2004 Author Report Share Posted March 28, 2004 man tas redirection ir sataisiits atsevikaa modulii un inkludoju vinju, kur vajag, nesaprotu kur vaina ir: pashaa modulii vai tajaa failaa kur vinju inkludoju? Warning: Cannot modify header information - headers already sent by (output started at /localhost/index.php:4) in localhost/redirection.php on line 9 Link to comment Share on other sites More sharing options...
Aleksejs Posted March 28, 2004 Report Share Posted March 28, 2004 (edited) Header drīkst sūtīt tikai pirms jebkādiem citiem datiem. Ja tev pirms tam notiek datu izvads (ar echo, printf, visādi warningi/notice, ko PHP metārā, vienkārši enters iespiests PHP skripta sākumā)- tad HTTP hederi jau ir aizsūtīti un klients vairs nav spējīgs tādus saņemt. Tavā gadījumā datu izvads jau sācies 4. rindiņā. Edited March 28, 2004 by Aleksejs Link to comment Share on other sites More sharing options...
Gacha Posted March 28, 2004 Report Share Posted March 28, 2004 Tas ir tā, ja tev ir index.php un modulis.php ko tu inkludo, tad tev tas ob_start(); jaliek ir index.php pašā sākumā pirms html <?php ob_start(); ?> Link to comment Share on other sites More sharing options...
bubu Posted March 29, 2004 Report Share Posted March 29, 2004 tak helpaa vajg maaceet apskatiites pie header() funkcijas! Link to comment Share on other sites More sharing options...
justus Posted March 29, 2004 Author Report Share Posted March 29, 2004 header('Location: citalapa.htm'); echo '<html><head><META HTTP-EQUIV="refresh" content="1;URL=http://hosts/citalapa.htm"></head></html>'; [\CODE] kaada atskiriiba ir ar sho [code] header("Location: /citalapa.htm"); exit(); Link to comment Share on other sites More sharing options...
Aleksejs Posted March 29, 2004 Report Share Posted March 29, 2004 Atšķirība ir tāda, ka, ja gadījumā klients noignorē Location hederi, tam papildus tiek padots http_equiv tags. Normālā gadījumā nevajadzētu būt vajadzībai no http-equiv. Link to comment Share on other sites More sharing options...
justus Posted March 30, 2004 Author Report Share Posted March 30, 2004 man ar to rediktereeshanu ir taa pameeginaaju sho skriptu: header('Location: citalapa.htm'); echo '<html><head><META HTTP-EQUIV="refresh" content="1;URL=http://hosts/citalapa.htm"></head></html>'; gan sho: header("Location: /citalapa.htm"); exit(); lieta taada ka pirmais skripts saakumaa straadaaja normaali, bet tad peeksnji nestraadaaja vispaar nekaadus erroru neizmet viss OK, bet redirekts nenotiek, tad meeginaaju vienkaarsho variantu un ar to arii tas pats paaris reizes straadaaja un viss, nesprotu kas pa lietu?? :angry: :angry: :angry: :angry: :angry: :angry: :angry: :( :( :( :( :( :( Link to comment Share on other sites More sharing options...
Aleksejs Posted March 30, 2004 Report Share Posted March 30, 2004 Nu, piemēram, man telepātiskās spējas ir novērotas ārkārtīgi retos gadījumos... Tādēļ grūti tev kaut kā palīdzēt, ņemot par pamatu tevis sniegto informāciju... Vienīgā ideja - esi noņēmis error reportingu un dažos skriptos tev hederis tiek sūtīts korekti pirms datiem, bet citos tad, kad dati jau aizsūtīti (tobiš netiek). Link to comment Share on other sites More sharing options...
justus Posted March 30, 2004 Author Report Share Posted March 30, 2004 error reportingu raada un pirms tam nekKAADA IZVADE NENOTIEK, to es toch zinu!!! Link to comment Share on other sites More sharing options...
Aleksejs Posted March 30, 2004 Report Share Posted March 30, 2004 Tad nav lemts. Link to comment Share on other sites More sharing options...
justus Posted March 30, 2004 Author Report Share Posted March 30, 2004 nu labi var arii taa, bet man tas tomeer neliek mieru kaa taa var buut: sataisu visu viss notiek normaali, viss straadaa paaris reizes paaarbaudi un peec kaada laika ieej veel un viss nekas nenotiek Link to comment Share on other sites More sharing options...
Recommended Posts