KryPt0 Posted September 6, 2005 Report Share Posted September 6, 2005 Jaa man vajag lai es savaa lapaa varu sortot piem peec reiting u.t.t Bet... nu to visu es maaku viss ir ok un iet, bet man parcik ir tas chalars ar tabulaam(ar ifreimiem man baigi chakareejaas i-explorers un citi never ifreimus valjaa(dazhi)) taadeelj man ir uztaisiita tabula un iekshaa tajkaa ir shaads kods: <?php if ($go=='news') { include("news.php"); } elseif ($go=='rules') { include("rules.php"); } elseif ($go=='snews') { include("serv_news.php"); } elseif ($go=='sinfo') { include("full_info.php"); } elseif ($go=='register') { include("sign_up.php"); } elseif ($go=='registerdone') { include("register_done.php"); } elseif ($go=='pw') { include("change_password.php"); } elseif ($go=='stats') { include("stat_adder.php"); } elseif ($go=='statsdone') { include("statupgradedone.php"); } elseif ($go=='lostpw') { include("getpwd.php"); } elseif ($go=='pk') { include("clear_pk.php"); } elseif ($go=='top15') { include("top15.php"); } elseif ($go=='guilds') { include("guilds15.php"); } elseif ($go=='ds') { include("ds.php"); } elseif ($go=='online') { include("online.php"); } elseif ($go=='client') { include("client.php"); } elseif ($go=='patch') { include("patch.php"); } else { include("home.php"); } ?> nu re! kaa uzspiezhu uz linka manaa tabulaa atveraas lapa taada un taada jo links iet uz: index.php?go=news(pimeers) nu vot, bet ar statistiku kura ir top15, ja es iekshaa uzspiezhu lai SORTO peec Leveļa tad vinjsh visu pazaudee un neparaada man visu kam ir jaabuut(t.i. neparaada man manus navigationus u.t.t) tikai top15.php bez nekaa apkaart vienkaarshaak sakot neraada tajaa tabulaa kuraa ir visi go=='blah'... links kursh izmaina sorting kartibu ir: top15.php?requested=<sheit atrodas pec ka requesto bez "<>"> liidz ar to tas no kaa es pa jaunam sortoju atveras pavisam varteikt jaunaa lapaa un apkaart nekaa nav tikai pats top15 =[ man vajag lai atveras manaa tabulaa un ja es taisu: elseif ($go=='top15?requested=level' { include top15.php?requested=level } tad nekaa neiet vispaar... ja saprataat ko es gribu panaakt varat paliidzeet ? iisaak sakot: Man vajag kad es savaa tabulaa kuraa atrodas top15 uzspiezhu uz vaarda Experience(tas sortos peec experience daudzuma) tad sorto peec experiences un atver tajaa pashaa tabulaa... un varbuut... ... ir iespeejams kaa ar iframe kad iedod tabulai "name" un linkaa raxta target="table name" ? vai ar id ? nu vai kkaa taa =] Ceru ka saprataat =]] Link to comment Share on other sites More sharing options...
Delfins Posted September 6, 2005 Report Share Posted September 6, 2005 pārāk gari... imo. pat slinkums lasīt! :huh: Link to comment Share on other sites More sharing options...
Roze Posted September 6, 2005 Report Share Posted September 6, 2005 Man līdzīgi kā Delfīnam zuda sasaite ar tekstu bet ja sapratu tad visa problēma ir tikai tajā ka tu nezini ka mainīgos var padot vairākus atdalot ar & Un precīzi kļuda ir te: elseif ($go=='top15?requested=level' { include top15.php?requested=level } kas ir nepareizi. atstaaj tāpat elseif ($go=='top15') { include("top15.php"); } JO ja tu vērsi savu index.php?go=top15&requsted=level tad jau automātiski includesies tavs top15.php un tam jau ar buus padots $_GET['requested'] (jeb $requested) mainīgais. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted September 6, 2005 Report Share Posted September 6, 2005 (edited) Man līdzīgi kā Delfīnam zuda sasaite ar tekstu bet ja sapratu tad visa problēma ir tikai tajā ka tu nezini ka mainīgos var padot vairākus atdalot ar & /SKIPOTS/ atstaaj tāpat elseif ($go=='top15') { include("top15.php"); } JO ja tu vērsi savu index.php?go=top15&requsted=level tad jau automātiski includesies tavs top15.php un tam jau ar buus padots $_GET['requested'] (jeb $requested) mainīgais. 21944[/snapback] to Roze: mjaa pasteidzies :) to KryPt0: tieshi taa ja izmanto vienu failu (index.php) tad atceries ka var padot n mainiigos un visus izmantot :) arii incluudojamais fails izmantos TOS PASHUS mainigos..... Fiziski includojamais fails kljuust par koda dalju - PHP sakumaa visu sakombinee, peec tam parbauda sintaksi un TIKAI TAD izpilda :) Edited September 6, 2005 by Grey_Wolf Link to comment Share on other sites More sharing options...
KryPt0 Posted September 6, 2005 Author Report Share Posted September 6, 2005 =[ nesanaak man sataisiit... ja likeu ? vietaa & tad paraada ka page cannot be found =[ Link to comment Share on other sites More sharing options...
Kavacky Posted September 6, 2005 Report Share Posted September 6, 2005 Protams, lapa "lapa.php&" neeksistē, eksistē "lapa.php". Link to comment Share on other sites More sharing options...
KryPt0 Posted September 6, 2005 Author Report Share Posted September 6, 2005 aaa nee viss OK tagat sanaaca kaut ko tur ierakstiju klaat un aizgaaja paldies jums visiem... Kaa es miilu php.lv/f/ =] Link to comment Share on other sites More sharing options...
Delfins Posted September 6, 2005 Report Share Posted September 6, 2005 (edited) index.php?go=top15&requested=level index.php <?php $sections = Array( 'home', 'top15', 'news' ); $go = $_GET['go']; if ( in_array($go,$sections) ) { include $go.'.php'; } ?> top15.php <?php $requested = trim( $_GET['requested'] ); if ($requested=='level') { // do something } ?> Edited September 6, 2005 by Delfins Link to comment Share on other sites More sharing options...
Kaklz Posted September 7, 2005 Report Share Posted September 7, 2005 index.php?go=top15&requested=level index.php <?php $sections = Array( 'home', 'top15', 'news' ); $go = $_GET['go']; if ( in_array($go,$sections) ) { include $go.'.php'; } ?> 21952[/snapback] Viņam tur ir kaudze ar $go mainīgajiem, kam vērtība nesakrīt ar faila nosaukumu .. <?php $sections = array('news' => 'news.php', 'rules' => 'rules.php', 'snews' => 'serv_news.php', 'sinfo' => 'full_info.php', 'register' => 'sign_up.php', 'registerdone' => 'register_done.php', // ... ); $go = $_GET['go']; if (isset($sections[$go])){ include $go; } ?> Link to comment Share on other sites More sharing options...
KryPt0 Posted September 7, 2005 Author Report Share Posted September 7, 2005 es taksh teicu ka es sataisiju =-] Link to comment Share on other sites More sharing options...
Analgiins Posted September 7, 2005 Report Share Posted September 7, 2005 mosh to n-tos if-us nomaini pret switch konstrukciju - buus saprotamaak Link to comment Share on other sites More sharing options...
Delfins Posted September 7, 2005 Report Share Posted September 7, 2005 mosh to n-tos if-us nomaini pret switch konstrukciju - buus saprotamaak 21959[/snapback] nafig switch, ja ir masīvi... Link to comment Share on other sites More sharing options...
Analgiins Posted September 7, 2005 Report Share Posted September 7, 2005 nu ja cilveeks raksta <?php if ($go=='news') { include("news.php"); } elseif ($go=='rules') { include("rules.php"); } elseif ($go=='snews') { include("serv_news.php"); } elseif ($go=='sinfo') { include("full_info.php"); } elseif ($go=='register') { include("sign_up.php"); } elseif ($go=='registerdone') { include("register_done.php"); } elseif ($go=='pw') { include("change_password.php"); } elseif ($go=='stats') { include("stat_adder.php"); } elseif ($go=='statsdone') { include("statupgradedone.php"); } elseif ($go=='lostpw') { include("getpwd.php"); } elseif ($go=='pk') { include("clear_pk.php"); } elseif ($go=='top15') { include("top15.php"); } elseif ($go=='guilds') { include("guilds15.php"); } elseif ($go=='ds') { include("ds.php"); } elseif ($go=='online') { include("online.php"); } elseif ($go=='client') { include("client.php"); } elseif ($go=='patch') { include("patch.php"); } else { include("home.php"); } ?> nav labaak switchu lietoto... ? Link to comment Share on other sites More sharing options...
Delfins Posted September 7, 2005 Report Share Posted September 7, 2005 Nav labāk/ērtāk masīvus lietot? Link to comment Share on other sites More sharing options...
Analgiins Posted September 7, 2005 Report Share Posted September 7, 2005 nu kaa kuram labaak patiik, taa vinjsh arii taisa Link to comment Share on other sites More sharing options...
Recommended Posts