| |

VerySource

 Forgot password?
 Register
Search
View: 5|Reply: 2

Urgent help, Wangwang for your help, thanks

[Copy link]

1

Threads

1

Posts

2

Credits

Newbie

Rank: 1

Credits
2

 China

Post time: 2020-3-4 22:00:02
| Show all posts |Read mode
An error occurred while printing a string on multiple lines or assigning a value to a string variable on multiple lines
The way it went wrong:
print <<< HERE
<form>
Please enter your name:
<input type = "text"
name = "userName"> <br>
<input type = "submit">
</ form>
HERE;
Error prompt: Parse error: parse error, unexpected $ end in C:\Inetpub\wwwroot\myphp\User.php on line 29
I see that many people are using the << HERE and HERE tags together to complete the assignment or printing of multi-line strings. I think this method is also very convenient, but why not on my machine
Just modify the above promise method to:
print "<form> Please enter your username: <input type = text name = userName> <br> <input type = submit name = submit> </ form>";
That ’s it. How is this going? I hope to get your help

Thank you
Reply

Use magic Report

0

Threads

7

Posts

6

Credits

Newbie

Rank: 1

Credits
6

 China

Post time: 2020-5-18 22:30:01
| Show all posts
The end tag should be placed at the very beginning of the line
Reply

Use magic Report

0

Threads

7

Posts

6

Credits

Newbie

Rank: 1

Credits
6

 China

Post time: 2020-5-18 23:45:01
| Show all posts
print <<< HERE
<form>
Please enter your name:
<input type = "text"
name = "userName"> <br>
<input type = "submit">
</ form>
HERE;


That's right
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2020|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list