|
Output html using echo statement in php |
Output html using echo statement in php Programming Languages. This is a tutorial i am going to show you how to echo html active page. so, we know how to echo output and now if we want to echo out some html data. Let i want to echo output input text for a form and it will be done outside php code lets see example.
Code for input data for form (Screenshots1) :-
|
Input Data For Form Screenshot1 |
<input type="text" name="name">
output (Screenshot2) :-
|
Output Screenshot2 |
In example in this way we normally write html with php codes.But what if we want to write echo output result which we writes in text box. That text box code will be inside php codes lets see example.
Code for showing you Parse error (screenshot3) :-
|
Showing You Parse error |
echo <input type = "text" name="name">";
?>
output (screenshot4) :- You will find Parse error
|
Output Screenshot4 |
Parse error: parse error,expecting “;” or “;” in C:\xampp\htdocs\series\echohtml\index.php on line 2. you will see this error because when we starts semi colon with less then greater sign after equal to sign its says its ends here so its expecting “;” there for that there are some standard resolution lets see example
Code for proper way to write html codes in php echo statement(screenshot5):-
|
Writing Html Codes in Php Echo Statement Screenshot5 |
<?php
echo "<input type='text' name='name'>";
?>
output (screenshot2) :-
|
Screenshot2 |
There are also different ways to write this codes showing in screenshots for same result screenshot2
|
Screenshot6 |
|
Screenshot7 |
Screenshot6 and screenshot7 is the other ways to write for same result for screenshot2 well screenshot7 codes are slower then other ways of codes.
No comments:
Post a Comment
Thanks For Comment Will get you Soon..