ziedinjsh
Reģistrētie lietotāji-
Posts
789 -
Joined
-
Last visited
Everything posted by ziedinjsh
-
googlē es skatījos, bet tur es atradu kodus ar array. dabuju ip adrešu sarakstu, bet nevaru izdomāt kā viņu dabūt iekš datubāzēs ( deny from 31.201.1.140 - 31.201.1.143 ) jo to visu pārakstīt būtu neprāts! Nē, nekādu porno čatu! :D
-
Sveiki! Kā varētu ar ip nobloķēt ip adreses kas nāk no konkrētas valstis??
-
p nominīju uz q un tāpat nekas nemainās!
-
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given if($_POST){ $q = $_POST['keytitle']; $sql_res = mysql_query("select articles.id, articles.title, articles2.id, articles2.title from articles, articles2 where title like '%$p%' order by id desc"); echo "<div class='search_box' align='left'>"; while($data = mysql_fetch_array($sql_res)){ $keytitle = $data['title']; if(strlen($keytitle) > 50) $keytitle = substr($keytitle, 0, 30).'...'; $title = "<b><a href='index.php?s=read&id=".$data['id']."'>» ".$keytitle."</a></b><hr style='border-color:#000'>"; echo $title; } echo "</div>"; } šitā neiet
-
ieliekot error_log(print_r($_FILES, true)); un veicot procesu parādās tukša lapa!
-
izveidojot parastu upload formu <form method='post' action='process/uploadphoto_process.php' enctype='multipart/form-data'> <input type='file' name='photo'> <input type='submit' name='addphoto' value='pievienot'> </form> $folder = "../photos/"; $aid = mysql_real_escape_string($_POST['aid']); $image = mysql_real_escape_string($_FILES['photo']['name']); $tmp = mysql_real_escape_string($_FILES['photo']['tmp_name']); $photo = basename($_FILES['photo']['name']); $uploading = $folder.basename($_FILES['photo']['name']); print_r($_FILES) Array ( [photo] => Array ( [name] => DSC07743.JPG [type] => image/jpeg [tmp_name] => D:\wamp\tmp\php1507.tmp [error] => 0 => 2081642 ) )
-
kapēc neaugšupielādē bildes!? jquery: $(function(){ var btnUpload=$('#upload'); var status=$('#status'); new AjaxUpload(btnUpload, { action: 'process/uploadphoto_process.php', name: 'photo', onSubmit: function(file, ext){ if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){ // extension is not allowed status.text('Only JPG, PNG or GIF files are allowed'); return false; } status.text('Uploading...'); }, onComplete: function(file, response){ //On completion clear the status status.text(''); //Add uploaded file to list if(response==="success"){ $('<li></li>').appendTo('#files').html('<img src="photos/'+file+'" alt="" /><br />'+file).addClass('success'); } else{ $('<li></li>').appendTo('#files').text(file).addClass('error'); } } }); }); html: <div id='upload'><span>Upload File<span></div><span id='status'></span> <ul id='files' ></ul> php: $folder = "../photos/"; $aid = mysql_real_escape_string($_POST['aid']); $image = mysql_real_escape_string($_FILES['photo']['name']); $tmp = mysql_real_escape_string($_FILES['photo']['tmp_name']); $photo = basename($_FILES['photo']['name']); $uploading = $folder.basename($_FILES['photo']['name']); if(move_uploaded_file($_FILES['photo']['tmp_name'], $uploading)){ $sql = mysql_query("insert into photos (aid, photo) values ('$aid', '$photo')") or die(mysql_error()); photo70("../photos/","../photos/small/",70); photo200("../photos/","../photos/medium/",200); photo500("../photos/","../photos/",500); echo "ir"; }else{ echo "nav"; } uzvēlotioes bildi man viņš viņu neaugšupielādē bet tikai parādā bildes nosaukumu sarkanā rāmī un viss..
-
Jap.. tas arī bija pie vainas.. nomainīju uz likes un viss strādā
-
Sveiki! Es īsti nesaprotu kapēc man nenostrādā update: $id = (isset($_GET['id'])) ? $_GET['id'] : ''; $data = mysql_fetch_array(mysql_query("SELECT * FROM articles WHERE id='$id'")) or die(mysql_error()); $addviews = mysql_query("UPDATE articles SET views=views+1 WHERE id='$id'"); $title = $data['title']; if(strlen($title) > 90) $title = substr($title, 0, 90).'...'; if(isset($_POST['like'])){ mysql_query("UPDATE articles SET like=like+1 WHERE id='$id'"); } echo " <div id='fullview' style='overflow:hidden;'> <div class='title'>".$title."</div> <div class='article'><div class='articlein'>".$data['article']."</div></div> <div class=''> <form method='post' action='".$_SERVER['PHP_SELF']."?s=read&id=".$id."'> <input type='submit' name='like' value='patīk ".$data['like']."'> </form> </div> </div> "; Šis strādā $addviews = mysql_query("UPDATE articles SET views=views+1 WHERE id='$id'"); bet otrais kas ir isset tas neapdeito! Kapēc tā? vai tad divi update nevar būt vienā lapā?
-
vienreiz nospiežot parāda klūdu - kāds no lauciņiem ir palicis tukšs un nospiežot atkārtoti tad parāda lietotājvāru ar kuru esmu ielogojies un kurš būs tas author ja tu to biji domājis šādi: $type = "simple"; $author = mysql_real_escape_string($_POST['author']); $mid = mysql_real_escape_string($_POST['mid']); $title = mysql_real_escape_string($_POST['title']); $intro = mysql_real_escape_string($_POST['intro']); $article = mysql_real_escape_string($_POST['article']); $date = date("d.m.Y"); $statuss = "ok"; if($author=="" || $mid==""){ $error = "<h3 style='color:#ff0000;font-size:20px;'>Kļūda! Ielogojies vai reģistrējies.</h3>"; $statuss = "error"; } if($title=="" || $intro=="" || $article==""){ $error = "<h3 style='color:#ff0000;font-size:20px;'>Kāds no lauciņiem ir palicis tukšs!</h3>"; $statuss = "error"; } if($statuss<>"ok"){ echo $error; }else{ die($author); mysql_query("INSERT INTO articles (type, author, mid, title, intro, article, date) VALUES ('$type', '$author', '$mid', '$title', '$intro', '$article', '$date')"); echo "<h3 style='color:green;font-style:20px;'>Paldies, raksts ir pievienots!</h3>"; echo "<meta http-equiv='refresh' content='2;url=index.php'>"; }
-
bet vai tad tā dēļ kods nestrādā?
-
Sveiki! Lieta tāda, nospiežot submit pogu izmet erroru un pasaka, ka kāds no lauciņiem ir tukš, nospiežot otro reizi vieņš ppievieno datus arī tad ja kāds no lauciņiem ir pa tiešām tukšs. if($cat=="simple"){ $data = mysql_fetch_array(mysql_query("SELECT * FROM members WHERE email='".$_SESSION['email']."' LIMIT 1")); echo " <div id='result'></div> <form method='post' action='process/addsimple_process.php' id='addsimple'> <input type='hidden' name='author' value='".$data['username']."'><input type='hidden' name='mid' value='".$data['id']."'> <p class='title'>Virsraksts</p> <p><input type='text' name='title' class='input' style='width:590px;'></p> <p class='title'>Ievads</p> <p><textarea name='intro' class='introi'></textarea></p> <p class='title'>Raksts</p> <p><textarea name='article' class='articlei'></textarea></p> <p><input type='submit' name='simple' value='Pievienot' class='button'></p> </form> "; } $type = "simple"; $author = mysql_real_escape_string($_POST['author']); $mid = mysql_real_escape_string($_POST['mid']); $title = mysql_real_escape_string($_POST['title']); $intro = mysql_real_escape_string($_POST['intro']); $article = mysql_real_escape_string($_POST['article']); $date = date("d.m.Y"); $statuss = "ok"; if($author=="" || $mid==""){ $error = "<h3 style='color:#ff0000;font-size:20px;'>Kļūda! Ielogojies vai reģistrējies.</h3>"; $statuss = "error"; } if($title=="" || $intro=="" || $article==""){ $error = "<h3 style='color:#ff0000;font-size:20px;'>Kāds no lauciņiem ir palicis tukšs!</h3>"; $statuss = "error"; } if($statuss<>"ok"){ echo $error; }else{ mysql_query("INSERT INTO articles (type, author, mid, title, intro, article, date) VALUES ('$type', '$author', '$mid', '$title', '$intro', '$article', '$date')"); echo "<h3 style='color:green;font-style:20px;'>Paldies, raksts ir pievienots!</h3>"; echo "<meta http-equiv='refresh' content='2;url=index.php'>"; } $(document).ready(function() { $('#addsimple').submit(function() { $.ajax({ type: "POST", url: $('#addsimple').attr('action'), data: $('#addsimple').serialize(), success: function(data) { $('#result').html(data); } }); return false; }); });
-
man vajag lai tas ir pieejams iekš texarea
-
Sveiki! Man tāds jautājums vai ir kāds vienkārš teksta editors kurā ir tikai: bold, italic, underline, algin left, center, algin right? Googlē skatījos, bet tie visi ir baigi bagātīgie, man tāds nav nepieciešams! Paldies jau iepriekš.
-
šinī jau nav problēma kapēc viņš neposto datus! Dati nemaz nenonāk līdz tam musican_process.php
-
es skatījos caur firebug, bet tur neko nevaru atrast kur būtu kļūda!
-
skatos, skatos, skatos, bet bļāviens nevaru ne ieraudzīt ne saprast kapēc nepostojas prom informācija.. ar var_dump(); ir array empty if($data['type']=='producer'){ if($musican=='addprofile'){ echo "<div class='pro'> <form method='post' action='process/musican_process.php' enctype='multipart/form-data' id='addmusican'> <h3>Producenta nosaukums</h3> <input type='text' name='musican' class='input'> <h3>Biogrāfija</h3> <textarea name='biografy' class='textarea' style='font-size:14px;'></textarea> <h3>Profila bilde</h3> <input type='file' name='cover' class='input'> <input type='hidden' name='user_id' value='".$data['user_id']."'> <input type='submit' name='addmusican' value='Izveidot profilu' class='button'> </form> </div> <div class='info'> <div id='result'></div> kaut kas šeit! </div>"; } }else{ header("Location: index.php"); } error_reporting(E_ALL); $folder = "../covers/"; $image = mysql_real_escape_string($_FILES['cover']['name']); $tmp = mysql_real_escape_string($_FILES['cover']['tmp_name']); $type = mysql_real_escape_string($_FILES['cover']['type']); $size = mysql_real_escape_string($_FILES['cover']['size']); $musican = mysql_real_escape_string($_POST['musican']); $biografy = mysql_real_escape_string($_POST['biografy']); $user_id = mysql_real_escape_string($_POST['user_id']); $iname = trim($musican); $cover = $iname."_".basename($_FILES['cover']['name']); $uploading = $folder.$iname."_".basename($_FILES['cover']['name']); $statuss = "ok"; if(empty($image) || empty($musican) || empty($biografy)){ $error = "<div class='i-error'>Kads no lauciniem ir tukš!</div>"; $statuss = "error"; } if(file_exists($data['cover'])){ unlink($folder."/".$data['cover']); } if($statuss<>"ok"){ echo $error; }else{ $sql = mysql_query("INSERT INTO musicans (musican, biografy, cover, user_id) VALUES ('$musican', '$biografy', '$cover', '$user_id')") or die(mysql_error()); if(move_uploaded_file($_FILES['cover']['tmp_name'], $uploading)){ createAvatar70("../covers/","../covers/small/",70); createAvatar200("../covers/","../covers/medium/",200); createAvatar400("../covers/","../covers/",400); echo "<div class='i-ok'>Profils ir izveidots!</div>"; } }
-
uzmurgoju kaut ko šādu, bet neesmu pārliecināts, ka viņš strādās! $lastseen = TIME($data['lastseen']); if (!isset($_SESSION['email'])) { $lastseen = time(); } if (time() - $lastseen > 1200) { header("location:process/logout_process.php"); } else { $lastseen = time(); }
-
lab.. it kā būtu.. datubāzē tabulā lastseen ieraksta date("Y-m-d H:i:s"); kā tagad pārbaudīt vai ir pagājušas 5 min un izmest ārā no lapas!?
-
kā lai atzīmē un dabo zināt kad veic kādu aktivitāti!?
-
Nav ne jausmas kā to uztaisīt!? kad izlogojās tad online statusu uzliek false, bet kad ielogojās uzliek true.. viss baigijauki, bet kad lietotājs pamet lapu bez izlogošanās.. pāši jau saprotat.. rāda kad ir online! Kā lai panākt ka ja lietotājs pamet lapu bez izlogošanās pēc 5 min noņem online statusu? meiģināju šādi, bet protams nekas nesanāca session_start(); $offline = time() - 300; mysql_query("UPDATE users SET online='false' WHERE lastseen<'$offline'") or die(mysql_error()); session_destroy(); šo biju ielicis iekš index.php bet kā refrešoju tā nodzēsa sessija.. tas būtu diezgan loģiski
-
upss.. laikam jāpārstāj uz kādu brīdi skatīties tai monitorā
-
<?php error_reporting(E_ALL); ini_set('display_errors', '1'); include("../misc/dbase.php"); $uid = mysql_real_escape_string($_POST['uid']); $author = mysql_real_escape_string($_POST['author']); $title = mysql_real_escape_string($_POST['title']); $link = mysql_real_escape_string($POST['link']); $date = date("d.m.y"); $statuss = "ok"; var_dump($_POST); if(empty($author) || empty($title) || empty($link)){ $error = "<div class='i-error'>Kads no lauciņiem ir palicis tukš!</div>"; $statuss = "error"; } if($statuss<>"ok"){ echo $error; }else{ mysql_query("INSERT INTO songs (uid, author, title, link, date) VALUES ('$uid', '$author', '$title', '$link', '$date')") or die(musql_error()); echo "<div class='i-ok'>Dziesma pievienota!</div>"; } ?>
-
array 'author' => string 'D7' (length=2) 'title' => string 'Human Source' (length=12) 'link' => string '<object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F19551233"></param>'>http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F19551233"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F19551233" type="application/x-shockwave-flash" width="100%"></embed> </object> <span><a href="http://soundcloud.com/gatisziedins/d7-human-source">D7 -'... (length=594) 'uid' => string '1' (length=1) 'addmusic' => string 'Pievienot dziesmu' (length=17)
-
ieliku, bet vienalga rāda vnk erroru Kāds no lauciņiem ir tukš!