function protectMail($s){
$result='';
$s='mailto:'.$s;
for($i=0; $i < strlen($s);$i++){
$result .= ''.ord(substr($s, $i, 1)). ';';
}
return $result;
}
function checkMail($s){
$lastDot =strrpos($s, '.');
$ampersat = strrpos($s, '@');
$length = strlen($s);
if(
$lastDot === false ||
$ampersat === false ||
$length === false ||
$lastDot - $ampersat < 3 ||
$length - $lastDot < 3
){
return true;
}
else return false;
}
function error_404(){
header("HTTP/1.1 404 Not Found");
$out =<<
HTTP/1.0
Error 404
Object Not Found
HTML;
echo $out;
exit(0);
}
function page_numbering($control){
$count = "Select COUNT(*) as number from s4s where stat = 1";
$number = 0;
$resault=mysql_query($count);
if($record = mysql_fetch_object($resault)){
$number = $record->number;
}
else {
return $s="No sites for sale at this moment
";
}
$i=0;
$min=0;
$step=1;
$s ="";
if ($number != 0){
while( $i <= $number ){
if(($i+10) <= $number){
$s .= ''.$step.' ';
$i =$i+10;
$step++;
}
else if(($i+10) > $number){
$s .= ''.$step.
' ';
$i=$i+10;
}
else $s.= "Error";
}
$s .= "
";
return $s;
}
}
function smail2($smtp_to_addr, $smtp_to_name, $smtp_from_addr, $smtp_from_name,
$smtp_subject, $m_body_plain, $m_body_html) {
$smtp_port=25;
$smtp_timeout=20;
$smtp_host="localhost";
$smtp_helo=getenv("HTTP_HOST");
$smtp_reply=$smtp_from_addr;
$m_body_plain=str_replace("\n", "\r\n", $m_body_plain);
$m_body_html =str_replace("\n", "\r\n", $m_body_html);
$fp = fsockopen ($smtp_host, $smtp_port, $errno, $errstr, $smtp_timeout);
if ($fp) {
$s=fgets($fp, 256);
if (!strstr($s, "220")) { syslog(LOG_ERR, "SMTP error: $s"); return(1); }
fputs ($fp, "helo ".$smtp_helo."\r\n");
$s=fgets($fp, 256);
if (!strstr($s, "250")) { syslog(LOG_ERR, "SMTP error: $s"); return(1); }
fputs ($fp, "mail from:".$smtp_from_addr."\r\n");
$s=fgets($fp, 256);
if (!strstr($s, "250")) { syslog(LOG_ERR, "SMTP error: $s"); return(1); }
fputs ($fp, "rcpt to:".$smtp_to_addr."\r\n");
$s=fgets($fp, 256);
if (!strstr($s, "250")) { syslog(LOG_ERR, "SMTP error: $s"); return(1); }
fputs ($fp, "data\r\n");
$s=fgets($fp, 256);
if (!strstr($s, "354")) { syslog(LOG_ERR, "SMTP error: $s"); return(1); }
fputs ($fp, "To: ".$smtp_to_name." <".$smtp_to_addr.">\r\n".
"From: ".$smtp_from_name." <".$smtp_from_addr.">\r\n".
"Reply-To: ".$smtp_reply."\r\n".
"MIME-Version: 1.0\r\n".
"Content-Type: multipart/alternative;\r\n".
"\tboundary=\"----=_UH_ijn_098765\"\r\n".
"Subject: $smtp_subject\r\n\r\n".
"This is a multi-part message in MIME format.\r\n\r\n".
"------=_UH_ijn_098765\r\n".
"Content-Type: text/plain\r\n\r\n".
$m_body_plain."\r\n".
"------=_UH_ijn_098765\r\n".
"Content-Type: text/html\r\n\r\n".
$m_body_html."\r\n\r\n".
"------=_UH_ijn_098765--\r\n\r\n".
".\r\n");
$s=fgets($fp, 256);
if (!strstr($s, "250")) {
syslog(LOG_ERR, "SMTP error: $s"); return(1);
}
else {
fputs ($fp, "quit\r\n");
}
fclose ($fp);
}
else {
syslog(LOG_ERR, "$errstr ($errno)");
}
return(0);
}
function base_me($qu){
mysql_query($qu);
}
function thank_you($form, $email, $fname, $lname, $from_mail, $site){
switch($form){
case 'get_appraisal':
$text_p="
Thank you for your submission.
Our panel of experts will be assessing your website and will email your
valuation within 48 hours.
Regards,
SiteAppraisalGuide.com
";
$text_c="
Thank you for your submission.
Our panel of experts will be assessing your website and will email your
valuation within 48 hours.
Regards,
SiteAppraisalGuide.com
";
break;
case 'sell_site':
$text_p="
Thank you for your website submission.
Your website will be reviewed and should appear in our listings within 48 hours.
Regards,
SiteAppraisalGuide.com
";
$text_c="
Thank you for your website submission.
Your website will be reviewed and should appear in our listings within 48
hours.
Regards,
SiteAppraisalGuide.com
";
break;
case 'contact_seller':
$text_p="
Thank you for your interest in $site. Your message has been
forwarded to the owner of the site you are inquiring about, who will contact you
directly.
Regards,
SiteAppraisalGuide.com
";
$text_c="
Thank you for your interest in $site.
Your message has been forwarded to the owner of the site
you are inquiring about, who will contact you directly.
Regards,
SiteAppraisalGuide.com
";
break;
}
//smail2($email, $fname." ".$lname,$from_mail,"www.siteappraisalguide.com", "Thank you for choosing us",$text_p,$text_c);
smail_plain($email, $fname." ".$lname, $from_mail, "Site Apprisal Guide", $from_mail, "Thank you for choosing us", $text_p);
}
?>