#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    4
    Rep Power
    0

    Need massive help


    So basically I'm making an RSPS and I'm making a vote system for it, what it does is they will go to my webpage, and vote for my server on 3 different websites, these 3 websites all do this "incentive postback" but i dont know how to get it to work.

    rune-servers postback:
    Code:
    Solution 2(Incentive postback):  
    You specify postback url in TopList.  
    When linking your player to vote, 
    you include 'incentive' variable with id or hash.    
    
    Code: http://www.rune-server.org/toplist.php?do=vote&sid=yourserverid&incentive=idorhash 
    You will receive HTTP GET request when player votes.    
    
    Code: http://www.yoursite.com/vote.php?postback=idorhash
    Runelocus callback:
    .txt explaining the 2 files
    Code:
    - form.html Contains a form you can place on your website. 
    Your users will fill in their username and go to your voting page. 
    Make sure to replace "YOURSERVERID" with your own unique server ID. 
    You can find this ID (number) in the link of your server.  
    
    - process.php This is a simple example on how to process a vote. 
    RuneLocus will send a $_GET signal (?=usr=THEUSERNAME) to the page provided.
    Put this file online and submit the URL in the panel.
    form.html
    PHP Code:
    <html
    <
    head
    <
    title>Vote for my server</title
    </
    head>
     <
    body>  
    <
    form action="http://www.runelocus.com/toplist/index.php" method="get">
    <
    input type="hidden" name="action" value="vote" />
    <
    input type="hidden" name="id" value="YOURSERVERID" />     
    Username: <input type="text" name="id2" placeholder="username" />     
    <
    input type="submit" value="Vote for us" />  
    </
    form>  
    </
    body
    </
    html
    process.php
    PHP Code:
    <?php      
    $con 
    mysql_connect("localhost","DATABASE_USERNAME","DATABASE_PASSWORD");     
    if (!
    $con) {         
    die(
    "Could not connect to database: " mysql_error());    
     }      
    mysql_select_db("DATABASE_NAME"$con);      
    $username mysql_escape_string($_GET['usr']);      
    if (isset(
    $_GET['usr'])) {         
    mysql_query("UPDATE players SET tokens = tokens + 10 WHERE username = '$username'");         
    // Above is an example, would add 10 vote tokens to the user.     
    }          
    mysql_close($con);      
    ?>
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    4
    Rep Power
    0
    need help guys
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,343
    Rep Power
    594
    1) Please enclose your code in [ PHP ] tags. See the sticky at the top of this forum that says READ THIS BEFORE POSTING.

    2) DO NOT use the deprecated mysql extensions. Switch to PDO and use prepared statements. You code is wide open to injection.

    3) What exactly is not working? You do not provide enough detail about what error you are getting or what it is doing that is different from what you expect. Read ManiacDan's New User Guide for debugging techniques and how to post a good question.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    4
    Rep Power
    0
    Originally Posted by gw1500se
    1) Please enclose your code in [ PHP ] tags. See the sticky at the top of this forum that says READ THIS BEFORE POSTING.

    2) DO NOT use the deprecated mysql extensions. Switch to PDO and use prepared statements. You code is wide open to injection.

    3) What exactly is not working? You do not provide enough detail about what error you are getting or what it is doing that is different from what you expect. Read ManiacDan's for debugging techniques and how to post a good question.
    this isnt my code. im asking for someone to explain all of to me, basically what i have to do is send someone from my website to one of those 2 to vote for my server, once they have voted it will send a signal to the url i put down, now these votes happen within a minute of eachother, so it needs to be able to update in the php file and once both websites have been voted on it will allow the user to get the items on my server which means once both votes have been done it needs to upload to mysql database but that i can do, i just need to know how to do the middle bit

    1. send person to "rune-server" or "runelocus" to vote for my server
    2. make it so the php file receives the signal from both sites then updates a mysql database

    now the things it needs to update into the database is the persons username, ip and when they voted so i can add a 12 hour check
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,343
    Rep Power
    594
    It seems to me it is pretty well explained in what you posted. As for it not being your code, it doesn't matter. You should not be using bad code regardless of its source.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    4
    Rep Power
    0
    Originally Posted by gw1500se
    It seems to me it is pretty well explained in what you posted. As for it not being your code, it doesn't matter. You should not be using bad code regardless of its source.
    yes but as ive been saying, i dont know how to do what i just said, i know how to send the person to the correct place thats it.

    1. send player to "runelocus" or "rune-server".
    2. they vote
    3. it grabs the appropriate information for the url Example. username and ip
    4. send signal back to my website with the ip and username
    5. puts everything into the mysql database
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,343
    Rep Power
    594
    As it says you put your url in the form (form.html) where indicated.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.

IMN logo majestic logo threadwatch logo seochat tools logo