Friday, December 21, 2007

YOU CAN DO BUSINESS FROM YOUR HOME

require_once('settings.php');/* Check user input */$name=pj_input($_POST['name'],'Please enter your name!');$email=pj_input($_POST['email'],'Please enter your e-mail address!');if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$email)) { problem('Please enter a valid e-mail address!');}$title=pj_input($_POST['title'],'Please enter the title (name) of your website!');$url=pj_input($_POST['url'],'Please enter the URL of your website!');if (!(preg_match("/(http:\/\/+[\w\-]+\.[\w\-]+)/i",$url))) { problem('Please enter valid URL of your website!');}$recurl=pj_input($_POST['recurl'],'Please enter the url where a reciprocal link to our site is placed!');if (!(preg_match("/(http:\/\/+[\w\-]+\.[\w\-]+)/i",$recurl))) { problem('Please enter valid URL of the page where the reciprocal link to our site is placed!');}
/* Compare URL and Reciprocal page URL */$parsed_url=parse_url($url);$parsed_rec=parse_url($recurl);if ($parsed_url['host'] != $parsed_rec['host']) { problem('The reciprocal link must be placed under the same (sub)domain as your link is!');}
$url=str_replace('&','&',$url);$recurl=str_replace('&','&',$recurl);
$description=pj_input($_POST['description'],'Please write a short description of your website!');if (strlen($description)>200) { problem('Description is too long! Description of your website is limited to 200 chars!');}
if ($settings['autosubmit']) { session_start();
if (empty($_SESSION['checked'])) { $_SESSION['checked']='N'; $_SESSION['secnum']=rand(10000,99999); $_SESSION['checksum']=$_SESSION['secnum'].$settings['filter_sum'].date('dmy'); } if ($_SESSION['checked'] == 'N') { print_secimg(); } elseif ($_SESSION['checked'] == $settings['filter_sum']) { $_SESSION['checked'] = 'N'; $secnumber=pj_isNumber($_POST['secnumber']); if(empty($secnumber)) { print_secimg(1); } if (!check_secnum($secnumber,$_SESSION['checksum'])) { print_secimg(2); } } else { problem('Internal script error. Wrong session parameters!'); }}
$html = @file_get_contents($recurl) or problem('Can\'t open remote URL!');$html = strtolower($html);$site_url =strtolower($settings['site_url']);
if (!strstr($html,$site_url)) { problem('Our URL ('.$settings['site_url']. ') wasn\'t found on your reciprocal links page ('.$recurl.')!

Please make sure you place this exact URL on your page before adding your link!' );}
$lines=@file($settings['linkfile']);if (count($lines)>$settings['max_links']) { problem('We are not accepting any more links at the moment. We appologize for the inconvenience!');}
$replacement = "$name$settings[delimiter]$email$settings[delimiter]$title$settings[delimiter]$url$settings[delimiter]$recurl$settings[delimiter]$description\n";
if ($settings['add_to'] == 0) { $fp = fopen($settings['linkfile'],'rb'); $links = @fread($fp,filesize($settings['linkfile'])); fclose($fp);
$replacement .= $links;
$fp = fopen($settings['linkfile'],'wb') or problem('Couldn\'t open links file for writing! Please CHMOD all txt files to 666 (rw-rw-rw)!'); fputs($fp,$replacement); fclose($fp); }else { $fp = fopen($settings['linkfile'],'ab') or problem('Couldn\'t open links file for appending! Please CHMOD all txt files to 666 (rw-rw-rw)!'); fputs($fp,$replacement); fclose($fp); }
if($settings['notify'] == 1) {$message="Hello,
Someone just added a new link to your links page on $settings[site_url]
Link details:
Name: $nameE-mail: $emailURL: $urlReciprocal link: $recurlTitle: $titleDescription:$description
End of message
";$headers = "From: $name <$email>\n";$headers .= "Reply-To: $name <$email>\n";mail($settings['admin_email'],'New link submitted',$message,$headers);}
require_once('header.txt');?>

Your link has been added!

Thank you, your link has been successfully added to our link exchange (try reloading our links page if you don't see your link there yet)!

">Back to the main page

function problem($problem) {require_once('header.txt');echo '

ERROR

'.$problem.'

Back to the previous page

';require_once('footer.txt');exit();}
function print_secimg($message=0) {global $settings;$_SESSION['checked']=$settings['filter_sum'];require_once('header.txt');?>


Anti-SPAM check


" name="form" method="POST">Please type in the security number

';}elseif ($message == 2) {echo '

Wrong security number. Please try again

';}?>

This is a security check that prevents automated signups of this forum (SPAM).Please enter the security number displayed below into the input field and clickthe continue button.

Security number:
Please type in the security number displayed above:

$v) { if ($k == 'secnumber') {continue;} echo '';}?>


Powered by PHP Link manager from PHPjunkyard - Free PHP scripts



function check_secnum($secnumber,$checksum) {global $settings;$secnumber.=$settings['filter_sum'].date('dmy'); if ($secnumber == $checksum) { unset($_SESSION['checked']); return true; } else { return false; }}
?>