私は、これらすべての警告取得しています:行214のファイルnew.phpでPHPの問題の多く(試験プロジェクト、助けが必要!)
E_WARNINGエラー:はhtmlspecialchars() は、パラメータ1を期待文字列であると、線214でファイルnew.phpにおけるオブジェクト所与
E_WARNINGエラー: mysqli_real_escape_string()は正確に2つのパラメータ、ライン216におけるファイルnew.php 1つの与え
E_WARNINGエラーを期待します:htmlspecialchars() e xpectsパラメータ1を文字列にするオブジェクト
現在、私の試験に取り組んでいます。私のプロジェクトをXAMPPから私のWebサーバに移動しなければならないときは、何も動作しませんでした。私は数時間でこのプロジェクトを提供しなければなりません。それは私のlocalhostで完璧に動作しています。しかし、今私が何をしても、それはうまくいかない。
私は開発者ではありません。私はデザイナーで、なぜこれがうまくいかないのかわかりません。
これは私のコードです:代わりに
$first = mysqli_real_escape_string(htmlspecialchars($connection, $_POST ['firstname']));
の
// connect to the database
include('connect-db.php');
// check if the form has been submitted. If it has, start to process the form and save it to the database
if (isset($connection, $_POST['submit']))
{
// get form data, making sure it is valid
$first = mysqli_real_escape_string(htmlspecialchars($connection, $_POST ['firstname']));
$mail = mysqli_real_escape_string(htmlspecialchars($connection, $_POST['mail']));
$adresse = mysqli_real_escape_string(htmlspecialchars($connection, $_POST['adresse']));
$telefon = mysqli_real_escape_string(htmlspecialchars($connection, $_POST['telefon']));
$sprog = mysqli_real_escape_string(htmlspecialchars($connection, $_POST['sprog']));
使用している関数のマニュアルを確認する必要があります。 – jeroen
実際には、警告メッセージはクリアされ、htmlspeciの最初の引数としてオブジェクトが渡されていますalchars。 – Yoleth