Solved

php to HTML script

Posted on 2007-03-24
3
193 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now