gpt4 book ai didi

javascript - html代码中div标签的错误消息

转载 作者:太空宇宙 更新时间:2023-11-04 13:30:18 24 4
gpt4 key购买 nike

我有这样的代码:

...
header("Location: private.php");
die("Redirecting to: private.php");
}
else
{
print("Login Failed."); >>I WANT MOVE THIS IN DIV TAG<<
....

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" media="screen" href="css/style.css">
</head>
<body>
<div id="container">
<div id="header-main">Main Menu</div>
<div id="header"></div>
<div id="content">
<div class="table">
<div class="tr">
<div id="member" class="td" align="center">
<span class="member">Data</span>
</div>
<div class="vr">&nbsp;</div>
<div id="login" class="td">
<div class="login-error"> **>>> HERE ERROR MESSAGE <<<** </div>
<div class="login-title">LogIn</div>
<form action="login.php" method="post">
<input type="text" name="username" value="<?php echo $submitted_username; ?>" placeholder="Username" autofocus/>
<br /><br />
<input type="password" name="password" value="" placeholder="Password"/>
<br /><br />
<input type="submit" value="Login" />
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

我该如何解决这个问题?

最佳答案

$errorMessage = null;

else{ ...
$errorMessage = "Login Failed.";
....


in html >>>
<?php if(!empty($errorMessage)) ?>
<div class="login-error"><?php echo $errorMessage;?></div>

关于javascript - html代码中div标签的错误消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23404059/

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