我正在尝试运行一个 php 文件,但我收到两个警告,我似乎无法放置。警告:
PHP 警告:指令 'safe_mode' 在 PHP 5.3 中已弃用,在第 0 行的 Unknown 和更高版本中已弃用
PHP 警告:mysql_fetch_array() 期望参数 1 是资源,布尔值在第 19 行的 /etc/baseconetrial2.php 中给出
编码:
<?php
//connectie database
mysql_connect('localhost','heregoestheusername','heregoesthepass');
@mysql_select_db('admin_subscriptions') or die( "Unable to select database");
$type = "proefabonnement";
$checksql = "SELECT * FROM subscriptions where (type_abonnement = '$type' AND DATE(timestamp) = DATE_SUB( CURDATE( ) , INTERVAL 26))";
$checkresult = mysql_query($checksql);
while ($check = mysql_fetch_array($checkresult)) {
$mail_ontv = "email@emailadress.com";
$_POST['onderwerp'] = "Verlopen Trial Account";
// set datum
$datum = date("d.m.Y H:i");
// set ip
$ip = $_SERVER['REMOTE_ADDR'];
$inhoud_mail .= $_SERVER['SCRIPT_URI'] . "\n\n";
$inhoud_mail .= "Binnenkort verloopt er een trail account!\n\n\n";
$inhoud_mail .= "Bedrijfsnaam: " . $check['bedrijfsnaam'] . "\n\n";
$inhoud_mail .= "Telefoonnummer: " . $check['telefoonnummer'] . "\n\n";
$inhoud_mail .= "E-mail adres: " . $check['email'] . "\n\n";
$inhoud_mail .= "Telefoonnummer contactpersoon: " . $check['telefoonnummercontact'] . "\n\n";
$inhoud_mail .= "E-mail adres contactpersoon: " . $check['emailcontact'] . "\n\n";
$inhoud_mail .= "Hieronder de link voor de klant:\n\n\n";
$inhoud_mail .= "http://www.basecone.nl/upgrade1?key=".$check['unique']."\n\n";
$inhoud_mail .= "Verstuurd op " . $datum . " via het ip " . $ip . "\n\n";
$headers = "From: BaseconeWizard < wizard@basecone.nl >";
$headers = stripslashes($headers);
$headers = str_replace("\n", "", $headers); // Verwijder \n
$headers = str_replace("\r", "", $headers); // Verwijder \r
$headers = str_replace("\"", "\\\"", str_replace("\\", "\\\\", $headers)); // Slashes van quotes
$_POST['onderwerp'] = str_replace("\n", "", $_POST['onderwerp']); // Verwijder \n
$_POST['onderwerp'] = str_replace("\r", "", $_POST['onderwerp']); // Verwijder \r
$_POST['onderwerp'] = str_replace("\"", "\\\"", str_replace("\\", "\\\\", $_POST['onderwerp'])); // Slashes van quotes
mail($mail_ontv, $_POST['onderwerp'], $inhoud_mail, $headers);
}
?>
多谢你们!