Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

echo <<<_END not working

Tags:

html

sql

php

I have the code bellow embedded in my php tags, however it does not read the html, does anyone know why? Any help would be appreciated.

echo <<<_END
<pre>
<form action = "sqltest.php" method = "POST">
Author <input type = "text" name = "author" />
Title <input type = "text" name = "title" />
Category <input type = "text" name = "category" />
Year <input type = "text" name = "year" />
ISBN <input type = "text" name = "isbn" />
<input type = "submit" value = "Add Record" />
</form>
</pre>

_END;
like image 430
Jake.Hoskins Avatar asked Jan 25 '26 07:01

Jake.Hoskins


1 Answers

The problem was with the whitespace, be careful when using the <<<_END statement as your default text editor may indent it. There must be no whitespace.

like image 172
Jake.Hoskins Avatar answered Jan 27 '26 21:01

Jake.Hoskins



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!