Voting Incentive script Help.

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?

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.
 

stardom

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

Teensweb

New Member
Messages
352
Reaction score
1
Points
0
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:

vv.bbcc19

Community Advocate
Community Support
Messages
1,524
Reaction score
92
Points
48
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..
 

protego8

New Member
Messages
14
Reaction score
0
Points
0
If the form submits when the user votes, as in the page reloads, you can just use header('location: http://yourpagehere.com");
 

vv.bbcc19

Community Advocate
Community Support
Messages
1,524
Reaction score
92
Points
48
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.
 
Top