Find Jobs
Hire Freelancers

Convert a short function from php to Perl

$30-100 USD

Cancelled
Posted over 19 years ago

$30-100 USD

Paid on delivery
Simple job for someone who knows Perl/CGI and has some familiarity with php. Convert the short function below from php to Perl/CGI. The function will be embedded into an existing Perl script to provide a very basic way of locking it to a specific domain by requiring a security code to be supplied in the script config file. Existing php function ... function CheckSecCode ($securitycode) { $domain = $_SERVER['SERVER_NAME']; $domain = strtolower ($domain); if (substr ($domain, 0, 4) == "www.") $domain = substr ($domain, 4); $length = strlen ($domain); if ($length > 16) $length = 16; $codeddomain = ""; $lastval = 65; for ($c = 0; $c < $length; $c++) { $chval = ord($domain[$c]) * 10) % 1000; $codeddomain .= chr (($chval / 26) + 65); $codeddomain .= chr (($chval % 26) + 65); } if ($securitycode != $codeddomain) { die ("<BR><BR><BR>Security code $securitycode is not correct for domain $domain"); } } Overview: The function gets the domain name of the server it is running on, chops off the "www." if present then creates a simple security code from the characters of the domain name by taking the ord() of each one and doing a very simple mathematical mapping. This creates a code string for the domain name. If this generated string does not match the one passed to the function, the script dies with a simple message. ## Deliverables The required delivery is an equivalent in Perl which can be embedded into a Perl script - and when called, will exit the script if the security code passed to it is wrong. All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement). ## Platform Perl/CGI on Unix and Linux
Project ID: 3283081

About the project

Remote project
Active 13 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs

About the client

Flag of UNITED KINGDOM
Reading, United Kingdom
0.0
0
Member since Jul 13, 2004

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759) & Freelancer Online India Private Limited (CIN U93000HR2011FTC043854)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.