JAKuT Posted July 15, 2008 Report Share Posted July 15, 2008 Es gribetu uzzinat, kaa to dara?? sitaa lai izskatas, un atver normalu lapu http://domain.lv/index.php?go=shop man nav taa man irr sita http://domain.lv/shop.php bet gribu uztaisit, kaa mineju augstak. Palidziet luudzu Link to comment Share on other sites More sharing options...
overmind Posted July 15, 2008 Report Share Posted July 15, 2008 PHP <? $allow = array("news", "shop", "blabla",...); $file = "news.php"; if (isset( $_GET["p"])) if ( in_array($_GET["p"], $allow)) $file = $_GET["p"] . ".php"; require_once( $file); ?> Link to comment Share on other sites More sharing options...
X ID Posted July 15, 2008 Report Share Posted July 15, 2008 PHP <? if(!empty($_GET['go'])?&&?$_GET['go']=="shop"){ include( "shop.php"); } ?> Bet tas vairs nav stilīgi, tagad stilīgi ir izmantot mod_rewrite. P.S. Te jau nav bijis kāds topiks par šo tēmu? Link to comment Share on other sites More sharing options...
naziic Posted July 15, 2008 Report Share Posted July 15, 2008 Un kādēļ mūsdienās vairs neviens switch'u neizmanto? PHP <?php switch($_GET['kaka']) { case?'main':?echo?draw_main();break; case?'shop':?include("shop.php");break; default: ?echo?draw_main();break; } ?> ?kaka=shop Link to comment Share on other sites More sharing options...
JAKuT Posted July 15, 2008 Author Report Share Posted July 15, 2008 a kaa tas izskatitos tiesi index.php?? Pie sita.. <div id="menu"> <ul> <li><a id="selected" class="first" href="http://localhost/news.php">Новости</a></li> <li><a href="http://localhost/forum/index.php">Форум</a></li> <li><a href="http://localhost/files.php">Файлы</a></li> <li><a href="http://localhost/ban/">Баны</a></li> <li><a href="http://localhost/shop.php">SHOP</a></li> <li><a class="last" href="http://localhost/donate.php">Пожертвование</a></li> </ul> </div varetu apteikt?? Link to comment Share on other sites More sharing options...
overmind Posted July 15, 2008 Report Share Posted July 15, 2008 Nu kā, ja ņem manu variantu, tad aizstāj http://localhost/news.php ar http://localhost/?p=news Link to comment Share on other sites More sharing options...
naziic Posted July 15, 2008 Report Share Posted July 15, 2008 Tajā vietā, kur gribi, lai inklūdo tos failus liec arī to kodu. Link to comment Share on other sites More sharing options...
RaaapuLis Posted July 16, 2008 Report Share Posted July 16, 2008 naziic variants: PHP <?php switch($_GET['go']) { case?'shop':?include("shop.php");break; default: ?include(main.php);break; } ?> Adrese: http://localhost/index.php?go=shop Links: <a href="/index.php?go=shop">Veikals</a> Link to comment Share on other sites More sharing options...
JAKuT Posted July 16, 2008 Author Report Share Posted July 16, 2008 (edited) Kludu, izlaboju.. viss iet, tikaj tagad veel viena problema uzradas.. kaa lai es uztaisu index.php taa kad lai es uzrakstot http://domain.lv lai man strada, tie include tagad man izskatad index.php taa <?php switch($_GET['page']) { case 'news': include("news.php");break; default: include("index.php");break; } ?> <?php switch($_GET['page']) { case 'files': include("files.php");break; default: include("index.php");break; } ?> <?php switch($_GET['page']) { case 'shop': include("shop.php");break; default: include("index.php");break; } ?> bet es gribu, lai kad uzrakstot, http://domain.lv man atveras lapa, ar jaunumiem! taka te.. http://naken.lv/ ieejot, viss ir normali, un strada ari sis links, index.php?page=files Edited July 16, 2008 by JAKuT Link to comment Share on other sites More sharing options...
wap1337 Posted July 16, 2008 Report Share Posted July 16, 2008 kādā sakarā tev tik daudz to php? nevari visus keisus(case) vienā kodā sarakstīt? Inklūdo hēderi vnk! Link to comment Share on other sites More sharing options...
duplets Posted July 16, 2008 Report Share Posted July 16, 2008 (edited) Pievienoju arī komentārus, citādi tu, manuprāt, neko nesaprati, jo atkārto vnk kodu, ko tev iedeva! PHP <?php if(isset($_GET['page'])) // ja tiek padots get maniigais PAGE { switch( $_GET['page']) // tad swichojam { case 'news': include("news.php");break; // ja get page ir news tad ielaadeejam news.php case 'files': include("files.php");break; // ja get page ir files tad ielaadeejam files.php case 'shop': include("shop.php");break; // ja get page ir shop tad ielaadeejam shop.php default: include("index.php");break; // ja nav neviens no ieprieks mineetiem, //tad kaa defultu uzraadam index.php } } else { // ja netiek padots get page uzraadam indeksu include("index.php"); } ?> Edited July 16, 2008 by duplets Link to comment Share on other sites More sharing options...
JAKuT Posted July 16, 2008 Author Report Share Posted July 16, 2008 (edited) Paldies, viss sapratu. uztaisiju Tagad kads varetu atbildet Seit Edited July 16, 2008 by JAKuT Link to comment Share on other sites More sharing options...
JAKuT Posted July 16, 2008 Author Report Share Posted July 16, 2008 (edited) Es saskaros, ar jaunu problemu! viss, strada! uzliku index.php faila so kodu <?php if(isset($_GET['page'])) // ja tiek padots get maniigais PAGE { switch($_GET['page']) // tad swichojam { case 'news': include("news.php");break; // ja get page ir news tad ielaadeejam news.php case 'files': include("files.php");break; // ja get page ir files tad ielaadeejam files.php case 'shop': include("shop.php");break; // ja get page ir shop tad ielaadeejam shop.php case 'donate': include("donate.php");break; // ja get page ir shop tad ielaadeejam donate.php case 'donates': include("donates.php");break; // ja get page ir shop tad ielaadeejam donates.php case 'vipacc': include("vipacc.php");break; // ja get page ir shop tad ielaadeejam vipacc.php case 'mvipacc': include("mvipacc.php");break; // ja get page ir shop tad ielaadeejam mvipacc.php default: include("news.php");break; // ja nav neviens no ieprieks mineetiem, //tad kaa defultu uzraadam news.php } } else { // ja netiek padots get page uzraadam indeksu include("news.php"); } ?> bet kad vins rakstot http://localhost parmet normali uz majas lapu, bet krievu valodas vieta visur ir Cetrsturisi! un kad uzrakstu http://localhost/news.php tad rada viis noramli, krieviski. ko lai izdaru? charset=windows-1251 un pat caur Internet Explorer, spiezot Encoding-> stav UTF-8 gribu uzlikt Kirilica(windows) neliekas... ko lai dara?? Edited July 16, 2008 by JAKuT Link to comment Share on other sites More sharing options...
X ID Posted July 16, 2008 Report Share Posted July 16, 2008 Parādi, kur tev stāv uzlikt tas windows-1251 Link to comment Share on other sites More sharing options...
JAKuT Posted July 16, 2008 Author Report Share Posted July 16, 2008 (edited) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Impulsive.lv :: Š?Š?Š?Š??Ā Edited July 17, 2008 by JAKuT Link to comment Share on other sites More sharing options...
JAKuT Posted July 17, 2008 Author Report Share Posted July 17, 2008 (edited) Nu kads palidzes??? atkartosu jautajumu, pa jaunam. Kapec, man neiet CHARSET? kad parliku, paskodetu majaslapu.. pirms tam ari bija paskodeta, viss gaja, tagad uztaisiju galigi citu, ar citu .css failu Vairs, neiet ... Krieviski nerada, cetrsturisi stav. Mysql character set - cp1251 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Impulsive.lv :: Новости</title> <meta http-equiv="content-type" content="text/html; charset=windows-1251" /> <meta name="description" content="Counter Strike 1.6 Impulsive.lv" /> <meta name="keywords" content="cs,counter strike,counter strike server rent, cw" /> <meta name="author" content="Impulsive.lv / Design by: JaKuT" /> <link rel="shortcut icon" href="img/favicon.ico" /> <link rel="stylesheet" href="css/style.css" type="text/css" /> </head> <body> un kad caur sito iet <?php if(isset($_GET['page'])) // ja tiek padots get maniigais PAGE { switch($_GET['page']) // tad swichojam { case 'news': include("news.php");break; // ja get page ir news tad ielaadeejam news.php case 'files': include("files.php");break; // ja get page ir files tad ielaadeejam files.php case 'shop': include("shop.php");break; // ja get page ir shop tad ielaadeejam shop.php case 'donate': include("donate.php");break; // ja get page ir shop tad ielaadeejam donate.php case 'donates': include("donates.php");break; // ja get page ir shop tad ielaadeejam donates.php case 'vipacc': include("vipacc.php");break; // ja get page ir shop tad ielaadeejam vipacc.php case 'mvipacc': include("mvipacc.php");break; // ja get page ir shop tad ielaadeejam mvipacc.php default: include("news.php");break; // ja nav neviens no ieprieks mineetiem, //tad kaa defultu uzraadam news.php } } else { // ja netiek padots get page uzraadam indeksu include("news.php"); } ?> tad vsp, neka nerada.. visur ir cetrsturisi, pat uz Menu Button! Edited July 17, 2008 by JAKuT Link to comment Share on other sites More sharing options...
X ID Posted July 17, 2008 Report Share Posted July 17, 2008 No kurienes nāk teksti? MySQL? Fails? Ja sarakstīti ar roku failā, tad faila enkodingam jābūt ANSI, ja nāk no MySQL tad izskatās, ka atšķirās čarsets ievades lapai un izvades lapai. Link to comment Share on other sites More sharing options...
GOMA smile Posted July 17, 2008 Report Share Posted July 17, 2008 <a href='?page=files'><font face="Verdana" size="2"> files</font></a><br /><br> <a href='?page=donate'><font face="Verdana" size="2"> donate</font></a><br /><br> Link to comment Share on other sites More sharing options...
X ID Posted July 17, 2008 Report Share Posted July 17, 2008 <a href='?page=donate'><font face="Verdana" size="2"> donate</font></a><br /><br> Tu esi stulbs vai izliecies? Te jau sen runa iet par citām lietām. Link to comment Share on other sites More sharing options...
JAKuT Posted July 17, 2008 Author Report Share Posted July 17, 2008 Es atradu, problemu.. Sitaja rindina bija kluda.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xml:lang="RU" lang="RU" xmlns="http://www.w3.org/1999/xhtml"> RU vieta bija EN un tapec radija keburus.. es tik ne saprotu kapec.. Link to comment Share on other sites More sharing options...
KpC Posted August 9, 2008 Report Share Posted August 9, 2008 un kur man jaraksta : <? $allow = array("news", "shop", "blabla",...); $file = "news.php"; if (isset($_GET["p"])) if (in_array($_GET["p"], $allow)) $file = $_GET["p"] . ".php"; require_once( $file); ?> Visus index.php vai ari katra faila ? Link to comment Share on other sites More sharing options...
RaaapuLis Posted August 9, 2008 Report Share Posted August 9, 2008 beidz postot, vecos topikos, un jā, katrā failā to liec, vai vnk uztaisi page.php failu ar to saturu ko tu uzrakstiji postā, un katrā failā peivieno PHP <?php include('page.php'); ?> Link to comment Share on other sites More sharing options...
X ID Posted August 9, 2008 Report Share Posted August 9, 2008 Es atkal domāju, ka ja tēma ir uzsākta, tad nav jēgas taisīt jaunus topikus. Un nē, inklūds jāliek tikai index.php vai arī tu katrā failā vēlreiz inklūdosi to pašu failus un aizies bezgalīgais cikls. Link to comment Share on other sites More sharing options...
JAKuT Posted August 9, 2008 Author Report Share Posted August 9, 2008 nav vieglak tak es izdariju?? uztaisa, index.php un tur to kodu iebaz.. un uztaisa header uz news.php ... un viss nekur nekaa daudz nav jaraksta P.S paldies, ieprieks jums, kas man palidzeja saprast Link to comment Share on other sites More sharing options...
RaaapuLis Posted August 9, 2008 Report Share Posted August 9, 2008 nu ja tu to visu zini, kāpēc prasi? dari kā māki tad, un lieto googli, ja šaubies. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now