• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • Last Modified:

php to HTML script

I am trying to generate a HTML code with php and I have some problmes:

This is what I want:

<form id="FormName" action="artikkel.php" method="get" name="FormName">Lock: <input type="text" name="passlock" size="24" /> <input type="submit" name="submit" value="open" /></form>

How can I put this in the php script?

Something like this:

echo "<form id='FormName' action='artikkel.php' method='get' name='FormName'>Lock: <input type='text'name='passlock' size='24' /> <input type='submit' name='submit' value='open' /></form>';

0
Hans Inge Hagen
Asked:
Hans Inge Hagen
2 Solutions
 
JamesCsslCommented:
echo '<form id="FormName" action="artikkel.php" method="get" name="FormName">Lock: <input type="text" name="passlock" size="24" /> <input type="submit" name="submit" value="open" /></form>';
0
 
gamebitsCommented:
echo "<form id='FormName' action='artikkel.php' method='get' name='FormName'>Lock: <input type='text'name='passlock' size='24' /> <input type='submit' name='submit' value='open' /></form>';

Should be

echo "<form id='FormName' action='artikkel.php' method='get' name='FormName'>Lock: <input type='text'name='passlock' size='24' /> <input type='submit' name='submit' value='open' /></form>";  <---- double quote to close your echo statement
0
 
RoonaanCommented:
There is no need to put those amounts of html inside a php echo if you don't add variable data to it. You can just end your php block post the html, and return to php:

  // php code
?>

<form id="FormName" action="artikkel.php" method="get" name="FormName">Lock: <input type="text" name="passlock" size="24" /> <input type="submit" name="submit" value="open" /></form>

<?php
  // some more php code

Kind regards

-r-
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now