// set _GET and _POST _SESSION for old PHP variables: if (!isset($_GET)) { $_GET = &$HTTP_GET_VARS; } if (!isset($_POST)) { $_POST = &$HTTP_POST_VARS; } if (!isset($_SESSION)) { $_SESSION = &$HTTP_SESSION_VARS; } if (!isset($_SERVER)) { $_SERVER = &$HTTP_SERVER_VARS; } if ( !isset($_ENV)) { $_ENV = &$HTTP_ENV_VARS; } if ( !isset($_COOKIE)) { $_COOKIE = &$HTTP_COOKIE_VARS; } if ( !isset($_FILES)) { $_FILES = &$HTTP_POST_FILES; } if ( !isset($_REQUEST)) { $_REQUEST = &$_GET&$_POST&$_COOKIE&$_FILES; } // Now pretend the register globals is on if (isset($_GET)) { while (list ($key, $value) = each ($_GET)) { $$key = $value; } } if (isset($_POST)) { while (list ($key, $value) = each ($_POST)) { $$key = $value; } } if (isset($_SESSION)) { while (list ($key, $value) = each ($_SESSION)) { $$key = $value; echo $value; } } if (isset($_SERVER)) { while (list ($key, $value) = each ($_SERVER)) { $$key = $value; } } if (isset($_ENV)) { while (list ($key, $value) = each ($_ENV)) { $$key = $value; } } if (isset($_COOKIE)) { while (list ($key, $value) = each ($_COOKIE)) { $$key = $value; } } if (isset($_FILES)) { while (list ($key, $value) = each ($_FILES)) { $$key = $value; } } if (isset($_REQUEST)) { while (list ($key, $value) = each ($_REQUEST)) { $$key = $value; } } function checkform($value,$error="",$value2=""){ if($value2!=""){ $value2=" / $value2"; } if($error!=""){ echo"$value$value2"; } else { echo$value.$value2." *"; } } function PostToHost($host, $path, $data) { $result = ""; // Open socket connection to HTTP server $fp = fsockopen($host,80,$errno,$errstr,$timeout = 30); if (!$fp) { // If error report it echo "$errstr ($errno)\n"; } else { fputs($fp, "POST $path HTTP/1.1\r\n"); fputs($fp, "Host: $host\r\n"); fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n"); fputs($fp, "Content-length: ".strlen($data)."\r\n"); fputs($fp, "Connection: close\r\n\r\n"); fputs($fp, $data . "\r\n\r\n"); while(!feof($fp)) { $var = fgets($fp, 4096); $result = $result.$var; } fclose($fp); return $result; } } if($submit_data==true){ $geburtsdatum=$GBT.".".$GBM.".".$GBJ; if($handynummer==""){ $fullhandynummer="kein handy"; }else{ $fullhandynummer="+49".$handyvorwahl.$handynummer; } $i=0; if($handynummer!=""){ if (!is_numeric($handynummer)){ $handynummer_error="Handynummer:"; $handynummers_error="Die Handynummer darf nur Zahlen beinhalten!"; ++$i; } } if (($email == "")and($handynummer == "")){ $email_error="Email:"; $handynummer_error="Handynummer:"; $handynummers_error="Bitte Email Adresse oder Handynummer angeben!"; ++$i; } if ($email!=""){ if (ereg(".", $email) == 0){ $email_error="Email:"; $emails_error="Email:"; ++$i; } else { if (ereg("\@", $email) == 0){ $email_error="Email:"; $emails_error="Email muß ein @ beinhalten!"; ++$i; } else { if (ereg("\@.*.\.", $email) == 0){ $email_error="Email:"; $emails_error="Die Emailadresse enthält keinen gültigen Domainnamen!"; ++$i; } } } } // Checken ob die Email schon im System ist include("../config/config.php"); $nConnection = mysql_connect($database_host, $database_user, $database_password); global $database_name,$nConnection,$sTable; $cmd="select * from phplist_user_user WHERE email = '$email'"; $res=mysql_db_query($database_name,$cmd,$nConnection); $row=mysql_fetch_array($res); if($row["email"]!=""){ // Email schon drin $email_error="Email:"; $emails_error="Du bist bereits bei uns registriert!"; ++$i; } //Error --> Meldung if($i!=0){ $error_msg=""; }else{ if($email==""){ $email=$fullhandynummer." Nur Sms"; $noemail=true; } $save=true; $formdata = array ( "email" => "$email", "makeconfirmed" => 1, "attribute4" => "$vorname", "attribute3" => "$name", "attribute5" => "$strasse", "attribute6" => "$plz", "attribute7" => "$ort", "attribute8" => "$fullhandynummer", "attribute9" => "$geburtsdatum", "attribute10" => "$attribute10", "htmlemail" => 1, "noemail" => "$noemail" ); //Build the post string foreach($formdata AS $key => $val) { $data .= urlencode($key) . "=" . urlencode($val) . "&"; } // buttonname is text name you set in your Subscribe Page configuration. $buttonname="Anmelden"; // The number 2 in this is the list # found in the admin section under "lists". $data .= "list[50]=signup&listname[50]=Garden Newsletter&subscribe=$buttonname"; $return = PostToHost("event-mailer.de","/?p=subscribe&id=2", "$data"); //echo $return; //echo $data; } } ?>
Vielen Dank für Deine Eingabe. Deine Daten wurden erfolgreich gespeichert! |