Register for your free account! | Forgot your password?

You last visited: Today at 13:25

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


[HELP] Coins Page

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

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 09/21/2012, 21:19   #2 Trade Status: Unverified(?)
 
elite*gold: 0
Join Date: May 2009
Posts: 222
Received Thanks: 1,547
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
 
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 09/22/2012, 21:00   #4 Trade Status: Unverified(?)
Absent - please ask someone else
 
elite*gold: 46850
Join Date: Jun 2009
Posts: 28,820
Received Thanks: 25,091
Arrow General Coding -> Coders Trading

#moved


MrSm!th is offline  
Old 09/26/2012, 20:26   #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 09/27/2012, 13:29   #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



« [S] Webentwickler | Fifa 13 Ultimate Team Coder »

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/406240_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 +1. The time now is 13:25.


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

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