help in a php code
$2-8 USD / hour
Hi
I'm not good in php I need someone to help me in an auth file,
I've a link protected with a header("HTTP/1.0 200 OK") [url removed, login to view] I'm using:
===================================
$get = print_r($_GET, true);
$token = $_GET["token"];
if(!$token || !strlen($token)) {
header('HTTP/1.0 403 Forbidden');
error_log("No token provided", 4);
die();
}
$tokens = array();
$contents = explode("\n", file_get_contents("[url removed, login to view]"));
foreach($contents as $line) {
if(strlen($line) > 3) {
$parts = explode(":", $line);
$tokens[$parts[1]] = $parts[0];
}
}
if($tokens[$token]) {
header("HTTP/1.0 200 OK");
header("X-UserId: ".$tokens[$token]."\r\n");
header("X-Unique: true\r\n"); // Turn this on to protect from multiscreen
} else {
header('HTTP/1.0 403 Forbidden');
}
===================================
and [url removed, login to view]:
==================================
user1:fKg5sw0Dhy
==================================
the problem is my token fKg5sw0Dhy is visible, so I want to edit my php file to hide my token with a combination of md5, expiration after xx seconds and user ip. something like:
=========================
date_default_timezone_set('UTC');
$ip = $_SERVER['REMOTE_ADDR'] = isset($_SERVER["HTTP_CF_CONNECTING_IP"]) ? $_SERVER["HTTP_CF_CONNECTING_IP"] : $_SERVER["REMOTE_ADDR"];;
$mysecretkey = "fKg5sw0Dhy";
$expiry = strtotime("+50 seconds");
$b64 = base64_encode(md5($mysecretkey.$expiry.$ip,true));
$b64u = rtrim(str_replace(array('+','/'),array('-','_'),$b64),'=');
echo "[url removed, login to view]$b64u\n";
=========================
it's a 5min's task for any php coder, I'll consider the lower bid
Project ID: #7385193
About the project
Awarded to:
7 freelancers are bidding on average $8/hour for this job
========Please Don't award this project to us without discussing this project in detail============ Hi, I (Myself a senior PHP, ASP.NET programmer using C# and VB) have a team having experience of more than 10 years i More
Since I have worked possible solution for keeping it up Puedo brindar la solución del problema tengo experiencia con php sobre todo orientado al servidor El tiempo que oferto lo puedo cumplir perfectamente . salud More
I can help you now with what you need. start a chat with me and i will do it as soon as you like me to start..