<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=PHP-and-MySQL%2FC2%2FEmbedding-PHP%2FEnglish</id>
		<title>PHP-and-MySQL/C2/Embedding-PHP/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=PHP-and-MySQL%2FC2%2FEmbedding-PHP%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C2/Embedding-PHP/English&amp;action=history"/>
		<updated>2026-04-06T01:13:21Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C2/Embedding-PHP/English&amp;diff=545&amp;oldid=prev</id>
		<title>Chandrika: Created page with '{| border=1 !Time !Narration |- |0:0 |This is a short tutorial on how to embed Php code inside HTML code.  This is very useful in many situations. |- |0:14 |For example if I were…'</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PHP-and-MySQL/C2/Embedding-PHP/English&amp;diff=545&amp;oldid=prev"/>
				<updated>2012-11-29T06:41:01Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;{| border=1 !Time !Narration |- |0:0 |This is a short tutorial on how to embed Php code inside HTML code.  This is very useful in many situations. |- |0:14 |For example if I were…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| border=1&lt;br /&gt;
!Time&lt;br /&gt;
!Narration&lt;br /&gt;
|-&lt;br /&gt;
|0:0&lt;br /&gt;
|This is a short tutorial on how to embed Php code inside HTML code.  This is very useful in many situations.&lt;br /&gt;
|-&lt;br /&gt;
|0:14&lt;br /&gt;
|For example if I were to create Php tags and echo out my name here.&lt;br /&gt;
|-&lt;br /&gt;
|0:24&lt;br /&gt;
|By running this , let's click on a file, we just get an Alex.&lt;br /&gt;
|-&lt;br /&gt;
|0:30&lt;br /&gt;
|Now for example, I can embed HTML inside this and echo it out here to make Alex a little bolder.&lt;br /&gt;
|-&lt;br /&gt;
|0:42&lt;br /&gt;
|But what I can do is I can switch this the other way round.&lt;br /&gt;
|-&lt;br /&gt;
|0:46&lt;br /&gt;
|Let's start again, create an HTML page. I'm going to use this example&lt;br /&gt;
|-&lt;br /&gt;
|0:53&lt;br /&gt;
|I will start a Php and a tag here. I echo out Alex and then come in outside the Php tags and add my bold here and my bold end after the ending Php tag&lt;br /&gt;
|-&lt;br /&gt;
|01:14&lt;br /&gt;
|And it gives us the same result, nothing has changed even though I've refreshed the page&lt;br /&gt;
|-&lt;br /&gt;
|01:18&lt;br /&gt;
|So, we can change that to underline and you can see that Alex is underlined.&lt;br /&gt;
|-&lt;br /&gt;
|01:28&lt;br /&gt;
|So, we can do it either ways.  It's up to you to use the HTML code inside the echo or not.  But there are more uses to this.&lt;br /&gt;
|-&lt;br /&gt;
|01:39&lt;br /&gt;
|Now, if you do know HTML, you know the input tag is a template tag.&lt;br /&gt;
|-&lt;br /&gt;
|01:51&lt;br /&gt;
|So, let's say text and the name of this will be name and the value is going to be equal to Alex&lt;br /&gt;
|-&lt;br /&gt;
|01:56&lt;br /&gt;
|Lets refresh this and we see we've got a text box here with Alex inside.Now I want to use Php to grab the get variable header and put it inside this value of our input value.&lt;br /&gt;
|-&lt;br /&gt;
|02:16&lt;br /&gt;
|Now, this is really useful in some cases like form submission and error checking where you want the posted variables to stay inside the value of each text box.&lt;br /&gt;
|-&lt;br /&gt;
|02:34&lt;br /&gt;
|If you haven't seen the get tutorial already make sure you watch that.&lt;br /&gt;
|-&lt;br /&gt;
|02:38&lt;br /&gt;
|Now, bring this down a couple of lines, obviously we still run this code successfully because it works on similar line basis&lt;br /&gt;
|-&lt;br /&gt;
|02:49&lt;br /&gt;
|So, this you see here is exactly the same as that, you just have to force it down a bit and I'm going to create Php text here&lt;br /&gt;
|-&lt;br /&gt;
|02:57&lt;br /&gt;
|This is going to look a funny brown colour because we're working in Php highlighting and it's not really recognizing this type of highlighting&lt;br /&gt;
|-&lt;br /&gt;
|03:04&lt;br /&gt;
|Ok, I'm just going to echo out Alex&lt;br /&gt;
|-&lt;br /&gt;
|03:11&lt;br /&gt;
|Since this works on a single line basis, bring this all up on a single line.  So now I have embed this inside that and your embedding is done.&lt;br /&gt;
|-&lt;br /&gt;
|03:24&lt;br /&gt;
|By refreshing we get the value of Alex. We're echoing out now Php inside a n HTML value&lt;br /&gt;
|-&lt;br /&gt;
|03:35&lt;br /&gt;
|So, we're using Php code inside our value here&lt;br /&gt;
|-&lt;br /&gt;
|03:41&lt;br /&gt;
|I'm going to demonstrate dollar underscore get ,remember using the single quotes&lt;br /&gt;
|-&lt;br /&gt;
|03:50&lt;br /&gt;
|I'm going to say name and then refresh&lt;br /&gt;
|-&lt;br /&gt;
|03:55&lt;br /&gt;
|Nothing's happened so type in name=Alex which gives us Alex inside that&lt;br /&gt;
|-&lt;br /&gt;
|04:04&lt;br /&gt;
|Type in name=Kyle. It gives us Kyle inside that&lt;br /&gt;
|-&lt;br /&gt;
|04:09&lt;br /&gt;
|Basically you can embed any Php code you want inside that&lt;br /&gt;
|-&lt;br /&gt;
|04:14&lt;br /&gt;
|Try saying echo Php info and you'd get a very funny result&lt;br /&gt;
|-&lt;br /&gt;
|04:28&lt;br /&gt;
|This is the HTML code of Php info document&lt;br /&gt;
|-&lt;br /&gt;
|04:33&lt;br /&gt;
|So, you can see that there's loads of code in that&lt;br /&gt;
|-&lt;br /&gt;
|04:36&lt;br /&gt;
| Here we're just working with Php inside.The only thing you need to worry about is being careful with your single and double quotes&lt;br /&gt;
|-&lt;br /&gt;
|04:48&lt;br /&gt;
|So this was the basic tutorial on embedding Php code inside HTML code&lt;br /&gt;
|-&lt;br /&gt;
|04:54&lt;br /&gt;
|I hope it was useful.Thanks for watching&lt;br /&gt;
|-&lt;br /&gt;
|05:00&lt;br /&gt;
|This is Anoushka dubbing for the Spoken tutorials Project&lt;/div&gt;</summary>
		<author><name>Chandrika</name></author>	</entry>

	</feed>