I’m having some trouble getting the text field from the page found here:Here
And moving it here: Here
I have tried the $_post function as I have seen before, but it doesn’t seem to carry the info over!
Here is the script currently for the first page described:
<?php
// Creator: Will Renfroe
// All rights Reserved
//Vote Sites and MySQL
$DBNAME="mysql";
$DBUSER="mysql";
$DBPASSWORD="mysql";
$DBHOST="mysql";
///////////////////
// SCRIPT
///////////////////
mysql_connect($DBHOST, $DBUSER, $DBPASSWORD) or die("<center>Cannot connect to MySQL</center>");
mysql_select_db($DBNAME) or die("<center>Cannot select DB</center>");
/////////
?>
<?php
include("secure.php");
if (getenv(HTTP_X_FORWARDED_FOR)) {
$pipaddress = getenv(HTTP_X_FORWARDED_FOR);
$ipaddress = getenv(REMOTE_ADDR);
} else {
$ipaddress = getenv(REMOTE_ADDR);
}
if(isset($_POST['dovote'])){
check_inject();
//Get user id from session
$userid=secure($_POST["nick"]);
$time=time();
$query=mysql_query("SELECT nick,time FROM votesdb WHERE ip='$ipaddress'");
$checkip=mysql_num_rows($query);
$iprow=mysql_fetch_row($query);
$query=mysql_query("SELECT time FROM votesdb WHERE nick='$userid'");
$checkuser=mysql_num_rows($query);
$userrow=mysql_fetch_row($query);
if ($checkuser){
//if user vote
if ($checkip and $time>$iprow[1]){$canvote=1;}
if (!$checkip and $time>$userrow[0]){$canvote=1;}
}else{
//if user never vote
if ($checkip and $time>$iprow[1]){$canvote=1;}
if (!$checkip){$canvote=1;}
}
//Do Vote
if ($canvote){
$newtime=time()+60*60*24;
if ($checkuser){
//update
mysql_query("UPDATE votesdb SET time=$newtime, ip='$ipaddress', votes=votes+1, flags=flags+1 WHERE nick='$userid'");
}else{
//insert
$query=mysql_query("INSERT INTO votesdb(nick,time,ip,votes,flags) VALUES ('$userid',$newtime,'$ipaddress',1,1)");
}
//Add nick to nicklist table
$query=mysql_query("INSERT INTO nicklist(nick) VALUES ('$userid')");
echo "<font color='red'>You can vote every 24 hours to get reward.</font>";
}else{
echo "<font color='green'>thank you for voting!</font>";
}
}
?>
<style type="text/css">
.minecrafttext {
font-family: "Volter (Goldfish)";
font-size: 12px;
color: #0F3;
}
.minecrafttext {
font-family: "Volter (Goldfish)";
}
</style>
<body background="http://files.enjin.com/121395/19.gif" bgproperties="fixed"><div style="text-align: center;"> <img style="border: medium none;" alt="" title="" src="http://files.enjin.com/121395/Vote_For_Diamonds.png"><span style="color: rgb(255, 165, 0);"><br>You will get <span style="font-weight: bold; font-size: 18pt; color: rgb(255, 0, 0);">10</span></span> <img style="border: medium none; width: 37px; height: 34px;" alt="" title="" src="http://www.minecraftwiki.net/images/9/90/Diamond_%28Gem%29.png"><span style="color: rgb(255, 165, 0);">for voting on the sites below!</span><br></div><div style="text-align: center;"><span style="color: rgb(30, 144, 255); font-weight: bold;"></span><span style="color: rgb(30, 144, 255); font-weight: bold; text-decoration: underline;">Directions:</span><br>
<br>
<span class="minecrafttext">Vote right here: </span>
</div>
<center>
<form target="_blank" action="http://www.minecraftservers.net/vote.php?id=1991" method="post">
<p>
<input onClick="document.getElementById('vote4').disabled=false" value="Minecraftservers.net" name="vote1" id="vote1" type="submit" />
</p>
<p class="minecrafttext">And here: </p>
</form>
<form target="_blank" action="http://www.minestatus.net/15901-freebuildxiz" method="post">
<input onClick="document.getElementById('vote5').disabled=false" disabled="disabled" value="Minestatus" name="vote1" id="vote4" type="submit" /> </form>
<br/>
<form method="POST">
<font color='lime' class="minecrafttext"><strong>Put your In-Game-Name here!</strong></font><br/>
<input name="nick"/><br/>
<form method="POST">
<input name="dovote" type="submit" value="Receive Diamond" onClick="document.getElementById('vote5').disabled=false" id="vote5" disabled="disabled" onSubmit="return nameempty();" />
</form>
<a href="http://legacyserver.info/fbxtop.php" target="http://legacyserver.info/fbxtop.php" class="minecrafttext">Click here to see the Top 10 voters!</a>
</center>
</body>
</html>
And here for the second one:
<body background="http://files.enjin.com/121395/19.gif" bgproperties="fixed"><div style="text-align: center;"><br /> <img style="border: medium none;" alt="" title="" src="http://files.enjin.com/121395/Vote_For_Diamonds.png"><br /><center><font color='cyan'>Click below to start the vote for diamonds process!</font></center><br /><br />
<form method="POST" action="VotingScriptfbxiz.php">
<input type="image" method="POST" action="VotingScriptfbxiz.php" src="http://files.enjin.com/121395/JulieGloopUI(43)45(REV2).png" alt="Submit value="POST" input name="VoteVerify" id="submitButton" />
It does not want to function properly when I try to move the text feild from the first page to the second one and still have it submit the information correctly.
Also, there seems to be some sort of problem with the 1st script described, where it says that you voted every single time, but it doesn’t want to even add you to the database, I have tried many versions of this and it suddenly while i was messing
Your second script is wrong. You need to change that to:
Why are you using action and method for image tag. No need of that. Also you din’t close the form tag and input type=”image” tag
Also use a validator to validate.
Why are you unnecessarily using
tags. use styles to make it correct.
Hope this helps 🙂