Jump to content

Search the Community

Showing results for tags 'voteup'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Informatii generale
    • Anunturi importante
    • Bine ai venit
    • Proiecte RST
  • Sectiunea tehnica
    • Exploituri
    • Challenges (CTF)
    • Bug Bounty
    • Programare
    • Securitate web
    • Reverse engineering & exploit development
    • Mobile security
    • Sisteme de operare si discutii hardware
    • Electronica
    • Wireless Pentesting
    • Black SEO & monetizare
  • Tutoriale
    • Tutoriale in romana
    • Tutoriale in engleza
    • Tutoriale video
  • Programe
    • Programe hacking
    • Programe securitate
    • Programe utile
    • Free stuff
  • Discutii generale
    • RST Market
    • Off-topic
    • Discutii incepatori
    • Stiri securitate
    • Linkuri
    • Cosul de gunoi
  • Club Test's Topics
  • Clubul saraciei absolute's Topics
  • Chernobyl Hackers's Topics
  • Programming & Fun's Jokes / Funny pictures (programming related!)
  • Programming & Fun's Programming
  • Programming & Fun's Programming challenges
  • Bani pă net's Topics
  • Cumparaturi online's Topics
  • Web Development's Forum
  • 3D Print's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Yahoo


Jabber


Skype


Location


Interests


Occupation


Interests


Biography


Location

Found 1 result

  1. Vreau sa fac un vote up la posturile mele dar se pare ca nu reusesc sa fac cum vreau eu plus ca nu stiu javascript,ajax,etc, doar "descifrez" ce poate scrie in codul acela. O sa incerc sa scriu cat mai putin "carnat code". Am asa in table "post"-> id,title,vote,user (le-am sters pe celelalte care nu ne intereseaza) Si in table "post_vote_security" memoram cine a postat -> post_uniq_id,post_id,post_user Vreau sa dau click pe "VOTE UP" si fara sa incarce pagina sa se adauge votul,asta cred ca am rezolvat! dar nu stiu cum sa se contorizeze votul cu +1 fara sa dau refresh la pagina si sa scrie in loc de "VOTE UP"-> "VOTED" ca text(neclickabil(ce ciudat suna))! iar dupa ce se da refresh la pagina , postul care s-a votat sa arate "VOTED" tot asa, ca text. Exista live update din sql cu jquery? sa pot schimba numarul voturile in felul asta?sau cum se face? La partea cand vreau sa scrie VOTED dupa refresh postului respectiv am incercat sa intru in amandoua tabele deodata (SELECT * from post LEFT JOIN post_vote_security on post.id=post_vote_security.post_id order by vote DESC) si credeam ca am rezolvat( verificam daca sesiunea coincide cu userul care a votat si in functie daca coincidea numele sau nu, aparea mesajul VOTED sau VOTE UP).....DAR daca POSTUL "VACA" il vota X si y......aparea de 2 ori acel post.....si m-a dat peste cap Cum sa procedez sa imi arate VOTED sau VOTE UP la post? <html> <head> <script src="jquery.js" type="text/javascript"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script> <script type="text/javascript"> $(function() { $(".vote").click(function() { var id = $(this).attr("id"); var name = $(this).attr("name"); var dataString = 'id='+ id ; var parent = $(this); if (name=='up') { $(this).fadeIn(200).html('<img src="dot.gif" />'); $.ajax({ type: "POST", url: "vote.php", data: dataString, cache: false, success: function(html) { parent.html(html); } }); } return false; }); }); </script> </head> <body> <?php include('/configs/db.php'); /* INCEPE SESIUNEA*/ session_start(); $_SESSION['user']='Crancanel'; $user=$_SESSION['user']; /* SELECTEZ POSTURILE*/ $sql=mysql_query("SELECT * from post order by vote DESC"); while($show=mysql_fetch_array($sql)) {$title=$show['title']; $vote=$show['vote']; $id=$show['id']; echo 'Voturi: <a href="" id="'.$id.'" class="vote" name="up" >vote up</a>'.$vote.' -- '.$title.'<br><hr> '; } ?> </body> </html> <?php if(isset($_POST['id'])) { /*INCEPE SESIUNEA*/ session_start(); $user=$_SESSION['user']; include('/configs/db.php'); $id=$_POST['id']; /*VERIFIC DACA USERUL DIN SESIUNEA A MAI VOTAT LA POSTUL SELECTAT*/ $check=mysql_query("SELECT * from post_vote_security where post_id='$id'"); while($verifica=mysql_fetch_array($check)){$vuser=$verifica['post_user'];} if($vuser==$user){echo 'Deja ai votat';}else{ /*SELECTEAZA VOTURILE DIN POSTUL SELECTAT */ $sel=mysql_query("select vote from post where id='$id'"); if($rand=mysql_fetch_array($sel)) {$vote=$rand['vote'];} $vote=$vote+1; /*ADAUGA +1 LA VOTURI*/ $insert="update post SET vote='$vote' where id='$id'"; if(mysql_query($insert)){echo 'Voted';} /*ADAUGA USERUL CARE A VOTAT LA POSTUL SELECTAT*/ $insertsecure=mysql_query("INSERT into post_vote_security(post_uniq_id,post_id,post_user)VALUES(0,'$id','$user')"); } }else{echo 'esec';} ?>
×
×
  • Create New...