thanks it works now great, although i get a header error allready sent kinda thingy.
but the script does what it must do, even when it errors.
gr.
I have an alt version, that does everything correctly but uses another page to set the cookie
Ok it still dosn't take you to the vote site when you click vote.
It just takes me back to my index page. For the third time you have said you have fixed this.
Are you really going to fix it. I would really like to be getting votes this weekend and now I have a broken pop up vote on my site
So the faster this works the better for me.
Last edited by chronic7; 03-22-2008 at 02:03 PM.
I have other things to do mate, no need to get angry just because I don't have time to upload.
Never said I fixed it.For the third time you have said you have fixed this.
vote.php http://pastebin.com/f2f265a7c
votegateway.php http://pastebin.com/f91110d9
when i press vote nothing happens O.o I tryed to fix it by myself but soemthing is wrong![]()
The redirect still doesn't work.
Problem on your end. Works fine for me, with cookies and DB and everything.
Works fine for me great job Ultra spidey
Mine will not redirect
Last edited by delldude1989; 03-26-2008 at 03:30 PM.
very nice been waiting for this for long time
DAM I HATE THIS EVERY STUFF IS SET GOOD !!!
[codebox]<?php
$user="root";
$password="XXXXX";
$database="ascent"; //Char+login DB
$nochar=false;
$voted=false;
$disp = true;
if(($_COOKIE['vote']) != '1')
{
if(!empty($_POST['name']))
{
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to select database");
$name = strtolower(mysql_real_escape_string($_POST['name']));
$today = date("mdHi");
$query="SELECT * FROM characters WHERE name='$name' LIMIT 1";
$result = mysql_query($query);
if($row = mysql_fetch_array($result))
{
$guid = $row['guid'];
$acct = $row['acct'];
$res = mysql_query("SELECT * FROM votewatch WHERE acct='$acct' LIMIT 1");
if($r2 = mysql_fetch_array($res))
{
$ct = $r2['ctime'];
if($today-$ct < 1200)
{
$disp = false;
mysql_close();
return;
}
else
{
mysql_query("DELETE FROM votewatch WHERE acct='$acct' LIMIT 1");
}
}
$reward = mysql_real_escape_string($_POST['reward']);
if($reward == 0)
{
mysql_query("INSERT INTO mailbox_insert_queue(sender_guid, receiver_guid, subject, body, stationary, money, item_id, item_stack) VALUES ($guid, $guid, 'Thank you for voting!', 'Have this item as a reward', 0, 100000, 0, 1)");
}
else
{
mysql_query("INSERT INTO mailbox_insert_queue(sender_guid, receiver_guid, subject, body, stationary, money, item_id, item_stack) VALUES ($guid, $guid, 'Thank you for voting!', 'Have this item as a reward', 0, 0, $reward, 1)");
}
mysql_query("INSERT INTO votewatch(acct, ctime) VALUES($acct, $today)");
$voted = true;
}
else
{
$nochar = true;
}
mysql_close();
}
}
else
{
$disp = false;
}
?>
<div id='container' style='-moz-user-select: none; -khtml-user-select: none; user-select: none; cursor:default; padding-bottom:5px; width:320px; border: 4px double red; position: absolute; top:20px; left:20px; background-color:black; color:white;'>
<div id='header' style='font-family: Arial; margin-bottom: 0.5em; border-bottom: 1px solid red; text-align: center; background-color:gray; color:#ffffff'>
Please vote for our server!
<span align='right' style='position:absolute; left: 305px; text-align: right;'>
<a href='javascript:void();' style='font-size:10px; color:white; text-decoration:none;' onclick='javascript:document.getElementById("container").style.display="none";'>
[X]
</a>
</span>
</div>
<div id='text' style='padding: 5px; padding-left: 7px; font-size: 12px; border-bottom: 1px solid red;'>
Voting for our server helps us grow and Get More Players,
and eventually become better than before.
You can vote once every 12 hours, and you'll get a reward for doing so!
</div>
<form style='text-align: center; margin-bottom: 2px; margin-top: 5px;' method='post' action='votegateway.php'>
<div style='font-size: 12px; valign:center;'>
Character Name:
<input type='text' name='name' style='font-size: 12px; width: 80px; background-color: black; color: white; border: 1px solid red;' />
<input type='submit' style='font-size: 12px; position:relative; top:1px; color:white; height: 17px; border:1px solid red; background-color:black;' value='Vote!' />
</div>
<div style='font-size: 12px; valign:center; margin-top: 5px; padding-top: 3px;'>
Choose a reward:
<select name='reward' style='background-color: black; color: white; font-family: Arial; font-size: 12px; border: 1px solid red; height: 17px; font-size: 10px;'>
<option value='0'>10 Gold</option>
<option value='27498'>Scroll of Agility V</option>
<option value='27499'>Scroll of Intellect V</option>
<option value='27500'>Scroll of Protection V</option>
<option value='27501'>Scroll of Spirit V</option>
<option value='27502'>Scroll of Stamina V</option>
<option value='27503'>Scroll of Strength V</option>
</select>
</div>
<?php
if($nochar)
{
echo "<br /><span style='font-size: 12px; color: black; background-colorink; padding: 3px; position: relative; top: -8px; border: 1px solid red;'>A character with that name was not found</span>";
}
if($voted)
{
echo "<br /><span style='font-size: 12px; color: white; background-color:black; padding: 3px; position: relative; top: -8px; border: 1px solid red;'>Thank you for voting!</span>";
echo "<script language='javascript'>setTimeout(\"location.href='votegateway.php'\",3000);</script>";
}
?>
</form>
</div>[/codebox] I need ****ing help !!!
You need to post your error.
quick question, what do i add/edit to get it to work if my server is hosted in a different area then my site? cause i use a hoster for my site and run the server off a computer at home
Has anybody else noticed that if you save the popup's output source to your harddrive, change the item IDs, and use the new form, you can give yourself any item?
Had a couple players on my server giving themselves donor items... -_-