*jancis38* Posted May 6, 2007 Report Share Posted May 6, 2007 kā var uztaisīt tā, ka esmu iegājis webbrowseri links uzrāda šādi: http://localhost/index.php izvēlnē ieklikščinu piem. Bildes, un webbrowserī parādas: http://localhost/index.php?do=bildes kā ta var uztaisīt? Link to comment Share on other sites More sharing options...
andrisp Posted May 6, 2007 Report Share Posted May 6, 2007 Mī un žē: <a href="index.php?do=bildes">Bildes</a> Link to comment Share on other sites More sharing options...
*jancis38* Posted May 6, 2007 Author Report Share Posted May 6, 2007 nu jā labi ok. to viņš webbrowseri parāda, bet viņš tak paliks tajā pašā index.php bet kā lau iztaisi lai rādas: http://localhost/index.php?do=bildes un tu atrodies jau bildes.php tikai browserī rādas: http://localhost/index.php?do=bildes Link to comment Share on other sites More sharing options...
andrisp Posted May 6, 2007 Report Share Posted May 6, 2007 Nu, tev skriptā jāienkludo fails atkarībā no tā, kas norādīts iekš $_GET['do']. Vairākas reizes jau šis aprunāts. $a = array('bildes' => 'bildes.php', 'sakums' => 'sakums.php', utt); if (!empty($a[$_GET['do']])) { require($a[$_GET['do']]); } else { require('sakums.php'); } Link to comment Share on other sites More sharing options...
*jancis38* Posted May 6, 2007 Author Report Share Posted May 6, 2007 neko nesapratu. :( Link to comment Share on other sites More sharing options...
andrisp Posted May 6, 2007 Report Share Posted May 6, 2007 Nu slikti tad. Jāmācas php sintakse. Ņem priekšā manuāli un studē. Link to comment Share on other sites More sharing options...
Val Posted May 6, 2007 Report Share Posted May 6, 2007 pārlasi to pašu rīt no rīta. ar labu nakti. :) Link to comment Share on other sites More sharing options...
*jancis38* Posted May 6, 2007 Author Report Share Posted May 6, 2007 man te metājās vienā mapē šitāds kods: <?php $id = $_GET['id']; switch($id) { default: case '1': include 'index2.php'; break; case '2': include 'index3.php'; break; } ?> bet es nevaru saprast ko ar viņu darīt? man menu ir ielikts ar include, vai man includotajā menu php failā ir jaieraksta šis kods? Link to comment Share on other sites More sharing options...
andrisp Posted May 6, 2007 Report Share Posted May 6, 2007 Taisi galveno failu index.php, kur iekļauj to menu failu, un tad ar manis doto vai tavu kodu iekļauj attiecīgo satura failu (atkarībā no $_GET['do']). Link to comment Share on other sites More sharing options...
vacis Posted May 7, 2007 Report Share Posted May 7, 2007 bet vai iespejams, kad es ieeju adresee www.lapa.com, skripts nomaina web browzera adreses laukaa adresi neieejot tajaa uz www.lapa2.com ? :) Link to comment Share on other sites More sharing options...
andrisp Posted May 7, 2007 Report Share Posted May 7, 2007 Nav iespējams. Link to comment Share on other sites More sharing options...
peehaa Posted May 7, 2007 Report Share Posted May 7, 2007 vacis, imho tev vajadzētu uzrakstīt kādu pluginu browserim, bet tā jau ir pārāk liela ķēpa. Link to comment Share on other sites More sharing options...
andrisp Posted May 7, 2007 Report Share Posted May 7, 2007 peehaa, un jeega kaada tam visam ? Link to comment Share on other sites More sharing options...
*jancis38* Posted May 7, 2007 Author Report Share Posted May 7, 2007 (edited) Taisi galveno failu index.php, kur iekļauj to menu failu, un tad ar manis doto vai tavu kodu iekļauj attiecīgo satura failu (atkarībā no $_GET['do']). es ierakstiju to kodu virs menu iekš index.php bet weblapa neveras vaļā, tipo webs uzskārās. :( Edited May 7, 2007 by *jancis38* Link to comment Share on other sites More sharing options...
andrisp Posted May 7, 2007 Report Share Posted May 7, 2007 Izlasi vēlreiz kārtīgāk, ko saku. Bet vispār ja nav ne mazākās nojausmas par PHP sintaksi, tad būs grūti. Link to comment Share on other sites More sharing options...
Recommended Posts