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

Results 1 to 10 of 18

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1.     
    #1
    Banned
    Website's:
    WarezRelease.org ThatHosting.co
    ok so now im adding an IP check, here's what ive come up with:

    PHP Code: 
        $IP gethostbyname($_SERVER['REMOTE_ADDR']);
        
    $id = (isset($_GET['id'])) ? mysql_real_escape_string(trim($_GET['id'])): ''
        
         
    $check "SELECT ip FROM wcddl_downloads WHERE id = '$id'";
        
    $result mysql_query($check) or die(mysql_error());
        
        if (
    $IP == $result) {
            
    $thumbsHTML .= 'You have already voted';
        } else {
            
    $thumbsHTML .= '
            <center>
            <form action="" method="post">
            
                <input name="good" type="submit" value="." id="upBtn" /><br />
                <input name="bad" type="submit" value="." id="downBtn" />
            
            </form>
            </center>'
    ;
        } 
    doesnt seem to work, why? any help.
    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
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Quote Originally Posted by Chris2009 View Post
    ok so now im adding an IP check, here's what ive come up with:

    PHP Code: 
        $IP gethostbyname($_SERVER['REMOTE_ADDR']);
        
    $id = (isset($_GET['id'])) ? mysql_real_escape_string(trim($_GET['id'])): ''
        
         
    $check "SELECT ip FROM wcddl_downloads WHERE id = '$id'";
        
    $result mysql_query($check) or die(mysql_error());
        
        if (
    $IP == $result) {
            
    $thumbsHTML .= 'You have already voted';
        } else {
            
    $thumbsHTML .= '
            <center>
            <form action="" method="post">
            
                <input name="good" type="submit" value="." id="upBtn" /><br />
                <input name="bad" type="submit" value="." id="downBtn" />
            
            </form>
            </center>'
    ;
        } 
    doesnt seem to work, why? any help.
    I see no point why you should use gethostbyname after getting user ip
    And you are checking the ip with the mysql query results
    $IP == $result

    Use mysql_num_rows to count results! Try this:

    PHP Code: 
        $IP $_SERVER['REMOTE_ADDR'];
        
    $id = (isset($_GET['id'])) ? mysql_real_escape_string(trim($_GET['id'])): ''
        
        
    $check "SELECT ip FROM wcddl_downloads WHERE id = '$id'";
        
    $result mysql_query($check) or die(mysql_error());
        
        if (
    mysql_num_rows($result)==0) {
            
    $thumbsHTML .= '
            <center>
            <form action="" method="post">
            
                <input name="good" type="submit" value="." id="upBtn" /><br />
                <input name="bad" type="submit" value="." id="downBtn" />
            
            </form>
            </center>'
    ;
        } else {
           
    $thumbsHTML .= 'You have already voted';
        } 

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