Puika1 Posted April 12, 2009 Report Share Posted April 12, 2009 es izmantoju šo scriptu http://php.lv/f/index.php?showtopic=12618 kad es lieku ieksa php man vins nestrada kads var pateikt kas jādara lai vismaz stradatu šī funkcija <?php include("kautkas"); ?> Quote Link to comment Share on other sites More sharing options...
marcis Posted April 12, 2009 Report Share Posted April 12, 2009 Pilnu kodu parādi. Ja garš tad te. Quote Link to comment Share on other sites More sharing options...
Puika1 Posted April 12, 2009 Author Report Share Posted April 12, 2009 (edited) <a href="?id=1"><img src="kl.gif"/></a> <a href="?id=2"><img src="ts.gif"/></a> <a href="?id=2"><img src="ad.gif"/></a> <?php $id = isset($_GET["id"]) ? intval($_GET["id"]) : 1; if ($id == 1) { echo "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"; } else if ($id == 2) { echo "jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj"; } else if ($id == 3) { echo "teksts, kad 3"; } else { echo "ERROR, nepareizs id"; } ?> Edited April 12, 2009 by Puika1 Quote Link to comment Share on other sites More sharing options...
Val Posted April 12, 2009 Report Share Posted April 12, 2009 neredzu nekur include... laikam Lieldienas vainīgas. Quote Link to comment Share on other sites More sharing options...
Puika1 Posted April 12, 2009 Author Report Share Posted April 12, 2009 es gribu lai butu es jau tak teicu ja es tur lieku php man script vispar nedarbojas Quote Link to comment Share on other sites More sharing options...
Val Posted April 12, 2009 Report Share Posted April 12, 2009 Varbūt parādi kodu ar tavām izmaiņām? Quote Link to comment Share on other sites More sharing options...
Puika1 Posted April 12, 2009 Author Report Share Posted April 12, 2009 (edited) piemēram <a href="?id=1"><img src="kl.gif"/></a> <a href="?id=2"><img src="ts.gif"/></a> <a href="?id=2"><img src="ad.gif"/></a> <?php $id = isset($_GET["id"]) ? intval($_GET["id"]) : 1; if ($id == 1) { echo "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"; } else if ($id == 2) { echo "jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj"; } else if ($id == 3) { echo "<?php include("kautkas"); ?>"; } else { echo "ERROR, nepareizs id"; } ?> īstenība ko tur rādīt ja es teicu kad ielieku iekšā kko no php script vairs nestrādā piemēram šitas varians ko es tiko uzrakstiju ejot iekšā rāda eror Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\AppServ\www\cel.php on line 16 Edited April 12, 2009 by Puika1 Quote Link to comment Share on other sites More sharing options...
marcis Posted April 12, 2009 Report Share Posted April 12, 2009 Uzreiz šito vajadzēja :) Vispār tev vajadzētu pamācīties php pamatus. echo izvada, include iekļauj, <?php uzsāk php kodu. // ... }elseif($id==3){ include("kautkas"); } // ... Quote Link to comment Share on other sites More sharing options...
Puika1 Posted April 12, 2009 Author Report Share Posted April 12, 2009 (edited) kā es sapratu pēc tava teiktā izskatās tā <a href="?id=1"><img src="kl.gif"/></a> <a href="?id=2"><img src="ts.gif"/></a> <a href="?id=2"><img src="ad.gif"/></a> <?php $id = isset($_GET["id"]) ? intval($_GET["id"]) : 1; if ($id == 1) { "<?php include("kautkas"); ?>"; } }elseif($id==3){ include("kautkas"); { }elseif($id==3){ include("kautkas"); } else if ($id == 3) { }elseif($id==3){ include("kautkas");; } else { echo "ERROR, nepareizs id"; } ?> bet nestrādā Parse error: syntax error, unexpected T_STRING in C:\AppServ\www\cel.php on line 8 Edited April 12, 2009 by Puika1 Quote Link to comment Share on other sites More sharing options...
marcis Posted April 13, 2009 Report Share Posted April 13, 2009 on line 8 skaties 8. rindu un mēģini izdomāt, kas tur varētu būt nepareizi. Quote Link to comment Share on other sites More sharing options...
Puika1 Posted April 13, 2009 Author Report Share Posted April 13, 2009 (edited) beidzot man sanāca bet man rāda šitā kā var lai būtu apakšā scripts <a href="?id=1"><img src="kl.gif"/></a> <a href="?id=2"><img src="ts.gif"/></a> <a href="?id=3"><img src="ad.gif"/></a> <?php $id = isset($_GET["id"]) ? intval($_GET["id"]) : 1; if ($id == 1) { include("lapa/1.php"); } else if ($id == 2) { include("scr/serv.php"); } else if ($id == 3) { include("scr/xxx.php"); } else { echo "ERROR, nepareizs id"; } ?> Edited April 13, 2009 by Puika1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.