Jump to content

Recommended Posts

it does,im trying to make a point system for my forum members,and protecting other people from stealing their points with "$_SERVER['HTTP_REFERER'];".

 

the code you gave me wont work,maybe you will be able to figure out whats wrong with it from my full code =\

 

heres my full code,

<body bgcolor="#ababab">

<meta http-equiv="REFRESH" content="3;url=http://mysite.co.cc/points">

<?php

$idnumber = $_GET["id"];
$idfile = "http://mysite.co.cc/points/id/".$idnumber.".txt";

$points = file_get_contents($idfile);

$reftrue = "";

$ref = $_SERVER['HTTP_REFERER'];

if ( $ref == "url" || $ref == "other url" ) {
$reftrue = "yes";
}else{
$reftrue = "no";
}

if ( $reftrue == "yes" ) {
?>
<title>Congrats!</title>
<?php
echo "You Have Been Awarded 1 Point.";
file_put_contents($points + 1, $idfile);
}

if ( $reftrue == "no" ) {
echo "Trying To Cheat,Eh?Well Dont Think About It!";
?>
<title>Cheat Alert!</title>
<?php
}

?>

Link to comment
https://forums.phpfreaks.com/topic/244761-file-help/#findComment-1257308
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.