Uldeens Posted November 10, 2003 Report Share Posted November 10, 2003 Forma: <form action="text.php" method="post"> <b>e-pasts:</b><input type="text" name="epasts"><br> <br> <b>Segvards:</b><input type="text" name="segvards"><br> <br> <input type="textfield" name="teksts"><br> <br> <input type="submit" value="Nosutit"> </form> Skripts: <? php $file="fails.txt"; $file= fopen("fails.txt","w+"); //Fails kuraa rakstiis datus fwrite($file, "$teksts"); //Teksts ko ieraksta fclose($file); //Aizver failu ?> Link to comment Share on other sites More sharing options...
jonass Posted November 10, 2003 Report Share Posted November 10, 2003 nu iespeejams tev jaalieto $_POST[teksts], jo serverim globaalie offZ. ieteiktu rakstiit shitaa : <code><font color="#000000"> <font color="#0000CC"><? $dati </font><font color="#006600">= </font><font color="#CC0000">'epasts:' </font><font color="#006600">. (</font><font color="#0000CC">$_POST</font><font color="#006600">[</font><font color="#0000CC">epasts</font><font color="#006600">]) . </font><font color="#CC0000">'segvards:' </font><font color="#006600">. (</font><font color="#0000CC">$_POST</font><font color="#006600">[</font><font color="#0000CC">segvards</font><font color="#006600">]) . </font><font color="#CC0000">'teksts:' </font><font color="#006600">. (</font><font color="#0000CC">$_POST</font><font color="#006600">[</font><font color="#0000CC">teksts</font><font color="#006600">]) </font><font color="#CC0000">'<br />'</font><font color="#006600">; </font><font color="#0000CC">$file</font><font color="#006600">= </font><font color="#0000CC">[url=http://lv.php.net/fopen]fopen[/url]</font><font color="#006600">(</font><font color="#CC0000">"fails.txt"</font><font color="#006600">,</font><font color="#CC0000">"w+"</font><font color="#006600">); </font><font color="#FF9900">//Fails kuraa rakstiis datus </font><font color="#0000CC">[url=http://lv.php.net/fwrite]fwrite[/url]</font><font color="#006600">(</font><font color="#0000CC">$file</font><font color="#006600">, </font><font color="#0000CC">$dati</font><font color="#006600">); </font><font color="#FF9900">//Teksts ko ieraksta </font><font color="#0000CC">[url=http://lv.php.net/fclose]fclose[/url]</font><font color="#006600">(</font><font color="#0000CC">$file</font><font color="#006600">); </font><font color="#FF9900">//Aizver failu </font><font color="#0000CC">?> </font> </font> </code> Link to comment Share on other sites More sharing options...
Uldeens Posted November 11, 2003 Author Report Share Posted November 11, 2003 Nee Jonass man tie globaalie on.. Bet vins man visulaiku arii manaa variantaa met araa kluudu :Parse error: parse error in c:program fileseasyphpwwwtext.php on line 5 kautkas ar to fwrite.. Link to comment Share on other sites More sharing options...
Aleksejs Posted November 11, 2003 Report Share Posted November 11, 2003 Varbūt: <code><font color="#000000"> fwrite($file, "$teksts"); //Teksts ko ieraksta </font> </code> vietaa jaaraksta <code><font color="#000000"> fwrite($file, $teksts); //Teksts ko ieraksta </font> </code> Link to comment Share on other sites More sharing options...
jonass Posted November 11, 2003 Report Share Posted November 11, 2003 tas arī vēl - nekad neliec mainiigo peedinjaas, ja gribi dabuut taa veertiibu, savaadaak vinjsh to mainiigo par stringu notur. Link to comment Share on other sites More sharing options...
DelNet Posted November 11, 2003 Report Share Posted November 11, 2003 Nu manuprat kljuda ir citur... tavs kods: $file="fails.txt"; $file= fopen("fails.txt","w+"); //Fails kuraa rakstiis datus fwrite($file, "$teksts"); //Teksts ko ieraksta fclose($file); //Aizver failu ?> mans kods: $file="fails.txt"; $open=fopen("$file", "w+"); fputs ($open, "$texts"); fclose ($open) or die("kaut kas ir garaam!"); Vismaz man rukaaa... Link to comment Share on other sites More sharing options...
Uldeens Posted November 11, 2003 Author Report Share Posted November 11, 2003 Paldies DelNet tiesaam aizgaaja.Tur parasti ir probleema ka kads ierauga ka nav kautkur komata vai HVZ un raksta kaapeec neiet,Paldies kad uzrakstiiji paarbaudiitu lietu. ;) Link to comment Share on other sites More sharing options...
Uldeens Posted November 11, 2003 Author Report Share Posted November 11, 2003 Protams lielaakaa probleema esu es pats :) Link to comment Share on other sites More sharing options...
fassko Posted November 11, 2003 Report Share Posted November 11, 2003 vislabaak ir atrast kljuudas passam nevis skriet uzreiz un prasiit, jo kad taas atrod pac taas atceraas un nekad vairs nepielaizh, vismaz man taa ir ;) Link to comment Share on other sites More sharing options...
Robis Posted November 11, 2003 Report Share Posted November 11, 2003 Nezinu, kas tev tas par html, bet manupraat input type="textfield ir aplams! Kas tas par textfield? Vai ta nav jaalieto textarea? nez... Html helpaa arii taads textfield nav piemineets. Link to comment Share on other sites More sharing options...
DelNet Posted November 11, 2003 Report Share Posted November 11, 2003 Palidzeet ivener laipni!!! Es patiesibaa esmu tuvaka ticis php jomaa nekaa Tu uldeen. Vismaz es ta domaaju, jo neko par db nezinu :) php no manualjiem lasijies, gribejaas jau kadu kaut via to pashu php soli pa solim palasiit, bet nav iespeju.... nu neko dariit dzivojam kaa varam... vispaar peec dabad esmu arii slinks... bet logjiskaa domashana man ir augsta kvalitatee, fizikas formulas nezinu nevienu - nekad nemsu tas macijies, bet kad ir kontroldarbs, tad visu logiski izdomajot tiekma pie iznakuma...formulu nezinaam iznakumu gan :) Piekritu fassko, ja pats atklaj kljuud tad ir labaak un veidojas kaut kaads lielaks experience... Link to comment Share on other sites More sharing options...
Uldeens Posted November 12, 2003 Author Report Share Posted November 12, 2003 A kaapeec nav iespeju lassit PHP SOLI pa SOLIM? Robi pareizi man jau arii orginaalaa staav texarea vienkaarsi forumaa no galvas to piemeeru rakstiiju. Manliekas graamataa lasiiju ka DB vienaa shuunaa var buut tikai 255 simboli :blink: . taa ir taisniiba??? Tad jau sanaak ja postee garaakus tekstus tad tie jaaliek texta failaa(kas savukaart ir porno no mana viedokla jo db man vismaz irakstiit un nolasiit izdevaas). Link to comment Share on other sites More sharing options...
Aleksejs Posted November 12, 2003 Report Share Posted November 12, 2003 Manliekas graamataa lasiiju ka DB vienaa shuunaa var buut tikai 255 simboli . taa ir taisniiba??? Taa ir taisniiba CHAR un VARCHAR laukiem, bet nav taisniiba TEXT laukiem Link to comment Share on other sites More sharing options...
DelNet Posted November 12, 2003 Report Share Posted November 12, 2003 php soli pa solim tagad pirkt negribas, naudish taa kaa pamaz..., bibliotekaa ivnjsh nav... un nevienu nepazistu ka butu... tAa luuk bet pagiadam var jau izlidzeeties ar manuaaljiem... Link to comment Share on other sites More sharing options...
Little_Hacker Posted November 12, 2003 Report Share Posted November 12, 2003 tas arī vēl - nekad neliec mainiigo peedinjaas, ja gribi dabuut taa veertiibu, savaadaak vinjsh to mainiigo par stringu notur. Nu itkaa jau taa ir, bet ieksh fwrite tomeer taa nav :) Link to comment Share on other sites More sharing options...
Recommended Posts