IM24LV Posted September 30, 2006 Author Report Share Posted September 30, 2006 (edited) un kur man tas buutu vispaar jaaliek? reku galvenais kods: <?php error_reporting (E_ALL ^ E_NOTICE); if (!$sadala) { $sadala = $HTTP_GET_VARS['sadala']; } if ($sadala == "") { exit("Izvēlies sadaļu!"); } if (!$darbiba) { $darbiba = $HTTP_GET_VARS['darbiba']; } if ($darbiba == "komentars") { $datums = date("d M Y h:i a"); $array = "komentari/"; $niks = htmlspecialchars($_POST["niks"]); $teksts = htmlspecialchars($_POST["teksts"]); $teksts = str_replace("\n","<br />",$teksts); $teksts = stripslashes($teksts); $fails = fopen("komentari/$sadala.txt", "a"); if (!$fails) { print("Kļūda!"); exit; } fputs ($fails,implode,("\n")); fwrite($fails,"$niks|$teksts|$datums\n"); fclose($fails); } ?> Edited September 30, 2006 by IM24LV Link to comment Share on other sites More sharing options...
Stopp Posted September 30, 2006 Report Share Posted September 30, 2006 (edited) tagad paskaties uz to kodu un padomā, kuras rindiņas tad ieraksta tekstu failā un kuras dara kaut ko citu. bet vispār var iztikt bez tā file_exists. nomaini a uz w pie fopen. nevar vis, piedod. Edited September 30, 2006 by Stopp Link to comment Share on other sites More sharing options...
IM24LV Posted September 30, 2006 Author Report Share Posted September 30, 2006 es jau meegjinaaju taa: if(file_exists('komenti/'.intval($_GET['id']))) { fwrite($fails,"$niks|$teksts|$datums\n"); } Link to comment Share on other sites More sharing options...
Stopp Posted September 30, 2006 Report Share Posted September 30, 2006 un, nesanāca ? Link to comment Share on other sites More sharing options...
IM24LV Posted September 30, 2006 Author Report Share Posted September 30, 2006 nee, shaadi iztaisiiju pilniibaa: <?php error_reporting (E_ALL ^ E_NOTICE); if (!$sadala) { $sadala = $HTTP_GET_VARS['sadala']; } if ($sadala == "") { exit("Izvēlies sadaļu!"); } if (!$darbiba) { $darbiba = $HTTP_GET_VARS['darbiba']; } if ($darbiba == "komentars") { $datums = date("d M Y h:i a"); $array = "komentari/"; $niks = htmlspecialchars($_POST["niks"]); $teksts = htmlspecialchars($_POST["teksts"]); $teksts = str_replace("\n","<br />",$teksts); $teksts = stripslashes($teksts); $fails = fopen("komentari/$sadala.txt", "a"); if (!$fails) { print("Kļūda! Nesanāk..."); exit; } fputs ($fails,implode,("\n")); if(file_exists('komenti/'.intval($sadala))) { fwrite($fails,"$niks|$teksts|$datums\n"); } fclose($fails); } ?> un kad spiedu uz pievinot nekas nenotika Link to comment Share on other sites More sharing options...
Stopp Posted September 30, 2006 Report Share Posted September 30, 2006 1) kam bija jānotiek? 2) fputs ($fails,implode,("\n")); kas notiek šai rindiņā ? Link to comment Share on other sites More sharing options...
IM24LV Posted September 30, 2006 Author Report Share Posted September 30, 2006 nu php tak vajaga es phpnet lasiiju ka tas vajadziigs. p[ameeegjinaaju izdzeest it kaa straadaa arii bez fputs :D nu nez kam bija jaanotiek? bija jaapievienopjas komentaaram un jaaparaadaas Link to comment Share on other sites More sharing options...
Gu6ax Posted September 30, 2006 Report Share Posted September 30, 2006 Baac veciit piedot ... Bet nu tu lajkam nebiji maajaas kad maate gudriibu dalija! KAd es maacijos php es centos to visu saprast pac nevis iet un kautkam jautaat davaj uzraxti man sito es tev pateixu paldies! un vispaar sits te jautaajumstavs ir aprunaats PhP soli pa solim laba graamata prieksh iesaaceejiem! :) Link to comment Share on other sites More sharing options...
IM24LV Posted September 30, 2006 Author Report Share Posted September 30, 2006 (edited) man nav taada gramata Edited September 30, 2006 by IM24LV Link to comment Share on other sites More sharing options...
Klez Posted September 30, 2006 Report Share Posted September 30, 2006 ieksh php.net ir laba graamata :) Link to comment Share on other sites More sharing options...
IM24LV Posted September 30, 2006 Author Report Share Posted September 30, 2006 (edited) dabuuju to graamatu php soli pa solim, bet kkas nava riktiigi. kaapeec kaut vai piemeeram shis kods nestraadaa?: <html> <head><title> Funkcijas isset() pārbaude</title></head> <body> <? if (isset($submit)){ if(empty($vards)){ print ("Tu neesi ierakstījis savu vārdu!\n"); } else{ print ("$vards, Tu nospiedi formas apstiprināšanas pogu.\n"); } } else{ print ("<form action=\"isset_func.php\" method=\"post\">\n"); print ("Ievadi savu vārdu:<br><input type=\"text\" name=\"vards\"><br>\n"); print ("<input type=\/"submit\" name=\"submit\" value=\"apstiprināt\">\n"); print ("</form>"); } ?> </body> </Html> taads bija dots graamataa kaa paraugs aa sapratu tur nezkaapeec ir <? nevis <?php :D Edited September 30, 2006 by IM24LV Link to comment Share on other sites More sharing options...
Stopp Posted September 30, 2006 Report Share Posted September 30, 2006 nuu, neesmu lasījis to grāmatu, bet, ja cilvēks zin php.lv forumus un lasa PHP soli pa solim, tad forums ir pilns ar jautājumiem, kāpēc tas un tas nestrādā. imo ieliec to grāmatu kamīnāun pielaid uguni. Link to comment Share on other sites More sharing options...
IM24LV Posted September 30, 2006 Author Report Share Posted September 30, 2006 psc, diezgan diivaini, bet jau 3 kods kuru es esmu ievadiijis bet nestraadaa... vai tieshaam pa 5 gadiem visi kodi ir palikushi taadi ka graamataa viss ir nepareizs? :( Link to comment Share on other sites More sharing options...
Delfins Posted September 30, 2006 Report Share Posted September 30, 2006 Kods nav jāievada no grāmatas. Ir pašam jāsaprot - ko, kā un kāpēc jāraksta. Link to comment Share on other sites More sharing options...
IM24LV Posted September 30, 2006 Author Report Share Posted September 30, 2006 a kaa saprast ja tas kods ir nepareizs? :( Link to comment Share on other sites More sharing options...
Recommended Posts