Jump to content
php.lv forumi

ziedinjsh

Reģistrētie lietotāji
  • Posts

    789
  • Joined

  • Last visited

Everything posted by ziedinjsh

  1. Sveiki! Man radās problēma! Es taisu menu sadaļu ar ul li. ul li atrodas iekš div kuram ir text-align:right; kad taisu li float:right tad man menu saraksts air tajā labajā malā, bet tikai saraksts ir otrādi. html <div id="headline"> <div class="logo"><img src="misc/img/logo.png"></div> <div class="menu"> <ul> <li>Home</li> <li>Find People</li> <li>Online Profile</li> <li>About</li> </ul> </div> </div> CSS #headline{ width:100%; height:40px; background-color:#89AFC5; border-left:0px solid #3D637A; border-top:1px solid #3D637A; border-right:0px solid #3D637A; border-bottom:1px solid #3D637A; } #headline .logo{ width:210px; height:40px; margin-left:190px; float:left; } #headline .menu{ width:670px; height:40px; border:0px solid #000; margin-right:190px; float:right; text-align:right; padding-right:5px; } #headline .menu ul{ padding:0; margin:0; list-style:none; display: block; } #headline .menu li{ float:right; } Paldies jau iepriekš
  2. es arī, bet tas strādā ja nav position:fixed; bet ja nav position:fixed; tad atkal viņš nav pielipis pie augšas un apakšas!
  3. Svaiki! Ir tāda lieta - Šis ir div css. viņam vajadzētu būt pielipušam pie browsera augšas un apakšas. Tā arī ir, bet es nekādīgi viņu nevar iecentrēt lapas vidū!! left:50% right:50% nestrādā.. tad man div atrodas labajā pusē! Varbūt kāds var palīdžet? Paldies jau iepriekš! :) .warp{ width:1000px; margin-left:auto; margin-right:auto; background-image:url(images/body.png); background-repeat:repeat-y; position:fixed; bottom: 0px; top:0px; }
  4. un tā nevienam vēl nav nekas skaidrs? :)
  5. <?php error_reporting(E_ALL); include "../misc/db.php"; if(isset($_POST['add'])){ $author = strip_tags($_POST['author']); $title = strip_tags($_POST['title']); $discription = strip_tags($_POST['discription']); $date = date("j, n, Y"); $cover_dir = "../cover/"; $cover_path = $cover_dir . basename($_FILES['cover']['name']); $cover = basename($_FILES['cover']['name']); move_uploaded_file($_FILES['cover']['tmp_name'], $cover_path); $relise = mysql_query("INSERT INTO relise (author, title, discription, date, cover, audio) VALUES ('$author', '$title', '$discription', '$date', '$cover', '$audio') "); echo "Done!"; } ?> <form action='add.php' method='post' enctype='multipart/form-data'> Author:<input type ='text' name='author'> Title:<input type='text' name='title'> Discription:<input type='text' name='discription'> Cover:<input type='file' name='cover'> <input type='submit' name='add' value='Add'> </form> tagad iet.. vismaz cover, bet kad pielieku viasu topašu arī audio, tad audio nepievienojas
  6. viņš ievad datus, bet pie cover un audio viņš ieliek bildes nosaukumu un failus neaugšupielādē! kapēc pie audi viņš ieliek to pašu ko pie bildes un nav faila precīzs links piem. kā: cover/image.jpg? parāda tikai image.jpg un pie audio tas pats, kapēc viņš audio nenolasa? :? Tagad vispār viņš neko neievada.. neparādās neviens errors, nekas. Tasir sviests.. izmet warningus: Warning: move_uploaded_file() [function.move-uploaded-file]: The second argument to copy() function cannot be a directory in D:\WEB\www\r\admin\add.php on line 19 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'D:\WEB\tmp\php5437.tmp' to 'cover/' in D:\WEB\www\r\admin\add.php on line 19 Tas nozīmē ka vajag pilnu direktoriju, bet man ir tads pats kods citur un viņš visu izdara!!
  7. ieliku <?php include "../misc/db.php"; if(isset($_POST['add'])){ $author = strip_tags($_POST['author']); $title = strip_tags($_POST['title']); $discription = strip_tags($_POST['discription']); $date = date("j, n, Y"); $cover_folder = "../cover/"; $cover_path = $cover_folder . basename($_FILES['cover']['name']); $cover = basename($_FILES['cover']['name']); $audio_folder = "../audio/"; $audio_path = $audio_folder . basename($_FILES['audio']['name']); $audio = basename($_FILES['audio']['name']); $relese = mysql_query("INSERT INTO relise (author, title, discription, date, cover, audio) VALUES ('$author', '$title', '$discription', '$date', '$cover', '$audio') "); move_uploaded_file($_FILES['cover']['tmp_name'], $cover_folder); move_uploaded_file($_FILES['audio']['tmp_name'], $audio_folder); echo "Done!"; print_r($_POST); } ?> <form action='add.php' method='post' enctype='multipart/form-data'> Author:<input type ='text' name='author'> Title:<input type='text' name='title'> Discription:<input type='text' name='discription'> Cover:<input type='file' name='cover'> Audio:<input type='file' name='audio'> <input type='submit' name='add' value='Add'> </form> pazuda notices, bet nu pārējais bez izmaiņām un tagad vairs ziņa echo "Done!"; neparādās
  8. it kā visu izvada, vienīgais pie cover un audio ir tikai faila nosaukums, bet it kā jau jābūt ar folderu (cover/bilde.jpg, mp3/kkas.mp3)
  9. Tā tad, šāds ir kods: <?php include "../misc/db.php"; if(isset($_POST['add'])){ $author = strip_tags($_POST['author']); $title = strip_tags($_POST['title']); $discription = strip_tags($_POST['discription']); $date = date("j, n, Y"); $cover_folder = "../cover/"; $cover_path = $cover_folder . basename($_FILES['cover']['name']); $cover = basename($_FILES['cover']['name']); $audio_folder = "../mp3/"; $audio_path = $audio_folder . basename($_FILES['audio']['name']); $audio = basename($_FILES['audio']['name']); $relese = mysql_query("INSERT INTO relise (author, title, discription, date, cover, audio) VALUES ('$author', '$title', '$discription', '$date', '$cover', '$audio') "); move_uploaded_file($_FILES['cover']['tmp_name'], $cover_folder); move_uploaded_file($_FILES['audio']['tmp_name'], $audio_folder); echo "Done!"; } ?> <form method='post' action='add.php'> Author:<input type ='text' name='author'> Title:<input type='text' name='title'> Discription:<input type='text' name='discription'> Cover:<input type='file' name='cover'> Audio:<input type='file' name='audio'> <input type='submit' name='add' value='Add'> </form> Nospiežod pogu add notiek sekojošas lietas. Pirmkārt jau izlec notices: Notice: Undefined index: cover in D:\WEB\www\r\admin\add.php on line 12 Notice: Undefined index: cover in D:\WEB\www\r\admin\add.php on line 13 Notice: Undefined index: audio in D:\WEB\www\r\admin\add.php on line 16 Notice: Undefined index: audio in D:\WEB\www\r\admin\add.php on line 17 Notice: Undefined index: cover in D:\WEB\www\r\admin\add.php on line 22 Notice: Undefined index: audio in D:\WEB\www\r\admin\add.php on line 23 bet tas nu tā, galvenais ir tas, ka author, title, description ievadās iekš mysql, bet cover un audio neievadās un faili neaugšupielādējas, kas par vainu? Paldies jau iepriekš! :)
  10. tagad izmeta Warning: mysql_num_rows() expects parameter 1 to be resource, string given in D:\WEB\www\1\producers.php on line 11 a, sapratu kļūdu.. vajadzēja šādi $user_count = mysql_num_rows($result); nevis $user_count = mysql_num_rows($query);
  11. useri izvadās šādi: $query = "SELECT * FROM users"; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { echo "<div class='producer'>"; echo "<div class='avatar'>"; if ($row['avatar'] !=""){ echo "<a href='profile.php?id=".$row['user_id']."'><img src='avatars/".$row['avatar']."' height='100'></a>"; }else{ echo "<img src='avatars/no_avatar.png' width='100' height='100'>"; } echo "</div>"; echo "".$row['username'].""; echo "</div>"; } kā lai es vēl izvadu ko līdzigu šim $user_count = mysql_query_rows($query); ? ja pieliek šādu tad rāda Fatal error: Call to undefined function musql_query_rows() in D:\WEB\www\1\producers.php on line 11 Kā es varu apvienot? Paldies jau ieprieks! :)
  12. o, strādā, paldies! :) Vēlviens jautājums.. ja uzploadam ir abas name vertibas vienādas, tas nekas?
  13. Tātad, tagad man ir šādi: form: echo "<form method='post' action='search.php'>"; echo "<input type='text' name='username'><input type='submit' name='username' value='Search'>"; echo "</form>"; search.php if(isset($_POST['username'])){ $sql = mysql_query("SELECT * FROM users WHERE username LIKE '%".mysql_real_escape_string($_POST['username'])."%'"); while($row = mysql_fetch_array($sql)) { echo $row['username'].' '; } Ko es esmu palaidis garām, vai netā izdarījis, jo uzspiežot search atveras search.php tukš?
  14. ja sapratu pareizi tad nu man ir tā: Tabula users, zem kuras ir - user_id, username, password, email, location, genre, avatar un date. un gribu lai search formā ierakstot vismaz 3 simbolus vai vairāk viņš atrod username kurā ir šie simboli. Piemēram, es ierakstu: edin un viņš man atrod ziedinjsh un tml. :)
  15. kā tu to domāji, kāda datubāze?
  16. ziedinjsh

    Search

    Pilnīgi nav ne jausmas, bet nu kā izveidot meklēšanas sistēmu, piem. man vajadzētu meklēt lietotājus.. vienīgais ko es zinu ar ko sākt ir šis :D <form method='post' action='search.php'> <input type='text' name='user'><input type='submit' name='user' value='Search'> </form> kādam būtu jāizskatās search.php nav ne jausmas. Ceru uz palīdzību, paldies jau iepriekš :)
  17. uztais šādi Links: <a href='readmore.php?id=".$row['id']."'>Lasīt Vēl..</a> readmore.php $id = (isset($_GET['id'])) ? $_GET['id'] : ''; $row = mysql_fetch_array(mysql_query("SELECT * FROM news WHERE id ='$id'"));
  18. ā, es sapratu kļūdu... WHERE id = '".$id."' vajadzēja WHERE user_id '".$id."' un kā es varētu unlink(); izmantot lai man izdzēš bildi no foldera? $avatar = $row['avatar'] $user_id = $row['user_id'] mysql_query("UPDATE users SET avatar = '' WHERE user_id = '".$user_id."'"); unlink("avatars/".$avatar); header("location: edit_profile.php");
  19. nu man tagad ir šādi: <a href='delete.php?wath=avatar' > delete.php session_start(); include "misc/db.php"; $row = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE email = '{$_SESSION['email']}'")); if($_GET["wath"]=="avatar") { $id = $row['user_id']; mysql_query("UPDATE users SET avatar = '' WHERE id = '".$id."'"); }else{ header("location: edit_profile.php"); } uzspiežot uz linka atveras tukšā lapa un viss.. un bildi viņš neizdzēš!
  20. labi un kā novērst to lai neizdzēš visu lietotāju?
  21. ziedinjsh

    delete

    Man tāds jautājums.. ka es varu izdzēst informāciju no mysql? Šini gadījumā man ir links kuram ir jāizdzēš lietotāja avatars <a href='delete.php?avatar=delete&avatar=".$row['avatar']."' > delete.php $row = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE email = '{$_SESSION['email']}'")); if($_GET["avatar"]=="delete") { $avatar = $row['avatar']; $sql = sprintf("DELETE FROM users WHERE avatar = $avatar"); $result = mysql_query($sql); }else{ header("location: edit_profile.php"); } kapēc viņš neizdzēš??
  22. es jau lietoju uzpload scriptu, bet viņam ir tikai loader.gif bilde :D php <?php session_start(); if(isset($_SESSION['email'])){ include "html.php"; include "header.php"; include "menu.php"; $row = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE email = '{$_SESSION['email']}'")); if (isset($_POST['song'])){ $user_id = $row['user_id']; $folder = "mp3/"; $result = 0; $file = $folder . basename( $_FILES['song']['name']); $song = basename($_FILES['song']['name']); sleep(1); echo "<script language='javascript' type='text/javascript'>window.top.window.stopUpload(".$result.");</script>"; } echo "<form method='post' action='".$_SERVER['PHP_SELF']."' enctype='multipart/form-data' target='upload_target' onsubmit='startUpload();' >"; echo "<div id='loader-proces'><img src='misc/loader.gif' /><br>luudzu uzgaidiet kameer dziesma augshupielaadeejas</div>"; echo "<div id='form-proces'>"; echo "<input name='song' type='file' size='30' class='login-box'/><input type='submit' name='song' class='login-button' value='Upload' />"; echo "</div>"; echo "<iframe id='upload_target' name='upload_target' src='#' style='width:0;height:0;border:0px solid #fff;'></iframe>"; echo "</form>"; include "footer.php"; }else{ header("Location:index.php"); } ?> JS function startUpload(){ document.getElementById('loader-proces').style.visibility = 'visible'; document.getElementById('form-proces').style.visibility = 'hidden'; return true; } function stopUpload(success){ var result = ''; if (success == 1){ result = '<span class="msg">The file was uploaded successfully!<\/span><br/><br/>'; } else { result = '<span class="emsg">There was an error during file upload!<\/span><br/><br/>'; } document.getElementById('loader-proces').style.visibility = 'hidden'; document.getElementById('form-proces').innerHTML = result + '<meta http-equiv="refresh" content="2">'; document.getElementById('form-proces').style.visibility = 'visible'; return true; } varbūt var kāds pielāgot kādu JS rindu lai ir arī progresbar kas skaita prcentuāli vai nk kāds krāsu stabiņš kas atbilst progresam ??
×
×
  • Create New...