Results 1 to 10 of 18
Hybrid View
-
12th Oct 2011, 10:44 PM #1OPBannedWebsite's:
WarezRelease.org ThatHosting.cook 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>';
}
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
-
13th Oct 2011, 04:53 PM #2Respected MemberWebsite's:
DL4Everything.com Soft2050.inI 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';
}
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Thumbs Ups and Thumbs Downs of 2011
By Krack3r in forum General DiscussionReplies: 8Last Post: 29th Dec 2011, 11:51 PM -
Thumbs up!
By Maniac_ in forum Feedback and SuggestionsReplies: 5Last Post: 20th Aug 2011, 01:43 AM -
Tunisian Needs Thumbs Up
By Jumbo in forum General DiscussionReplies: 9Last Post: 18th Jan 2011, 12:38 PM -
New Logo. Thumbs up or Down?
By fileserve-links in forum Graphics AreaReplies: 12Last Post: 29th Sep 2010, 08:45 PM -
Im after a mod like ? dgTopic Thumbs Hellp Plz :)
By bumilad20 in forum phpBBReplies: 0Last Post: 21st Dec 2009, 03:38 AM
themaCreator - create posts from...
Version 3.50 released. Open older version (or...