+ Reply to Thread
Results 1 to 7 of 7

Thread: Voting Incentive script Help.

  1. #1
    stardom's Avatar
    stardom is offline x10 Sophmore stardom is an unknown quantity at this point
    Join Date
    Apr 2010
    Location
    Lexington, Kentucky
    Posts
    162

    Voting Incentive script Help.

    I have wrote a voting incentive script to use on my game. The problem is. I can get the user to click on the voting link. I can get the incentive to credit. Yet I can't send the user to the voting site. Here is the code. Maybe you can take a look?

    Code:
    <? include("_game-header.php");
    $gamepoll2 = mysql_query("SELECT * FROM game_vote");
    $gamepoll = mysql_fetch_array($gamepoll2);
    
    
    if($action == ""){
    echo "<br><center><table border=1 cellspacing=0 cellpadding=5>";
    echo "<tr><td><center><b>Vote Reward:<td colspan=2><center>".number_format($gamepoll[gold])." gold</table><br><br>";
    
    if(!$vote){
    if($accinfo[gamevote] == 0){
    echo "Please select your option to vote for in this poll. As a reward for taking part in the Poll, you will receive <b>".number_format($gamepoll[gold])." gold</b>.<br><br>";
    echo "[<a href=javascript:popUp('game-vote.php?vote=1')>MPOG Top 200</a>]";}    
    if($accinfo[gamevote] > 0){
    echo "You have already voted for <b>Answer $accinfo[gamevote]</b> in this poll.<br><br>";}}
    
    if($vote){
    if($accinfo[gamevote] > 0){
    echo "You have already voted for <b>Answer $accinfo[gamevote]</b> in this poll.<br><br>";
    include("_game-footer.php");
    exit;}
    if(($vote < 1 || $vote > 3 || (is_numeric($vote) != true))){
    echo "<br><center><font color=red><b>Error:</b></font> You can only vote for the options available.<br>";
    include("_game-footer.php");
    exit;}
    echo "<font color=yellow><b>Success:</b></font> You have submitted your vote for <b>Option $vote</b> for the Poll. You have been credited with your reward.<br><br>";
    mysql_query("UPDATE user_maininfo SET gamevote='$vote' WHERE uniqueid='$accinfo[uniqueid]'");
    mysql_query("UPDATE user_economy SET gold=gold+'$gamepoll[gold]' WHERE uniqueid='$accinfo[uniqueid]'");}
    echo "<br>[<a href=game-myhut.php>Go to Your Hut</a>]<br><br>";}
    
    include("_game-footer.php");?>
    It pops up in a new window. I am trying to get it to pop up in the new window, then forward them to the voting site. I can also take away the javascript and target=_blank the url if needed.

    I just need to know how to redirect once the vote has been counted. I can make a redirect page.Thanks in advance.

  2. #2
    Teensweb is offline x10 Lieutenant Teensweb is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    352

    Re: Voting Incentive script Help.

    Can't you use a meta refresh tag?

  3. #3
    stardom's Avatar
    stardom is offline x10 Sophmore stardom is an unknown quantity at this point
    Join Date
    Apr 2010
    Location
    Lexington, Kentucky
    Posts
    162

    Re: Voting Incentive script Help.

    That is what I will be doing. I need to know how to get the include for it to work. I only need the include to work on the

    echo "<font color=yellow><b>Success:</b></font> You have submitted your vote for <b>Option $vote</b> for the Poll. You have been credited with your reward.<br><br>";
    mysql_query("UPDATE user_maininfo SET gamevote='$vote' WHERE uniqueid='$accinfo[uniqueid]'");
    mysql_query("UPDATE user_economy SET gold=gold+'$gamepoll[gold]' WHERE uniqueid='$accinfo[uniqueid]'");}
    echo "<br>[<a href=game-myhut.php>Go to Your Hut</a>]<br><br>";}
    Part of the code. I don't want it to show on the rest of the script.

    ---------- Post added at 02:32 PM ---------- Previous post was at 12:11 PM ----------

    I got this to work myself. Thanks for the help and sorry for the x2posting.

  4. #4
    Teensweb is offline x10 Lieutenant Teensweb is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    352

    Re: Voting Incentive script Help.

    I dint get the part you said about the include, but I have no clue as to how a meta tag(which obviously is pure html) can interfere on your php script...!
    Sorry that I could be of no further help...
    Edit: Uh, glad that you got it solved..
    Last edited by Teensweb; 05-24-2011 at 09:38 AM.

  5. #5
    vv.bbcc19's Avatar
    vv.bbcc19 is offline Community Advocate vv.bbcc19 is just really nice
    Join Date
    Jun 2010
    Location
    India
    Posts
    1,505

    Re: Voting Incentive script Help.

    Quote Originally Posted by stardom View Post
    I have wrote a voting incentive script to use on my game. The problem is. I can get the user to click on the voting link. I can get the incentive to credit. Yet I can't send the user to the voting site. Here is the code. Maybe you can take a look?

    Code:
    <? include("_game-header.php");
    $gamepoll2 = mysql_query("SELECT * FROM game_vote");
    $gamepoll = mysql_fetch_array($gamepoll2);
    
    
    if($action == ""){
    echo "<br><center><table border=1 cellspacing=0 cellpadding=5>";
    echo "<tr><td><center><b>Vote Reward:<td colspan=2><center>".number_format($gamepoll[gold])." gold</table><br><br>";
    
    if(!$vote){
    if($accinfo[gamevote] == 0){
    echo "Please select your option to vote for in this poll. As a reward for taking part in the Poll, you will receive <b>".number_format($gamepoll[gold])." gold</b>.<br><br>";
    echo "[<a href=javascript:popUp('game-vote.php?vote=1')>MPOG Top 200</a>]";}    
    if($accinfo[gamevote] > 0){
    echo "You have already voted for <b>Answer $accinfo[gamevote]</b> in this poll.<br><br>";}}
    
    if($vote){
    if($accinfo[gamevote] > 0){
    echo "You have already voted for <b>Answer $accinfo[gamevote]</b> in this poll.<br><br>";
    include("_game-footer.php");
    exit;}
    if(($vote < 1 || $vote > 3 || (is_numeric($vote) != true))){
    echo "<br><center><font color=red><b>Error:</b></font> You can only vote for the options available.<br>";
    include("_game-footer.php");
    exit;}
    echo "<font color=yellow><b>Success:</b></font> You have submitted your vote for <b>Option $vote</b> for the Poll. You have been credited with your reward.<br><br>";
    mysql_query("UPDATE user_maininfo SET gamevote='$vote' WHERE uniqueid='$accinfo[uniqueid]'");
    mysql_query("UPDATE user_economy SET gold=gold+'$gamepoll[gold]' WHERE uniqueid='$accinfo[uniqueid]'");}
    echo "<br>[<a href=game-myhut.php>Go to Your Hut</a>]<br><br>";}
    
    include("_game-footer.php");?>
    It pops up in a new window. I am trying to get it to pop up in the new window, then forward them to the voting site. I can also take away the javascript and target=_blank the url if needed.

    I just need to know how to redirect once the vote has been counted. I can make a redirect page.Thanks in advance.
    Thank You very much.
    Can you transcribe that into a joomla module/component..
    If so..can you plz post that..

  6. #6
    protego8's Avatar
    protego8 is offline x10Hosting Member protego8 is an unknown quantity at this point
    Join Date
    Dec 2009
    Posts
    14

    Re: Voting Incentive script Help.

    If the form submits when the user votes, as in the page reloads, you can just use header('location: http://yourpagehere.com");

  7. #7
    vv.bbcc19's Avatar
    vv.bbcc19 is offline Community Advocate vv.bbcc19 is just really nice
    Join Date
    Jun 2010
    Location
    India
    Posts
    1,505

    Re: Voting Incentive script Help.

    Quote Originally Posted by protego8 View Post
    If the form submits when the user votes, as in the page reloads, you can just use header('location: http://yourpagehere.com");
    Agreed.You can still use the header ..but form should be complete by the way.
    BCV | Community Support Representative
    █ x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

+ Reply to Thread

Similar Threads

  1. Replies: 2
    Last Post: 06-20-2011, 05:54 AM
  2. Can Anyone Recommend a Good BBS script?
    By harp21649 in forum Scripts & 3rd Party Apps
    Replies: 5
    Last Post: 05-24-2011, 12:36 AM
  3. Script installed error. Please help!
    By aquarius_vanilla12 in forum Tutorials
    Replies: 3
    Last Post: 05-21-2011, 11:24 AM
  4. php contact script not working
    By michael.holsteinii91 in forum Free Hosting
    Replies: 0
    Last Post: 05-20-2011, 05:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers