Bunkertor 7 Posted February 26, 2008 Report Share Posted February 26, 2008 Sveiki! Re kaa visi censhaas tikt valjaa no dinamiskiem URL, bet man shoreiz gluzhi otraadi vajag taadus uztaisiit. Mainu visu lapas struktuuru, bet dazhiem URL ir jaapaliek taadiem, kaadi tie bija agraak (deelj search enginiem) Uzrakstiiju kaut ko peec shitaadas idejas, bet nekas nesanaak: $myselection = array('21','22','23','24'); if (in_array($_GET['id'], $myselection)) { include ($_SERVER['DOCUMENT_ROOT'] . '/source/' . $_GET['id'] . '.php'); } Cik es saprotu, ar GET arii nekas nesanaaks, jo man globals ir off. Buushu pateiciigs par kaadu ideju. Link to comment Share on other sites More sharing options...
anonīms Posted February 26, 2008 Report Share Posted February 26, 2008 (edited) if(isset($_GET['id'])) { } ? Edited February 26, 2008 by anonīms Link to comment Share on other sites More sharing options...
andrisp Posted February 26, 2008 Report Share Posted February 26, 2008 Ko tev īsti vajag izdarīt ? Pēc tava skaidrojuma nesapratu. Cik es saprotu, ar GET arii nekas nesanaaks, jo man globals ir off. kā to saprast ? Link to comment Share on other sites More sharing options...
Bunkertor 7 Posted February 26, 2008 Author Report Share Posted February 26, 2008 Ko tev īsti vajag izdarīt ? Pēc tava skaidrojuma nesapratu. Man kaadreiz bija vecs content management skripts, un lapaa visi faili bija domain.com/filename.php?id=10 domain.com/filename.php?id=11 utt... Tagad esmu visu paarrakstiijis un faili ir domain.com/faila-nosaukums.php utt Bet... probleema ir, ka dazhiem vecajiem failiem ir augsts PR un es to negribu zaudeet. Taapeec man vajag, lai paaris no tiem vecajiem failiem turpinaatu atbildeet uz pieprasiijumu peec domain.com/filename.php?id=10 utml. Taisiit 301 redirect nevar... ilgi staastiit... nevar un viss :D, bet taa kaa vecais content managements ir izniicinaats un izdzeests, man tagad vajag izdomaat, kaa dabuut paaris funkcioneejoshus dinamiskus URLus. Link to comment Share on other sites More sharing options...
andrisp Posted February 26, 2008 Report Share Posted February 26, 2008 Kāpēc redirektu nevar taisīt ? Bet vispār, vari mēģināt šādi: $myselection = array( '21' => 'blabla.php', '22' => 'blabla2.php' ); if (!empty($_GET['id']) && in_array($_GET['id'], $myselection)) { include ($_SERVER['DOCUMENT_ROOT'] . '/source/' . $myselection[$_GET['id']] . '.php'); } Link to comment Share on other sites More sharing options...
Bunkertor 7 Posted February 26, 2008 Author Report Share Posted February 26, 2008 (edited) Kāpēc redirektu nevar taisīt ? Bet vispār, vari mēģināt šādi: Eeh... paldies, ideja laba, bet taapat kaa manaa pirmajaa variantaa, nekas nenotiek... balts ekraans... Redirektu negribeejaas, jo es plaanoju to lapu saturu pa briidim papildinaat, bet laikam jau nekas cits neatliks. Taa nav pirmaa reize, kad izmantojot GET(pat ljoti vienkaarshos skriptos), es redzu baltu ekraanu. Esmu par to runaajis ar savu hostinga provaideri, bet shis rausta plecus... un vispaar jau es arii PR varu pazaudeet, visu laiku izmantojot redirektu... Edited February 26, 2008 by Bunkertor 7 Link to comment Share on other sites More sharing options...
andrisp Posted February 26, 2008 Report Share Posted February 26, 2008 Nez, nevaru iedomāties kā tas var būt, ka balta lapa veras, ja padod GET parametrus. Visticamāk, ka tev vienkārši tas ceļš nepareizs. Link to comment Share on other sites More sharing options...
fest Posted February 26, 2008 Report Share Posted February 26, 2008 error_reporting un DisplayErrors ir ieslēgti? Link to comment Share on other sites More sharing options...
Paulinjsh Posted February 27, 2008 Report Share Posted February 27, 2008 taisi tik ar 301 redirektu un būs viss ok Link to comment Share on other sites More sharing options...
Recommended Posts