Blackman123
Blackman123

Reputation: 69

HTML form within PHP tags

I want to make a form that submits data from user input into a database. However, when making the form, it does not appear in the browser.

Here is the code.

echo '<form name="submit" method="post" action="reservation_confirm.php">';
echo '<Confirm: <input type="submit" name="confirm" value="confirm">';
echo '</form>';

Upvotes: 1

Views: 1211

Answers (2)

Milos
Milos

Reputation: 1

It's because of less sign on your second line. It is considered HTML opening tag. Try this:

echo '<form name="submit" method="post" action="reservation_confirm.php">';
echo '&#60;Confirm: <input type="submit" name="confirm" value="confirm">';
echo '</form>';

Or simply remove it.

Upvotes: 0

PHPhil
PHPhil

Reputation: 1540

You have a less-than sign < to many.

Change:

echo '<Confirm: <input type="submit" name="confirm" value="confirm">';
//----^ remove

To:

echo 'Confirm: <input type="submit" name="confirm" value="confirm">';

Upvotes: 3

Related Questions