Results 1 to 3 of 3
-
9th Oct 2009, 05:40 PM #1OPMember
Form Data Help
I thought I would create a MYSQL site from the ground up to learn some sht
http://dnsavings.info
I started creating a system to vote + or - for live/dead coupons, at the moment coupons with a - vote show as grey, this will be improved when I have it working correctly.
The problem is the voting works in Firefox but not IE
http://dnsavings.info/registrar-coupons.php
Can anyone tell me where I have gone wrong...
Thanks
Accept form data
Code:IF (isset($_POST['voteyes'])) { $id=mysql_real_escape_string($_POST['voteyes']); mysql_query("UPDATE couponcodes SET voteyes=voteyes+1 WHERE id ='$id'"); } ELSE IF (isset($_POST['voteno'])) { $id=mysql_real_escape_string($_POST['voteno']); mysql_query("UPDATE couponcodes SET voteyes=voteyes-1 WHERE id ='$id'"); }
Display Coupons
Code:$reghosts = array('Dotster', 'GoDaddy', 'EuroDNS', 'NameCheap'); echo "<form action='{$_SERVER['PHP_SELF']}' method=\"post\">\n"; foreach ($reghosts as $rhost) { echo "<h3>Latest ".$rhost." Coupon Codes<a name=\"".$rhost."\" id=\"".$rhost."\"></a> <a href=\"".$sitebaseurl."site/".$rhost."\" alt=\"View All Coupon Codes For ".$rhost."\" title=\"View All Coupon Codes For ".$rhost."\"><font size=\"1\">(View All)</font></a></h3>"; $result = mysql_query("SELECT * FROM couponcodes WHERE hostname LIKE '" . $rhost . "' AND coupontype='Domains' AND validated='1' ORDER BY id LIMIT 4"); while($row = mysql_fetch_array($result)){ $voted = $row['voteyes'];if ($voted >=0) {$div ="reg_coupon";} elseif ($voted <0) {$div ="dead_reg_coupon";} echo "<div id=\"".$div."\">\n". "<h4><img src=\"".$sitebaseurl."img/tick.png\" alt=\"".$row['coupontype']." Coupon\" width=\"16\" height=\"16\"/> ".$row['coupontype']." Coupon</h4>\n". "<p><img src=\"".$sitebaseurl."img/arrow_right.png\" alt=\"".$row['coupontype']." Coupons\" width=\"16\" height=\"16\"/> Site Name: <a href=\"".$row['siteurl']."\" target=\"_blank\" title=\"Visit ".$row['hostname']." and use the ".$row['coupontype']." coupon code\"> ".$row['hostname']."</a></p>\n". "<p>Discount:<strong> ".$row['discount']."</strong></p>\n". "<p>Coupon Code:<strong><small> ".$row['couponcode']."</small></strong>\n". "<input class=\"imgright\" type=\"image\" src=\"subtract.png\" name=\"voteno\" value=\"".$row['id']."\"/>\n". "<input class=\"imgright\" type=\"image\" src=\"add.png\" name=\"voteyes\" value=\"".$row['id']."\"/></p>\n". "</div>\n"; } }
Gavo Reviewed by Gavo on . Form Data Help I thought I would create a MYSQL site from the ground up to learn some sht :D http://dnsavings.info I started creating a system to vote + or - for live/dead coupons, at the moment coupons with a - vote show as grey, this will be improved when I have it working correctly. The problem is the voting works in Firefox but not IE X-( http://dnsavings.info/registrar-coupons.php Rating: 5
-
10th Oct 2009, 12:42 AM #2MemberWebsite's:
warezxtc.comIt is impossible for something coded in PHP to work on FF but not IE.
May just be a HTML problem.
Anyways, will look through your code now (very messy lol)
EDIT: You forgot to add an end to the form.
Code:if (isset($_POST['voteyes'])){ $id=mysql_real_escape_string($_POST['voteyes']); mysql_query("UPDATE couponcodes SET voteyes=voteyes+1 WHERE id ='$id'"); } elseif (isset($_POST['voteno'])) { $id=mysql_real_escape_string($_POST['voteno']); mysql_query("UPDATE couponcodes SET voteyes=voteyes-1 WHERE id ='$id'"); } $reghosts = array('Dotster', 'GoDaddy', 'EuroDNS', 'NameCheap'); echo "<form action='{$_SERVER['PHP_SELF']}' method=\"post\">\n"; foreach ($reghosts as $rhost) { echo "<h3>Latest ".$rhost." Coupon Codes<a name=\"".$rhost."\" id=\"".$rhost."\"></a> <a href=\"".$sitebaseurl."site/".$rhost."\" alt=\"View All Coupon Codes For ".$rhost."\" title=\"View All Coupon Codes For ".$rhost."\"><font size=\"1\">(View All)</font></a></h3>"; $result = mysql_query("SELECT * FROM couponcodes WHERE hostname LIKE '" . $rhost . "' AND coupontype='Domains' AND validated='1' ORDER BY id LIMIT 4"); while($row = mysql_fetch_array($result)){ $voted = $row['voteyes'];if ($voted >=0) {$div ="reg_coupon";} elseif ($voted <0) {$div ="dead_reg_coupon";} echo "<div id=\"".$div."\">\n". "<h4><img src=\"".$sitebaseurl."img/tick.png\" alt=\"".$row['coupontype']." Coupon\" width=\"16\" height=\"16\"/> ".$row['coupontype']." Coupon</h4>\n". "<p><img src=\"".$sitebaseurl."img/arrow_right.png\" alt=\"".$row['coupontype']." Coupons\" width=\"16\" height=\"16\"/> Site Name: <a href=\"".$row['siteurl']."\" target=\"_blank\" title=\"Visit ".$row['hostname']." and use the ".$row['coupontype']." coupon code\"> ".$row['hostname']."</a></p>\n". "<p>Discount:<strong> ".$row['discount']."</strong></p>\n". "<p>Coupon Code:<strong><small> ".$row['couponcode']."</small></strong>\n". "<input class=\"imgright\" type=\"image\" src=\"subtract.png\" name=\"voteno\" value=\"".$row['id']."\"/>\n". "<input class=\"imgright\" type=\"image\" src=\"add.png\" name=\"voteyes\" value=\"".$row['id']."\"/></p>\n". "</div>\n"; } echo "</form>"; }
-
10th Oct 2009, 07:26 PM #3OPMember
The /form is included in the code for the 2nd loop to display 'other' coupons, so that isn't the problem.
I had already tried making each coupon one form, and the whole section one form, but it doesnt solve the problem.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
new email form UMB...
By abodagoma in forum File Host DiscussionReplies: 1Last Post: 18th Oct 2012, 07:43 AM -
Breakdance as an art form
By cvrle77 in forum General DiscussionReplies: 3Last Post: 31st Dec 2011, 10:57 AM -
How to recover deleted or lost data, file, photo on Mac with Data Recovery software
By Jack20126 in forum General DiscussionReplies: 0Last Post: 20th Dec 2011, 03:37 AM -
How to convert data of wordpress to data of Datalife Engine
By chipve in forum Webmaster DiscussionReplies: 0Last Post: 5th May 2010, 05:35 PM -
I want to get uplink form DSL while using SAT NET
By Palooo 2009 in forum Technical Help Desk SupportReplies: 4Last Post: 28th Mar 2010, 08:49 AM
themaCreator - create posts from...
Version 3.24 released. Open older version (or...