gpt4 book ai didi

php - 由于某种原因,我似乎没有解析我的第二个 if 语句

转载 作者:行者123 更新时间:2023-11-29 11:51:45 25 4
gpt4 key购买 nike

我做错了什么?然后我从来没有得到“好的”。

我尝试过一些其他包含太多 HTML 的代码,但无法很好地清理它以适合我。我的问题似乎是在表单区域方面缺乏能力。

<?php
include "connect.php";

session_start();
if (isset($_SESSION['username']))
{
print "<A href='addquote.php'>Add a quote</a> | <A href='deletequote.php'>Delete a quote</a> | <A href='search.php'>Search</a><br><br>";

if(isset($add))
{
print "OK";

$addquote="Insert into rquote_quotes (quote) values ('$add')";
$result=mysql_query($addquote) or die("Could not insert quote");

if($result)
{
print "Quote added successfully";
}
else
{
print "ERROR";
}
}
else
{
print "<form action='addquote.php' method='post'>";
print "Type quote here<br>";
print "<textarea name='quote' rows='3' cols='20'></textarea><br>";
print "<input type='submit' name='add' value='add quote'></form>";
}
}
else
{
print "Not logged in as Administrator, please <A href='login.php'>Login</a>";
}

?>

最佳答案

您需要更改:

if(isset($add))

对此:

if(isset($_POST['add']))

关于php - 由于某种原因,我似乎没有解析我的第二个 if 语句,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33944514/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com