Jump to content

LegacyP7

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

LegacyP7's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I understand that cookies can be wiped, and that is why I wish to know how I can store their usernames and IP's? Also, yes, MySQL would be a major help, and that is why I wish for you to help me out with this My earlier message explains all I want to do.
  2. Hello, many thanks for the reply. When it comes to anything with MySQL, I am a complete newbie. I basically want a PHP page with a giant table, two colums wide. The left for users, the right for votes, or clicks on that button. After that button is clicked, it goes through a script called setvoted.php, and this sets a cookie, which tells the script that the user has voted today. The Get Rewarded button only works when that cookie is not set. So I believe that there would be no need for the else and if in your statement. Correct me if I am wrong. I have never used MySQL before, so I am wondering how their username can be added to this table on another PHP document, alongside their votes. Thanks. And to the above comment, yes, once I get my head around MySQL, I will make it store their IP to, so that it can check for cookies, their IP, and their username. This would further prevent any cheating.
  3. Hello PHPFreaks, I have emerged yet again with another question. I currently have a fully operational Minecraft Voting for Diamonds script (Don't turn away because you saw Minecraft, this has nothing to do with it), and want to enhance it; though a 'Top Voters' list. Now, basically the script goes like this Login Page > Main Page with links > Rewarding Script > thank you message. On the main page with links, once all links are clicked on, you click a 'Get Rewarded' button. I want to track who clicks this, and how many times a month it is clicked by them. Only 1 click on the button is allowed per day, with the use of cookies. This means the maximum amount of clicks on it per month, per user would be something around 30. I store the players usernane in the cookies, and if they have voted today, but that is all. The Top Voters list would look something like this: Userwhatever - 6 Votes Blarg - 4 votes Someone - 2 votes And so on... I want an ordered list of users which have voted that month. 'Votes', would be the amount of times that 'Get Rewarded' had been clicked. How can I make this? I will also require it to reset all votes of the first of every month, how do I do this? Many thanks!
  4. Edit, skip this post. It was a mistake on my behalf.
  5. EDIT: Now using "setrawcookie" to prevent cheating, and URL encoding. Start Page: <center> Vote here for free <font color='#3F92D1'><b>DIAMONDS!</b></font> <br/> <br/> Enter your EXACT username! <form method='POST' action='1new.php'> <br/> <input type="text" name='username' id='user' class='text'> <br/> <input type="submit" class='submit'> </form> </center> Second Page: <?php $username = $_POST['username']; echo ("<font color='blue'>$username is logged in! </font><img src='http://cdn1.iconfinder.com/data/icons/drf/PNG/lock.png'>"); ?> //Buttons here <?php if(isset($_COOKIE["reward"])) { echo "You've already voted from this IP today!"; } else { echo ("<input type='submit' value='Get Reward' id='submit'/>"); } ?> Set Cookies Page: <?php $username = $_POST['username']; setrawcookie("reward", time()+60); ?> Last Page: <?php $username = $_POST['username']; print ("<font face='Arial' color='cyan'>$username"); echo ( " thank you for voting today! Come back in 24 hours to vote again!</font>" ); ?> Obviously, there is lots of HTML and CSS in there, but it would use up pages Is there any way I can improve the code, and make it more secure? Thanks
  6. Hello. Can sessions be deleted after 24 hours? And created when the user clicks a button to get their reward? If so, that would work well. However, I like the idea of the countdown on the button. When the button is clicked, it becomes disabled, and the countdown starts. When the countdown becomes 0, the button re-activates. How can I make this? Thanks
  7. Hello everyone. I recently coded a Minecraft Voting for Diamonds script. Basically, you enter your username, you vote on the sites, then click "Get Reward". The reward then goes through a RCON script, and rewards the user with their diamonds in-game. the full script works fine, and I am happy with it, but there is one small problem; and that is users being able to abuse the system. If they wanted to, they could just refresh the page, and click Get Rewarded again, and again. I want to make something like this: It has a countdown on the link, which is started upon click, and then the link re-activates when the timer is done. My script already has "disabled=..." tags, so you have to click all links, this way would make sure a user cannot click the link until the timer is done. I'm pretty new to PHP, and please forgive me if it is not 100% PHP, but this place seemed extremely helpful. I am also pretty new to PHP, so make it for dummies xD Thanks everyone!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.