Register for your free account! | Forgot your password?

You last visited: Today at 12:33

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

Advertisement



[HELP] Coins Page

Discussion on [HELP] Coins Page within the Coders Trading forum part of the Other Trading category.

Reply
 
Old   #1
 
KillHumans's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 416
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 09/21/2012, 21:19   #2 Trade Status: Unverified(?)
 
fortiZ1337's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 222
Received Thanks: 1,590
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 09/21/2012, 21:24   #3
 
KillHumans's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 416
Received Thanks: 95
First i need the code, after my teacher protect the file!

Thank you for your reply.
KillHumans is offline  
Old 09/22/2012, 21:00   #4 Trade Status: Unverified(?)


 
MrSm!th's Avatar
 
elite*gold: 7110
Join Date: Jun 2009
Posts: 28,904
Received Thanks: 25,394
Arrow General Coding -> Coders Trading

#moved
MrSm!th is offline  
Old 09/26/2012, 20:26   #5 Trade Status: Unverified(?)
 
RecK's Avatar
 
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 09/27/2012, 13:29   #6 Trade Status: Unverified(?)

 
マルコ's Avatar
 
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


Similar Threads Similar Threads
YouLikeHits.com Coins ! Coins für deinen ACCOUNT! | Einfach|Schnell|Billig || by Ariz
05/22/2013 - elite*gold Trading - 1 Replies
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 (YouLikeHits) ist: Bei YouLikeHits kann ganz leicht Likes, Abbos, Follower... für seine Facebook - Page, seinen Youtube Account, seinen Twitter Account usw. bekommen. Nachdem ihr diesen Service in anspruch genommen habt, könnt ihr sofort starten, und ohne irgendwas zu machen. Das einzige was ihr für diesen Service braucht, ist ein Account, den ihr jedoch...
Selling coins on Perfect World Raging Tides Server 50 cents per 1million coins
06/17/2012 - Perfect World Trading - 0 Replies
Selling all my coins on Raging Tides Rate is 50 cent for every one million coin in game. Leave me a message if interested.
[S] Fifa 12 Ultimate Team Coins (PC) [B] 10€Paypal/100k Coins
04/25/2012 - Fifa Trading - 0 Replies
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.
Ninja Saga - Coins, Tokens & Ginger Bread Coins [Bug]
01/07/2012 - Facebook - 1 Replies
http://photos-h.ak.fbcdn.net/hphotos-ak-snc7/40624 0_2603160515917_1161974319_32275797_77418679_a.jpg Credits To : HaxorActivityTeam (HATE) // YSN (Yudhia) Video Tutorial By : HaxorActivityTeam (HATE) // Vreaks Disclaimer : Implement following steps at your own risk. =========================================== Guide for Bug :



All times are GMT +2. The time now is 12:33.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.