When PHP is mixing php and html, syntax error, unexpected end keeps appearing.
P粉755083152
P粉755083152 2023-04-21 15:16:55
0
3
804

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; }?>

P粉755083152
P粉755083152

reply all(3)
P粉755083152

Thank you, boss!

手机用户1578621769

<<<Just add a space after it and start the HTML at the end on a new line.

手机用户1578621769

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&gt ; ; ; Password: <input                                                                                                                     body>

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template