Thursday, 13 February 2014

Embedding PHP Inside HTML

Embedding PHP Inside HTML
Embedding PHP Inside HTML
This is a tutorial i am going to talking about embedding PHP Inside HTML. Now embedding is paying something within something embedding insides. lets see example

Code for simple html form with php file extension (screenshot1):-


Code For Simple Html From With Php File Extension Screenshot1
<input type="text" value=" Hello World.">

output (Screenshot2) :-

Embedding PHP Inside HTML
Screenshot2
you will see a small text-box with echo hello world. Now in another example i will embedding php code with html by using variables of php and in values of html form i will use standard variable for string lets see how it will happens

Code for embedding PHP Inside Html (Screenshot3):-

Code for embedding PHP Inside Html
                         Code for embedding PHP Inside Html Screenshot3


<?php
$text = 'Hello World.';
?>
<input type="text" value="<?php echo $text; ?>">

Output (Screenshot4):-


Embedding PHP Inside HTML
Screenshot4
In Advance php you have to use dynamic forms and so its good example for start-up  now in this $text is the variable which is string Hello world. and in html code we had called $text which is string Hello world. its pretty easy. variables also use in database , static text etc. Its very useful in php. variables are declared with ($) sign. and at end use “;”. and when you write php code u can write in one line or multiple line there is same effects. for example

you can use this code also for same result (screenshot4) :-

<?php
$text = 'hello world.';
?>
<input type="text" value="<?php
echo $text;
?>
">


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