display->loadSkin( "contact" );
class information extends binBase
{
var $rememberme = " checked=\"checked\"";
var $remember = 1;
var $name = "";
var $email = "";
var $text = "";
var $req = "";
var $reqstop = false;
function information()
{
global $bin;
$this->construct();
if ( $bin->sess->eatCookie('_rememberforms') )
{
$cookie = '_forms';
if ( $bin->sess->eatCookie($cookie.'_rememberme') == '0' )
{
$this->remember = "";
$this->rememberme = 0;
}
$this->name = $bin->sess->eatCookie($cookie.'_name');
$this->email = $bin->sess->eatCookie($cookie.'_email');
}
if ( isset( $bin->URL[1]) && $bin->URL[1] == "checkemail" )
{
define( "SUPPRESS", true );
if ( empty( $bin->URL[2] ) )
echo "You must provide an email address.
";
elseif ( !$bin->func->validEmail( $bin->URL[2] ) )
echo "The email address you provided is invalid.
";
exit();
}
if ( isset($bin->POST['form']) && $bin->POST['form'] == "contactemail" )
{
$this->rememberme = "";
if ( $bin->POST['rememberme'] == '1' )
{
$this->remember = 1;
$this->rememberme = " checked=\"checked\"";
}
$this->name = $bin->POST['name'];
$this->email = $bin->POST['email'];
$this->text = $bin->POST['text'];
$this->req->validemail = "";
$required = " style=\"color: maroon;font-weight: bold;\"";
$this->req->name = "";
$this->req->email = "";
$this->req->text = "";
if ( $this->name == "" )
{
$this->req->name = $required;
$this->reqstop = true;
}
if ( $this->email == "" )
{
$this->req->email = $required;
$this->reqstop = true;
}
if ( $this->text == "" )
{
$this->req->text = $required;
$this->reqstop = true;
}
if ( $this->reqstop == false )
{
if ( !$bin->func->validEmail( $this->email ) )
{
$this->reqstop = true;
$this->req->validemail = "Invalid Email Address
\n";
}
if ( $this->reqstop == false )
{
if ( $this->remember == '1' )
{
$expire = 60*60*24*60;
$bin->sess->bakeCookie( true, "_rememberforms", $expire );
$bin->sess->bakeCookie( $this->name, "_forms_name", $expire );
$bin->sess->bakeCookie( $this->email, "_forms_email", $expire );
$bin->sess->bakeCookie( $this->remember, "_forms_rememberme", $expire );
}
else
{
$bin->sess->burnCookie( "_rememberforms" );
$bin->sess->burnCookie( "_forms_name" );
$bin->sess->burnCookie( "_forms_email" );
$bin->sess->burnCookie( "_forms_rememberme" );
}
//if ( $bin->func->sendEmail( "alex.honeywell@gmail.com", "SGS.net", $this->text, $this->email ) )
// header("Location: ". $bin->func->formatURL( "information", "thanks" ) );
//else
header("Location: ". $bin->func->formatURL( "information", "error" ) );
}
}
}
$bin->display->title = "Contact";
if ( isset($bin->URL[1]) && $bin->URL[1] == "thanks" )
$this->output .= $bin->skin->contact->thanks();
else
{
$this->output .= $bin->skin->contact->page($this);
}
}
}
?>