stardom
New Member
- Messages
- 158
- Reaction score
- 2
- Points
- 0
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?
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.
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.