This problem keeps popping up, can anyone give me some advice? Where is the problem
The source code is as follows
<meta charset="utf-8"><?php if (isset($_POST['userName'])) { if (!empty($_POST['userName'])&&!empty( $_POST['passWord'])) { #Determine whether the entered user name and password are empty if ($_POST['userName'] == "zzh" && $_POST['passWord'] == "123") {# Determine whether the entered username and password is a certain value if (setcookie("name","zzh")) {//If it is a set value, issue a cookie echo "Login successful, welcome to visit!<a href= './index.php'≫ Back to the homepage & lt;/a & gt; ";} Else {echo" cookies failed! ";}} Else {echo" user name or password error! login.php'>Please log in again!</a>"; </a>"; gt; < ;meta charset="utf-8"></head><body> "_blank"> input type="submit" name="userSubmit" value="Login"> <!--Submit button--> </form></body></html>HTML; //Represents HTML End echo $htm; }?>
phpcn牛2023-04-24 13:09:37
<<<Just add a space after it and start the HTML at the end on a new line.
phpcn牛2023-04-24 13:07:57
if (isset($_POST['userName'])) { if (!empty($_POST['userName'])&&!empty($_POST['passWord'])) { if ($_POST[' userName'] == "zzh" && $_POST['passWord'] == "123") { = './index.php' & gt; return home & lt;/a & gt; "} Else {echo" cookie! ";}} Else {echo" user name or password error! & lt; a href = '. /login.php'> Please log in again! & lt;/a & gt; ";}} Else {echo" user name or password error! & lt; a href = './login.php' & gt; /a>"; }}else{ $htm = <<< HTML ; </head> ; ; ; Password: <input body>