Results 1 to 10 of 18
-
9th Oct 2011, 05:57 PM #1OPBannedWebsite's:
WarezRelease.org ThatHosting.coThumbs 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'");
}
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
-
9th Oct 2011, 06:04 PM #2Member$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."");
}
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
-
10th Oct 2011, 09:30 AM #3You 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
-
10th Oct 2011, 09:54 AM #4Respected DeveloperWebsite's:
wrzc.orgWarning 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
-
10th Oct 2011, 10:05 AM #5Respected MemberWebsite's:
DL4Everything.com Soft2050.inI 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'");
PHP Code:mysql_query("UPDATE wcddl_downloads SET thumbsup=thumbsup+1 WHERE id='$id'") or die(mysql_error());
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');
}
Edit: Just replace this too if the above doesn't works:
PHP Code:$id = (isset($_GET['id'])) ? mysql_real_escape_string(trim($_GET['id'])): '';
-
10th Oct 2011, 02:40 PM #6OPBannedWebsite's:
WarezRelease.org ThatHosting.coi 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
-
10th Oct 2011, 02:44 PM #7Respected MemberWebsite's:
DL4Everything.com Soft2050.in
-
10th Oct 2011, 02:47 PM #8OPBannedWebsite's:
WarezRelease.org ThatHosting.cotested, no luck.
EDIT: better thinking, im gonna add my php code to funcs.php
-
10th Oct 2011, 02:49 PM #9Respected MemberWebsite's:
DL4Everything.com Soft2050.in
-
10th Oct 2011, 03:02 PM #10OPBannedWebsite's:
WarezRelease.org ThatHosting.cohere 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>
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.56 released. Open older version (or...