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){ $i=0; if ($email == ""){ $email_error="Email:"; $error_msg="Bitte Email Adresse angeben!"; ++$i; } if ($email!=""){ if (ereg(".", $email) == 0){ $email_error="Email:"; ++$i; } else { if (ereg("\@", $email) == 0){ $email_error="Email:"; $error_msg="Email muß ein @ beinhalten!"; ++$i; } else { if (ereg("\@.*.\.", $email) == 0){ $email_error="Email:"; $error_msg="Die Emailadresse enthält keinen gültigen Domainnamen!"; ++$i; } } } } //Error --> Meldung if($i!=0){ $error_msg=""; }else{ $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[45]=signup&listname[45]= Garden Gewinnspiel&subscribe=$buttonname"; $return = PostToHost("electric-delicate.de","/mailer/?p=subscribe&id=10", "$data"); //echo $return; //echo $data; } } ?>
Die Eingabe wurde durchgeführt und muß per Mail bestätigt werden. |