Register for your free account! | Forgot your password?

You last visited: Today at 16:19

  • Please register to post and access all features, it's quick, easy and FREE!

 

[HELP] Coins Page

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2010
Posts: 414
Received Thanks: 95
[HELP] Coins Page

If user come from:
Quote:
Page add:
$sql = mysql_query("UPDATE account.account SET coins = coins + 50 WHERE id='".$_SESSION['user_id']."'")

Coins in database.

If user comes from another page, page give error:
Error, you don't pay for that.

I need that in php.

Someone can help me?

Thank you.



KillHumans is offline  
Old   #2 Trade Status: Unverified(?)
 
elite*gold: 0
Join Date: May 2009
Posts: 222
Received Thanks: 1,545
I don't like php, so I dont want to answer to the mainquestion,..
nevertheless I'll say.... be careful with that query.

Injection inc!




Maybe this could help you.


fortiZ1337 is offline  
Thanks
1 User
Old   #3
 
elite*gold: 0
Join Date: Jan 2010
Posts: 414
Received Thanks: 95
First i need the code, after my teacher protect the file!

Thank you for your reply.
KillHumans is offline  
Old   #4 Trade Status: Unverified(?)
failing on a final level
 
elite*gold: 46330
Join Date: Jun 2009
Posts: 28,780
Received Thanks: 25,038
Arrow General Coding -> Coders Trading

#moved


MrSm!th is offline  
Old   #5 Trade Status: Unverified(?)
 
elite*gold: 20
Join Date: Jan 2009
Posts: 304
Received Thanks: 55
You have to check the site from wich your user is came from.
This site you can get with the JavaScript "refferer". It exist a mothod in php like this but i can released only in javascript.

Code:
<script type="text/javascript">
var lastpage = document.referrer;
<script type="text/javascript">
Afterwards you have to check "was the last page like yours?"
You have to take "if and else" to check this.

PHP Code:
<script type="text/javascript">
var lastpage = document.referrer;

if (lastpage == "yourSiteAsAString") {
<?php
mysql_query
("UPDATE account.account SET `coins` = `coins` + 50 WHERE `id`='".mysql_real_escape_string($_SESSION['user_id'])."'") or die (mysql_error());
?>
var result = "you earned coins";
}
else {
var result = "access denied";
}
<script type="text/javascript">
With document.refferer you'll get the last page in most of the cases.
But sometimes you get an empty string.
RecK is offline  
Old   #6 Trade Status: Unverified(?)

 
elite*gold: 1329
Join Date: Jun 2009
Posts: 1,873
Received Thanks: 960
Quote:
Originally Posted by RecK View Post
You have to check the site from wich your user is came from.
This site you can get with the JavaScript "refferer". It exist a mothod in php like this but i can released only in javascript.

Code:
<script type="text/javascript">
var lastpage = document.referrer;
<script type="text/javascript">
Afterwards you have to check "was the last page like yours?"
You have to take "if and else" to check this.

PHP Code:
<script type="text/javascript">
var lastpage = document.referrer;

if (lastpage == "yourSiteAsAString") {
<?php
mysql_query
("UPDATE account.account SET `coins` = `coins` + 50 WHERE `id`='".mysql_real_escape_string($_SESSION['user_id'])."'") or die (mysql_error());
?>
var result = "you earned coins";
}
else {
var result = "access denied";
}
<script type="text/javascript">
With document.refferer you'll get the last page in most of the cases.
But sometimes you get an empty string.
Are you serious???
You mix server side and client side scripting here! With your script, this query will be executed no matter what page the user came from!
What you have to do is this whole thing in PHP!

PHP Code:
if($_SERVER['HTTP_REFERER'] == "yoursiteasstring")
{
  
mysql_query("UPDATE account.account SET `coins` = `coins` + 50 WHERE `id`='".mysql_real_escape_string($_SESSION['user_id'])."'") or die (mysql_error()); 
  echo 
'U got coins!';
}
else
  echo 
'Y U NO come from my fav site?'
Don't forget to initialize the mysql connection with mysql_connect()!


マルコ is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
YouLikeHits.com Coins ! Coins für deinen ACCOUNT! | Einfach|Schnell|Billig || by Ariz
http://i.epvpimg.com/grd2b.jpg Hey, hier könnt ihr YouLikeHits - Coins für euren Account holen. Für die, die nicht wissen, was YLH...
1 Replies - elite*gold Trading
Selling coins on Perfect World Raging Tides Server 50 cents per 1million coins
Selling all my coins on Raging Tides Rate is 50 cent for every one million coin in game. Leave me a message if interested.
0 Replies - Perfect World Trading
[S] Fifa 12 Ultimate Team Coins (PC) [B] 10€Paypal/100k Coins
Sers, Titel sagt wohl alles, zahle 10€ Paypal für 100k Coins. Brauche nur Coins für die PC Version. Suche mehr als 3 Millionen Coins.
0 Replies - Fifa Trading
Ninja Saga - Coins, Tokens & Ginger Bread Coins [Bug]
http://photos-h.ak.fbcdn.net/hphotos-ak-snc7/406240_2603160515917_1161974319_32275797_77418679_a.jpg Credits To : HaxorActivityTeam (HATE) // YSN...
1 Replies - Facebook



All times are GMT +2. The time now is 16:19.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.