Wednesday, 12 February 2014

Output html using echo statement in php

Output html using echo statement in php
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
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) :-

parse error
Showing You Parse error

<?php
echo <input type = "text" name="name">";
?>


output (screenshot4) :- You will find Parse error

prase 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
Writing Html Codes in Php Echo Statement Screenshot5
<?php

echo "<input type='text' name='name'>";

?>



output (screenshot2) :-


Output html using echo statement in php
Screenshot2
There are also different ways to write this codes showing in screenshots for same result screenshot2

Output html using echo statement in php
Screenshot6
Output html using echo statement in php
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..

About Me

Welcome to Extra Tutorials! My name is Mohammed and I am the 22 year writer, website developer, and photographer behind the blog. Thanks for visiting! Tutorials Jackpot… In addition to Developer, I love to develop websites and I love to write. Starting a php Blog was inevitable for me. What began as a simple way to share all of my Tutorials with friends and family has developed into my Part time job.

Mohammed Padela

WHAT IS PHP PROGRAMMING

WHAT IS PHP PROGRAMMING
WHAT IS PHP PROGRAMMING

Follow Us

Popular Posts

Designed ByBlogger Templates