Activity Stream
48,167 MEMBERS
61076 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1.     
    #1
    Banned
    Website's:
    WarezRelease.org ThatHosting.co

    Default Thumbs up/down

    Can any1 tell me whats wrong here:

    PHP Code: 
        $thumbsUp $_POST['good'];
        
    $thumbsDown $_POST['bad'];
        
        
    $id = isset($_GET['id']) ? mysql_real_escape_string(trim($_GET['id'])): '';
        
        if (
    $thumbsUp) {
            
    mysql_query("UPDATE wcddl_downloads SET thumbsup=thumbsup+1 WHERE id='$id'");
        } 
    Basically when i press the thumbsu button i want to increment the field +1 for tht ddl.
    Chris2k Reviewed by Chris2k on . Thumbs up/down Can any1 tell me whats wrong here: $thumbsUp = $_POST; $thumbsDown = $_POST; $id = isset($_GET) ? mysql_real_escape_string(trim($_GET)): ''; if ($thumbsUp) { mysql_query("UPDATE wcddl_downloads SET thumbsup=thumbsup+1 WHERE id='$id'"); Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    $thumbsUp = isset($_POST['good']) ? true : false;
    $thumbsDown =
    isset($_POST['bad']) ? true : false;

    $id = isset($_GET['id']) ? (int)$_GET['id'] : 0;

    if (
    $thumbsUp) {
    mysql_query("UPDATE `wcddl_downloads` SET `thumbsup`=thumbsup+1 WHERE `id`=".$id."");
    }
    I've changed a few things to clean the script up to make it work better. But it wont solve the problem...

    the SQL query you've entered it FINE, maybe you've mis-spelt something in the query or the POST isn't POSTing...

    Edit: I also noticed...GET for id, and POST for good/bad, maybe they are both GET or POST? ..

    Made by Envee :P

  4.     
    #3
    You can call me G
    @MP3Drug: isset() returns boolean TRUE or FALSE so using a ternary operator won't do anything better..



    My Langotiya Yaars (Chaddi buddies): JmZ, humour, Chutad, Esotorisk, l0calhost, Daniel, Mind Freak?, TLK, Amz

  5.     
    #4
    Respected Developer
    Website's:
    wrzc.org
    Warning that your not recording anyone's IP address for particular submit ID. I'd have another table that contains the IP address and id. When they vote as well as recording if it's a vote up or down like your doing I'd make it record the IP and submit id in the new table. Whenever someone tries to vote first check if the IP has already voted for that id. If not then let them vote. If they have return a message saying they've already voted.

    The way it is currently anyone can vote a hundred times for the same submit.
    Tutorial How to SEO your Warez Site a guide to help you increase your organic traffic

    Huge list of Warez Sites and free Multiposter Templates

  6.     
    #5
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    I see no syntax error in your php code and i guess it would be right

    I guess there could be problem in mysql query:
    PHP Code: 
    mysql_query("UPDATE wcddl_downloads SET thumbsup=thumbsup+1 WHERE id='$id'"); 
    Add die with mysql query:
    PHP Code: 
    mysql_query("UPDATE wcddl_downloads SET thumbsup=thumbsup+1 WHERE id='$id'") or die(mysql_error()); 
    This will let you know if there's problem in the query

    The other problem i am guessing is the 'good' data is not posted

    Try seeing if its posted

    PHP Code: 
    $thumbsUp $_POST['good']; 
        
    $thumbsDown $_POST['bad']; 
         
        
    $id = isset($_GET['id']) ? mysql_real_escape_string(trim($_GET['id'])): ''
         
        if (
    $thumbsUp) { 
            
    mysql_query("UPDATE wcddl_downloads SET thumbsup=thumbsup+1 WHERE id='$id'"); 
        } else {
      die(
    'Shit Happened and you didn't posted anything');

    I guess it would be the above error

    Edit: Just replace this too if the above doesn't works:
    PHP Code: 
    $id = (isset($_GET['id'])) ? mysql_real_escape_string(trim($_GET['id'])): ''

  7.     
    #6
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    i tried ur code soft2050 in my leftbar.php, this what im getting even i didnt press buttton



    EDIT: better thinking, im gonna add my php code to funcs.php

  8.     
    #7
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Quote Originally Posted by Chris2009 View Post
    i tried ur code soft2050 in my leftbar.php, this what im getting even i didnt press buttton

    Hmm! Yeah! Just ignore that for now! You can try it for testing and remove afterwards
    Try to press Good Download now
    And see if it still shows that thing or something else

  9.     
    #8
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    tested, no luck.


    EDIT: better thinking, im gonna add my php code to funcs.php

  10.     
    #9
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Quote Originally Posted by Chris2009 View Post
    tested, no luck.


    EDIT: better thinking, im gonna add my php code to funcs.php
    Adding it to funcs.php wont help

    Paste the output of the html (page source) here
    There's some problem in posting data

  11.     
    #10
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    here is my form,

    Code: 
    	<form action="" method="post">
    	
            <input name="good" type="button" value="Good Download xD" /> <input name="bad" type="button" value="Bad Download :)" />
        </form>
    here's a test http://warezrelease.info/download-11...UR%29-PS3.html

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Thumbs Ups and Thumbs Downs of 2011
    By Krack3r in forum General Discussion
    Replies: 8
    Last Post: 29th Dec 2011, 11:51 PM
  2. Thumbs up!
    By Maniac_ in forum Feedback and Suggestions
    Replies: 5
    Last Post: 20th Aug 2011, 01:43 AM
  3. Tunisian Needs Thumbs Up
    By Jumbo in forum General Discussion
    Replies: 9
    Last Post: 18th Jan 2011, 12:38 PM
  4. New Logo. Thumbs up or Down?
    By fileserve-links in forum Graphics Area
    Replies: 12
    Last Post: 29th Sep 2010, 08:45 PM
  5. Replies: 0
    Last Post: 21st Dec 2009, 03:38 AM

Tags for this Thread

BE SOCIAL