MMaking a button that adds coins.

hacktheplanet

New Member
Messages
12
Reaction score
0
Points
0
Ok first open your php welcome file. find were you want to put the link.
add this were you want the link filling in the game address
<a href='www.yougameaddress'/coins.php>Get extra Coins</a>
You can name the file anything just rename the coins part.
You can also change text be changing Get extra Coins.

Now to make the coins.php

Make a new file called what ever you have in the link with the .php at the end
in side it add this.

Code:
<?php
print "<h3>You got 100 Free Rings</h3>";
if($db->query('users ringincrease=1'))
{
{ die("<h1>You have already Collected your 100 coins.</h1>"); }
}
$db->query("UPDATE users SET rings=rings+100, ringincrease=ringincrease+1 WHERE userid=$userid");
print "<a href='home.php'>Home</a>";
$h->endpage();
?>
 
Last edited:

Conmiro

New Member
Messages
140
Reaction score
0
Points
0
Username: conmiro
You got 100 Free Rings

Fatal error: Call to a member function query() on a non-object in /home/conmiro/public_html/rpg/welcome.php on line 10
Edit:
Thanks, it works prettywell i think otherwise, excep when i refrehs it keeps giving me 100 rings.
 
Last edited:

hacktheplanet

New Member
Messages
12
Reaction score
0
Points
0
ya the error means it didn't fins the database. i'm going to fix that
Edit:
oh and if you can post your entire welcome.php so i know exactly what it looks like and so i can fix the code for that file
 
Last edited:
Top