php
dosyasının bir ajax
POST
isteği yapıyorum. Bunu A.php
Ajax çağrısı php dosyalarını iç içe
Bu A.php
dosyasını B.php
arayabiliriz. bakan
$.ajax({
type: "POST",
url: "../../page_components/A.php",
data: { // my data
},
success: function(response) {
location.reload();
},
Sorun: A.php da B çağırdığında başarı işlevi çağrılmaz. A.php On B.php
çağırmaz, düzgün çalışır benim A.php
/* some stuff that a.php does
*/
include ('B.php'); // call B.php to handle other stuff
B.php
<?php
require '../../../../PHPMailer/class.phpmailer.php';
require '../../../../PHPMailer/class.smtp.php';
// set relevant agency email to send to. $agency comes from A.php
switch ($agency) {
case "1": $receiverEmail = "[email protected]";
break;
case "2" : $receiverEmail = "[email protected]";
break;
}
$mail = new PHPMailer();
// All the mail setting and stuff is here...
if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent.';
}
?>
gibi olması gerekiyordu, ama bu kodu görmeden söylemek zor isnt sonra ise. – larsAnders
böylece "A.php" ve "b.php" çıktılarınız (veya eko) hiç bir şeyiniz yok mu? –
İkisi de bir şeyler yankılanıyor. Denedim ve tüm işlev hem php' dosyaları üzerinde iyi çalışıyordu. Sadece başarı fonksiyonu aranmaz. 'B.php', sadece bir PHPMailer olup, receiver_email ve messagebody'nin A.php'den gönderilmesi yoluyla e-posta gönderir. –