我有一個在第22行PHP:錯誤變量未定義
\瓦帕\ WWW \ cible_envoi.php: 「注意:未定義變量」 錯誤,我不能解決:說明:未定義變量:喃用C
你能看看下面的代碼,並解釋我有什麼問題嗎?謝謝!
cible_envoi.php:
<?php
try
{
$bdd = new PDO('mysql:host=localhost;dbname=chansonniersduquebec.com', 'root', '');
}
catch (Exception $e)
{
die('Erreur : ' . $e->getMessage());
}
$req = $bdd->prepare('INSERT INTO chansonniersduquebec.com (Nom) VALUES(?)');
$req->execute(array($_POST['Nom'])); // *** Line 22 ***
Incription.html:
<form id="Formulaire" name="Formulaire" method="post" action="cible_envoi.php">
<label>
<div align="center">Nom (votre nom d'artiste de préférence!)
<span class="style1">*</span>
<input type="text" name="Nom" id="Nom"/>
</div>
<p> </p>
<label>
...
<input type="submit" name="Soumettre" id="Soumettre" value="Soumettre" />
</form>
如果您可以聲明整個完整的錯誤消息,那麼它會很好,因爲它應該包含文件名和發現錯誤的行。 – Sven
確切的錯誤信息是什麼? @ user1115535 – marknatividad
[PHP:「Notice:Undefined variable」和「Notice:Undefined index」]的可能重複(http://stackoverflow.com/questions/4261133/php-notice-undefined-variable-and-notice-undefined-索引) – hakre