Solved

php to HTML script

Posted on 2007-03-24
3
196 Views
Last Modified: 2009-12-16
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
Comment
Question by:Hans Inge Hagen
3 Comments
 
LVL 11

Accepted Solution

by:
JamesCssl earned 25 total points
ID: 18786623
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
 
LVL 28

Assisted Solution

by:gamebits
gamebits earned 25 total points
ID: 18786635
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
 
LVL 49

Expert Comment

by:Roonaan
ID: 18787743
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question