同じページに 2 つの php フォームがありますが、問題は iframe を介してそれらを呼び出していることですが、入力フィールドが異なる両方のフォームに同じスクリプトを使用しているにもかかわらず、キャプチャが機能していません。今何が起こっているかというと、最初にキャプチャをクリックして正しいキャプチャを書くと、「あなたは間違ったキャプチャを入力しました」というメッセージが表示され、正しいキャプチャを入力してから感謝を示します...入力したときに初めて感謝を示してくれませんか正しいキャプチャ??????
<?php
session_start();
$tuCurl = curl_init();
curl_setopt($tuCurl, CURLOPT_URL, $url);
curl_setopt($tuCurl, CURLOPT_RETURNTRANSFER, 1);
$tuData = curl_exec($tuCurl);
curl_close($tuCurl);
$userip = explode(',',$tuData);
$ipcountry = str_replace('"', '', $userip[3]);
include "libmail.php";
$errors = '';
//print_r($_POST);
if(isset($_POST['email']))
{
if(empty($_SESSION['6_letters_code'] ) ||
strcasecmp($_SESSION['6_letters_code'], $_POST['captcha']) != 0)
{
$errors .= "You have entered wrong captcha code!";
}elseif($_FILES["userfile"]["size"] > 1048576)
{
$errors .= "You can upload maximum of 800kb file!";
}else{
$productsq = $_POST['productsq'];
$name = $_POST['name'];
$position = $_POST['position'];
$phone = $_POST['phone'];
$company = $_POST['company'];
$companyweb = $_POST['companyweb'];
$address = $_POST['address'];
$country = $_POST['country'];
$brief = $_POST['brief'];
$email = $_POST['email'];
$captcha = $_POST['captcha'];
$sender = $contact_email;
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
if(trim($productsq) !='')
$email_message .= "*I'm interested in : ".clean_string($productsq)."\n"."\n";
if(trim($name) !='')
$email_message .= "Full Name: ".clean_string($name)."\n"."\n";
if(trim($position) !='')
$email_message .= "Position/Title: ".clean_string($position)."\n"."\n";
if(trim($phone) !='')
$email_message .= "Phone: ".clean_string($phone)."\n"."\n";
if(trim($company) !='')
$email_message .= "Company Name: ".clean_string($company)."\n"."\n";
if(trim($companyweb) !='')
$email_message .= "Website URL: ".clean_string($companyweb)."\n"."\n";
if(trim($address) !='')
$email_message .= "Full Address: ".clean_string($address)."\n"."\n";
if(trim($country) !='')
$email_message .= "Country: ".clean_string($country)." (IP Address) : $ipcountry ".$_SERVER['REMOTE_ADDR']."\n"."\n";
if(trim($brief) !='')
$email_message .= "About Myself : ".clean_string($brief)."\n"."\n";
$random = mt_rand();
$m= new Mail; // create the mail
$m->From( $name."<$email>" );
$m->To( "abc@gmail.com" );
$m->Subject( "Form2 - ".$random );
$m->Body( $email_message);
$m->Priority(2) ;
if($_FILES["userfile"]["tmp_name"]){
move_uploaded_file($_FILES["userfile"]["tmp_name"], 'uploadedfiles/'.$_FILES["userfile"]["name"]);
$file_upload = 'uploadedfiles/'.$_FILES["userfile"]["name"];
$m->Attach( $file_upload) ;
}
$m->Send();
header('location:thankyou.php');
if($_FILES["userfile"]["tmp_name"]){
unlink($file_upload);
}
}
}
?>