ricshs Posted April 12, 2007 Report Share Posted April 12, 2007 Sveiki! Ir skripts: http://paste.php.lv/5446 Bet kā pielāgot, lai rādītu tikai to lapu, kura ir izvēlēta un iepriekš izvēlēto nodzēstu? Paldies! Link to comment Share on other sites More sharing options...
Val Posted April 12, 2007 Report Share Posted April 12, 2007 vēlreiz un lēnāk... failu vajag izdzēst? Link to comment Share on other sites More sharing options...
hackerman Posted April 12, 2007 Report Share Posted April 12, 2007 piemeers: <?php switch($_GET['do']) { case 'lapa2': include('lapa2.php'); break; case 'lapa1': include('lapa1.php'); break; default: echo ''; break; } ?> Link to comment Share on other sites More sharing options...
ricshs Posted April 12, 2007 Author Report Share Posted April 12, 2007 (edited) nu itkā vis būtu okey, bet viena nelaime, man tagad nevelkās līdz izvēlne - lapa1 un lapa2 Ieskaties: Sheit <? $pg = $_GET['pg']; $lg = $_GET['lg']; if ($pg==1&&$lg==lv){ include("header.php"); break; } else if ($pg==2&&$lg==lv){ include("headers.php"); break; } ?> <a href="?pg=1&lg=lv">1. lapa</a> <a href="?pg=2&lg=lv">2. lapa</a> Edited April 12, 2007 by ricshs Link to comment Share on other sites More sharing options...
hackerman Posted April 12, 2007 Report Share Posted April 12, 2007 Man to adresi never vaļā =/ Link to comment Share on other sites More sharing options...
ricshs Posted April 12, 2007 Author Report Share Posted April 12, 2007 (edited) sory, sachakareeju! :) Mēģini vēlreiz! :) Edited April 12, 2007 by ricshs Link to comment Share on other sites More sharing options...
Val Posted April 12, 2007 Report Share Posted April 12, 2007 (edited) pasaki man, kāpēc vajadzīgs break iekš if? //izdzēs to break; un miers Edited April 12, 2007 by Val Link to comment Share on other sites More sharing options...
ricshs Posted April 12, 2007 Author Report Share Posted April 12, 2007 Nav nejausmas, kas tad vajadzētu likt vietā? Link to comment Share on other sites More sharing options...
bubu Posted April 12, 2007 Report Share Posted April 12, 2007 Tev silti iesaku - atver šo adresi un izlasi (ja angliski nesaproti, tad ir pieejams tas pats arī krieviski, un eksistē tādas lietas kā vārdnīca): http://lv2.php.net/break Link to comment Share on other sites More sharing options...
Stopp Posted April 12, 2007 Report Share Posted April 12, 2007 1) neko nevajag. http://lv2.php.net/manual/en/language.control-structures.php 2) Tanī tavā koda gabalā ir viena sintakses kļūda, un stringus derētu iekš pēdiņām likt. 3) papēti: izvēlne: <a href="shii_lapa.php?lapa=viena">viena lapa</a> vai <a href="shii_lapa.php?lapa=otra">otra lapa</a><br/><br/> <?php $lapa=isset($_GET['lapa'])?$_GET['lapa']:''; if ($lapa=='viena') { include('viena_lapa.php'); } else if ($lapa=='otra') { include('otra_lapa.php'); } else { include ('galvenaa_lapa.php'); } ?> Link to comment Share on other sites More sharing options...
ricshs Posted April 13, 2007 Author Report Share Posted April 13, 2007 stopp, paldies tev, izpeetiiju skriptu un izpratu ko siikaak par get funkciju! :) Liels paldies! ;) Link to comment Share on other sites More sharing options...
andrisp Posted April 13, 2007 Report Share Posted April 13, 2007 ricshs, GET nav fja ;). Tas ir masīvs, caur kuru var piekļūt visām vērtībām, kas padotas caur URL (tā rupji runājot). Link to comment Share on other sites More sharing options...
ricshs Posted April 13, 2007 Author Report Share Posted April 13, 2007 nu jaa, man stienis, bet es nedomaju par tadu funkciju, bet par tautiski sakaamo funkciju! :) Link to comment Share on other sites More sharing options...
bubu Posted April 13, 2007 Report Share Posted April 13, 2007 Kas ir "tautiski sakāmā funkcija"? Pirmo reizi kautko tādu dzirdu. Link to comment Share on other sites More sharing options...
ricshs Posted April 14, 2007 Author Report Share Posted April 14, 2007 Ei galiig... Tas bija domaats taa, kaa ,piemēram, "Ritena zobrats pilda savu funkciju" Zinaaju, ka kaads praatveeders piesiesies nevieta, un topica tema ir atrisinaata! Link to comment Share on other sites More sharing options...
Recommended Posts