<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>html &#8211; Programming blog &#8211; website programming blog, blog on website programming .net, java , php and mor</title>
	<atom:link href="https://www.searchenginegenie.com/programming-blog/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.searchenginegenie.com/programming-blog</link>
	<description></description>
	<lastBuildDate>Tue, 11 Dec 2012 06:36:58 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.5</generator>
	<item>
		<title>Transfer data from one page to another using php</title>
		<link>https://www.searchenginegenie.com/programming-blog/phphtml-to-connect-two-tables/</link>
					<comments>https://www.searchenginegenie.com/programming-blog/phphtml-to-connect-two-tables/#comments</comments>
		
		<dc:creator><![CDATA[Camilla]]></dc:creator>
		<pubDate>Wed, 28 Jul 2010 05:58:55 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[JavaScript.]]></category>
		<category><![CDATA[PHP Code]]></category>
		<guid isPermaLink="false">http://www.searchenginegenie.com/programming-blog/?p=306</guid>

					<description><![CDATA[Steps: 1:Create new php file and copy file1 code and save it as file1.php. 2.Create another new php file and copy file2 code and save it as file2.php. 3.Run file1.php, then it will display the file1 data. 4.Enter your name, age and location and press the submit button. 5.It will transfer to file2.php and displays [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><strong>Steps:</strong></p>
<p><strong>1:Create new php file and copy file1 code and save it as file1.php.</strong></p>
<p><strong>2.Create another new php file and copy file2 code and save it as file2.php.</strong></p>
<p><strong>3.Run file1.php, then it will display the file1 data.</strong></p>
<p><strong>4.Enter your name, age and location and press the submit button.</strong></p>
<p><strong>5.It will transfer to file2.php and displays the output.</strong></p>
<p><strong> file1:</strong></p>
<p>[php]</p>
<p>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;<br />
 &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
 &lt;head&gt;<br />
 &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;<br />
 &lt;title&gt;table1&lt;/title&gt;<br />
 &lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;<br />
 function check()<br />
 {<br />
 if(document.getElementById(&#8216;name1&#8217;).value==&#8221;)<br />
 {<br />
 alert(&quot;Please enter your name&quot;);<br />
 document.getElementById(&#8216;name1&#8217;).focus();<br />
 }<br />
 else if(document.getElementById(&#8216;age1&#8217;).value==&#8221;)<br />
 {<br />
 alert(&quot;please enter your age&quot;);<br />
 document.getElementById(&#8216;age1&#8217;).focus();<br />
 }<br />
 else if(document.getElementById(&#8216;location1&#8217;).value==&#8221;)<br />
 {<br />
 alert(&quot;please enter the location&quot;);<br />
 document.getElementById(&#8216;location1&#8217;).focus();<br />
 }<br />
 else<br />
 {<br />
 document.form.submit();<br />
 }<br />
 }<br />
 &lt;/script&gt;<br />
 &lt;/head&gt;</p>
<p>&lt;body&gt;<br />
 &lt;form method=&quot;post&quot; action=&quot;file2.php&quot; name=&quot;form&quot; &gt;<br />
 &lt;table width=&quot;100%&quot; border=&quot;0&quot;&gt;<br />
 &lt;tr&gt;<br />
 &lt;td&gt;&lt;label&gt;Enter your name: &lt;/label&gt;<br />
 &lt;/td&gt;<br />
 &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;name&quot;  id=&quot;name1&quot;; /&gt;<br />
 &lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
 &lt;td&gt;&lt;label&gt;Enter your age:&lt;/label&gt;<br />
 &lt;/td&gt;<br />
 &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;age&quot; id=&quot;age1&quot;; /&gt;<br />
 &lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
 &lt;td&gt;&lt;label&gt;Enter the location:&lt;/label&gt;<br />
 &lt;/td&gt;<br />
 &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;location&quot; id=&quot;location1&quot;; /&gt;<br />
 &lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;tr&gt;<br />
 &lt;td colspan=&quot;2&quot;&gt; &lt;div align=&quot;center&quot;&gt;<br />
 &lt;input type=&quot;button&quot; value=&quot;Submit&quot; onclick=&quot;check();&quot; name=&quot;Submit&quot; /&gt;</p>
<p>&lt;/div&gt;&lt;/td&gt;<br />
 &lt;/tr&gt;<br />
 &lt;/table&gt;<br />
 &lt;/form&gt;<br />
 &lt;/body&gt;<br />
 &lt;/html&gt;</p>
<p>[/php]</p>
<p><strong>//save this as file1.php</strong></p>
<p><strong><script type="text/javascript">// <![CDATA[
function check()
{
    if(document.getElementById('name1').value=='')
	{
        alert("Please enter your name");
		document.getElementById('name1').focus();
    }
	else if(document.getElementById('age1').value=='')
	{
		alert("please enter your age");
		document.getElementById('age1').focus();
	}
	else if(document.getElementById('location1').value=='')
	{
		alert("please enter the location");
		document.getElementById('location1').focus();
	}
	else
	{
     document.form.submit();
    }
}
// ]]&gt;</script></strong></p>
<p><strong>It will display the output as:</strong></p>
<form action="table2.php" method="post">
<table width="100%" border="0">
<tbody>
<tr>
<td class="text"><label>Enter your name: </label></td>
<td><input id="name1" type="text" name="name" /></td>
</tr>
<tr>
<td class="text"><label>Enter your age:</label></td>
<td><input id="age1" type="text" name="age" /></td>
</tr>
<tr>
<td class="text"><label>Enter the location:</label></td>
<td><input id="location1" type="text" name="location" /></td>
</tr>
<tr>
<td colspan="2">
<div><input onclick="check();" type="button" name="Submit" value="Submit" /></div>
</td>
</tr>
</tbody>
</table>
</form>
<p><strong>file2:</strong></p>
<p>[php]</p>
<p>&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;<br />
 &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
 &lt;head&gt;<br />
 &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;<br />
 &lt;title&gt;table2&lt;/title&gt;<br />
 &lt;/head&gt;</p>
<p>&lt;body&gt;<br />
 &lt;?php<br />
 $var1=$_POST[&#8216;name&#8217;];<br />
 $var2=$_POST[&#8216;age&#8217;];<br />
 $var3=$_POST[&#8216;location&#8217;];<br />
 echo &quot;your name is: $var1&quot;.&quot;&lt;br/&gt;&quot;;<br />
 echo &quot;your age is: $var2&quot;.&quot;&lt;br/&gt;&quot;;<br />
 echo &quot;loaction is: $var3&quot;;<br />
 ?&gt;<br />
 &lt;/body&gt;<br />
 &lt;/html&gt;</p>
<p>[/php]</p>
<p><strong>//save this as file2.php</strong></p>
<p><strong>after entering your name, age and location and pressing the submit button, it displays the output.</strong></p>
<p><strong>For example:</strong></p>
<p><strong>your name is: John<br />
your age is: 25<br />
loaction is: CA</strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.searchenginegenie.com/programming-blog/phphtml-to-connect-two-tables/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: www.searchenginegenie.com @ 2024-08-27 02:32:16 by W3 Total Cache
-->