你好,我試圖將我的用戶名發佈到我的插入頁面,但他們說未定義的索引:usrUserName。發佈一個php變量
在我autocomplete.php我想看看有什麼錯。如果我這樣做:
<input type="text" name="data1" value="<?php echo $usrUserName; ?>" />
I see my username so I know i receive it from my connection. When I post it
<form action = 'insert.php' method="post" >
<input type="text" id="result" readonly="readonly" name="total" />
<input type="submit" value="Terminé" id="end" />
<input type="hidden" name="data" value="<?php echo $date; ?>" />
<input type="text" name="data1" value="<?php echo $usrUserName; ?>" />
</form>
我得到了錯誤。 這是我insert.php頁
//récupération des variable
$date = $_POST['data'] ;
$usrUserName = $_POST['usrUserName'] ;
echo($usrUserName);
if (isSet($_POST['descprojsam']))
{
$usrUserName = $_POST['usrUserName'] ;
echo($usrUserName);
$descprojsam = $_POST['descprojsam'] ;
}
echo($date);
您沒有名爲'usrUserName'您就可以在表單元素有它與'name =「data1」' –