Solved

php to HTML script

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Why my select dropdown does not work? 8 27
PHP: Insert Data into MySQL 5 17
Wordpress errors showing up, hacked? 4 16
hosting images 4 12
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
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…
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…

867 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

15 Experts available now in Live!

Get 1:1 Help Now