Solved

php to HTML script

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

810 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