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

Results 1 to 3 of 3
  1.     
    #1
    Member

    Default 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

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    warezxtc.com
    It 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>";
    }

  4.     
    #3
    Member
    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.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. new email form UMB...
    By abodagoma in forum File Host Discussion
    Replies: 1
    Last Post: 18th Oct 2012, 07:43 AM
  2. Breakdance as an art form
    By cvrle77 in forum General Discussion
    Replies: 3
    Last Post: 31st Dec 2011, 10:57 AM
  3. Replies: 0
    Last Post: 20th Dec 2011, 03:37 AM
  4. How to convert data of wordpress to data of Datalife Engine
    By chipve in forum Webmaster Discussion
    Replies: 0
    Last Post: 5th May 2010, 05:35 PM
  5. I want to get uplink form DSL while using SAT NET
    By Palooo 2009 in forum Technical Help Desk Support
    Replies: 4
    Last Post: 28th Mar 2010, 08:49 AM

Tags for this Thread

BE SOCIAL