tiy Posted March 16, 2006 Report Share Posted March 16, 2006 Pastastiet ka pareizi jataisa vieus gramata, lai to varetu uzrakstit uz vienas lapas (viss source). Vai ari ka var titk vala na POSTDATA errora, piem kaut ko uzraksta viesu gramata aizsuta viss ierakstat, tad spiez refresh vai back paradas tas error, un spiez ok un atkal ta pati informacija ierakstas ! Link to comment Share on other sites More sharing options...
Gacha Posted March 16, 2006 Report Share Posted March 16, 2006 1. saņem informāciju. 2. apstrādā, saglabā 3. ja viss ok, tad: header('Location: lapa.php'); exit(); Link to comment Share on other sites More sharing options...
tiy Posted March 16, 2006 Author Report Share Posted March 16, 2006 (edited) <?php if(isset($_POST['Submit'])) { if(strlen($_POST['msg']) > 301) die('Ej kakaat spamer!'); $path="guest.txt"; $name =$_POST['name']; $msg = $_POST['msg']; if ($msg !="" && $name !="") { $record=$name."***".$msg."\n"; $fp=fopen($path,"a+"); $fw=fwrite($fp,$record); fclose($fp); header("Location: gbook.php"); exit(); } else { echo "<font color=\"red\">Please fill all boxes!</font>"; } } ?> Rekur source. !!! Rodas cita laza, tad ja uz pogas subit ar ierakstittiem laukiem paspej lidz refresham nospiest 10 reizes, tad ari 10x ierakstisies ieraksts faila . Ka no ta titk vala!!! Man liekas ka tas gluks ir, tad ja tieshi izmanto Location f-ju. Edited March 16, 2006 by tiy Link to comment Share on other sites More sharing options...
john.brown Posted March 16, 2006 Report Share Posted March 16, 2006 (edited) if(isset($_SESSION['form_submited'])) { echo 'Ej kakaat aatrais spiedeeej'; exit; } else { $_SESSION['form_submited'] = 1; } Edited March 16, 2006 by john.brown Link to comment Share on other sites More sharing options...
andrisp Posted March 17, 2006 Report Share Posted March 17, 2006 (edited) Var jau arī vēl pēc nospiešanas Submit pogu nodiseiblot. Tipa tā kā draugiem.lv. Kad nospiež Submit, tad caur javascript piebāž klāt viņai disabled=true; Un vēl nosaukumu var nomainīt uz 'Uzgaidiet...' vai kaut kā tā. Tā, protams, vairāk būs aizsardzība pret lietotāju stulbumu, nevis cilvēkiem, kas mēģinās sačakarēt tavu guestbuku. Edited March 17, 2006 by andrisp Link to comment Share on other sites More sharing options...
Recommended Posts