데이터베이스의 멤버에게 프런트 엔드에 새로운 정보가 입력되면 PHP 스크립트가 전자 메일과 SMS를 보내도록 작성되었습니다. 그러나 전자 메일 코드와 SMS 코드는 개별적으로 작동하지만 코드를 조합하면 코드가 실행되지 않습니다.내 프로그램에서 PHP의 함수를 건너 뛰는 중
코드가 실제로 건너 뜁니다. 호출 된 함수에서 의도적 인 오류를 만들려고 시도했지만 인식하지 못했습니다. 왜?
<?php
error_reporting(E_ALL^E_NOTICE);
define('INCLUDE_CHECK', true);
require 'functions.php';
include ("generatesms.php");
include ("class.phpmailer.php");
include ("../sendsmsV3.5/sendsmsV3.5/CurlProcess.php");
include ("../sendsmsV3.5/sendsmsV3.5/Way2Sms.php");
include ("class.smtp.php");
// The above files can be included only if INCLUDE_CHECK is defined
$host = "localhost"; // Host name
$username = "root"; // Mysql username
$password = ""; // Mysql password
$db_name = "test"; // Database name
$tbl_name = "mails"; // Table name
// Connect to server and select database.
mysql_connect($host, $username, $password) or die("cannot connect");
mysql_select_db($db_name)or die("cannot select DB");
// Get values from form
$subject = $_POST['subject'];
$email = $_POST['email'];
$phone = $_POST['phone'];
//$dept = $_POST['dept'];
$content = $_POST['content'];
$month = $_POST['birthday-mm'];
$day = $_POST['birthday-dd'];
$year = $_POST['birthday-yyyy'];
$date_eve = "$year-$month-$day";
$dept = $_POST['branch'];
if (empty($dept)) {
echo("You didn't select any DEPEARTMENTS.");
} else {
$N = count($dept);
for($i=0; $i < $N; $i++) {
echo $dept[$i]; echo "<br>";
$dep = $dept[$i];
// Insert data into mysql
$sql = "INSERT INTO $tbl_name(subject, body, dept, phone, email, date_eve) VALUES ('$subject', '$content', '$dep', '$phone', '$email', '$date_eve')";
$result = mysql_query($sql);
// if successfully insert data into database, displays message "Successful".
if ($result) {
echo "Successful";
echo "<BR>";
newssender($dept, $content, $subject);
generatesms($dept,$date_eve,$subject);
echo "<a href='index.php'>Back to main page</a>";
} else {
echo "ERROR";
}
}
}
// close connection
mysql_close();
Google에 표시 할 코드가 있습니까? –
코드를 보지 않고는 답변을 드릴 수 없습니다. 귀하의 질문에 그것을 편집 할 수 있습니까? – andrewsi
ok .... 게임을 추측 할 때 매우 나쁩니다. – itachi