Jump to content

File Help


SC__Programmer

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.