<?xml version="1.0" encoding="UTF-7"?>
<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>Media Milan</title>
	<atom:link href="http://www.mediamilan.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mediamilan.com</link>
	<description></description>
	<lastBuildDate>Tue, 12 Feb 2013 10:36:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>Loop YouTube videos in your browser</title>
		<link>http://www.mediamilan.com/code-snippet/loop-youtube-videos-in-your-browser/</link>
		<comments>http://www.mediamilan.com/code-snippet/loop-youtube-videos-in-your-browser/#comments</comments>
		<pubDate>Tue, 12 Feb 2013 10:36:38 +0000</pubDate>
		<dc:creator>Mr. JCRP</dc:creator>
		
		<guid isPermaLink="false">http://www.mediamilan.com/?post_type=code-snippet&#038;p=677</guid>
		<description><![CDATA[As of posting this snippet YouTube as we all know does not offer to loop videos. It does not have any standard links or buttons on their player to do this. There is an easy work around it. For that first you need to understand the structure of a YouTube link. http://www.youtube.com/watch?v=RwUGSYDKUxU Please note the...]]></description>
			<content:encoded><![CDATA[<p>As of posting this snippet <em>YouTube</em> as we all know does not offer to <em>loop videos</em>. It does not have any standard links or buttons on their player to do this.</p>
<p>There is an easy work around it. For that first you need to understand the <em>structure</em> of a YouTube link.</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">http://www.youtube.com/watch?v=RwUGSYDKUxU</div></div>
<p>Please note the last &#8216;random characters&#8217; &#8211; <strong>RwUGSYDKUxU</strong>. This is the video_code of your video. </p>
<h3>The work around</h3>
<p><strong>The following is a syntax to play looped videos.</strong> Just replace &#8216;video_code&#8217; with your video code.</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">http://youtube.googleapis.com/v/video_code<span style="color: #ddbb00;">&amp;loop=1&amp;autoplay=1</span></div></div>
<p>Which turns out to be:</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">http://youtube.googleapis.com/v/RwUGSYDKUxU<span style="color: #ddbb00;">&amp;loop=1&amp;autoplay=1</span></div></div>
<p>It will play the video in full screen and loop the video automatically. Thats it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mediamilan.com/code-snippet/loop-youtube-videos-in-your-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to insert data into mysql database using PHP form and then send mail &#8211; Part 2</title>
		<link>http://www.mediamilan.com/tutos/how-to-insert-data-into-mysql-database-using-php-form-and-then-send-mail-part-2/</link>
		<comments>http://www.mediamilan.com/tutos/how-to-insert-data-into-mysql-database-using-php-form-and-then-send-mail-part-2/#comments</comments>
		<pubDate>Thu, 31 Jan 2013 10:30:41 +0000</pubDate>
		<dc:creator>Mr. JCRP</dc:creator>
		
		<guid isPermaLink="false">http://www.mediamilan.com/?post_type=tutos&#038;p=670</guid>
		<description><![CDATA[Welcome to the second part of the tutorial. Here we see how to insert the data into MySQL database and how to send an email using PHP. If you could keep up till this point then please give yourself a tap on your back. You have done a good job. If not please go and...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mediamilan.com/wp-content/uploads/2013/01/insert-into-mysql-database-PHP-and-mailing-part-2.jpg"><img src="http://www.mediamilan.com/wp-content/uploads/2013/01/insert-into-mysql-database-PHP-and-mailing-part-2.jpg" alt="" title="insert-into-mysql-database-PHP-and-mailing-part-2" width="500" height="300" class="aligncenter size-full wp-image-671" /></a></p>
<p>Welcome to the second part of the tutorial. Here we see how to insert the data into MySQL database and how to send an email using PHP. If you could keep up till this point then please give yourself a tap on your back. You have done a good job. </p>
<p>If not please go and read the <a href="http://www.mediamilan.com/tutos/how-to-insert-data-into-mysql-database-using-php-form-and-then-send-mail-part-1/" title="First Part of the Tutorial" target="_blank"><strong>FIRST PART</strong></a> of the tutorial for better understanding. The <a href="http://www.mediamilan.com/tutos/how-to-insert-data-into-mysql-database-using-php-form-and-then-send-mail-part-1/" title="First Part of the Tutorial" target="_blank"><strong>FIRST PART</strong></a> explains all the basics of processing a form in a detailed method. </p>
<p>In this tutorial we dive in deep to understand the do&#8217;s and dont&#8217;s while connecting with the MySQL database. We also learn about the naming conventions and how to increase the security of your code. Feel free to ask any questions in the comments section and we assure you that it will be cleared.</p>
<h4>Insert the form values into the MySQL database using PHP</h4>
<p>Now the next step in inserting the form values into MySQL database is to select the database. Now that the MySQL connection is made and assigned to $connection variable it is easy.</p>
<p>It&#8217;s time to introduce you to another MySQL function called <strong>mysql_select_db</strong>. This helps you select the database in which you want to insert the form values. <em>mysql_select_db</em> function has two attributes.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/mysql_select_db"><span style="color: #990000;">mysql_select_db</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;db_name&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;connection_variable&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>In our case it is <strong>website_db</strong> and <strong>$connection</strong> variable. So our code will be:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/mysql_select_db"><span style="color: #990000;">mysql_select_db</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;website_db&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$connection</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Now that the database is selected let us insert the values. It is done with a simple MySQL query statement &#8211; <strong>INSERT</strong>. Below is the syntax</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <br />
&nbsp; &nbsp; <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT INTO table (coloumn1, coloumn2) VALUES ('value1', 'value2')&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>We replace the syntax with our values. In order to capture the error we do an <em>if</em> statement here with <strong>mysql_query</strong> function. Hence the following code:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_submit'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$nfrm_name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$nfrm_mobile</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_mobile'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$nfrm_email</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$nfrm_message</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_message'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT INTO tbl_enquiry (nfrm_name, nfrm_mobile, nfrm_email, nfrm_message) <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VALUES ('<span style="color: #006699; font-weight: bold;">$nfrm_name</span>', '<span style="color: #006699; font-weight: bold;">$nfrm_mobile</span>', '<span style="color: #006699; font-weight: bold;">$nfrm_email</span>', '<span style="color: #006699; font-weight: bold;">$nfrm_message</span>')&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #339933;">,</span><span style="color: #000088;">$connection</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Error: '</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/mysql_error"><span style="color: #990000;">mysql_error</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Kindly use the form to submit the data!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>That&#8217;s it. This is how you insert data into your MySQL database After testing the data when we check in <em>phpMyAdmin</em> we can see the table updated.</p>
<p><a href="http://www.mediamilan.com/wp-content/uploads/2013/01/enquiry-table-with-data.jpg"><img src="http://www.mediamilan.com/wp-content/uploads/2013/01/enquiry-table-with-data.jpg" alt="" title="Enquiry table with data" width="905" height="331" class="aligncenter size-full wp-image-675" /></a></p>
<h3>How to send Mail from the PHP form?</h3>
<p>The answer to this big question is actually very small. PHP helps us a great deal with this small function &#8211; <strong>mail()</strong>. The <em>mail()</em> function has its own attributes</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/mail"><span style="color: #990000;">mail</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$emailID</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p><strong>$emailID</strong> is the email id to which the mail has to be sent. To send mails to multiple id&#8217;s just separate them with a comma.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$emailID</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;info@comany.com, ceo@comany.com&quot;</span><span style="color: #339933;">;</span></div></div>
<p><strong>$subject</strong> is the subject of the email. This is what the recipient will see as the email&#8217;s subject.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Enquiry from. <span style="color: #006699; font-weight: bold;">$nfrm_name</span> . through our website&quot;</span><span style="color: #339933;">;</span></div></div>
<p><strong>$body</strong> is the body content of the email. Ideally you can put in anything here. But in our case we need to send the data from the enquiry form.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;height:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #0000cc; font-style: italic;">&lt;&lt;&lt;EOD<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;table cellspacing=&quot;0&quot; cellpadding=&quot;1&quot; border=&quot;1&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tbody&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot; width=&quot;150&quot;&gt;Name: &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot;&gt;$nfrm_name&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot; width=&quot;150&quot;&gt;Mobile: &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot;&gt;$nfrm_mobile&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot; width=&quot;150&quot;&gt;Email: &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot;&gt;$nfrm_email&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot; width=&quot;150&quot;&gt;Message: &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot;&gt;$nfrm_message&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tbody&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/table&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
EOD</span><span style="color: #339933;">;</span></div></div>
<p><strong>$headers</strong> are usually required by the email clients. These <em>$headers</em> tell the email client where the email originated from, who sent it, what is the content type of the email and what is the php version that was used to send it. Without all these information the emails will end into the <strong>SPAM</strong> folder. So make sure you add them. The more information you send the better possibilities that your mail will not be treated as SPAM.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; <span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: website@company.com<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;MIME-Version: 1.0<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Content-Type: text/html; charset=<span style="color: #000099; font-weight: bold;">\&quot;</span>iso-8859-1<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-Priority: 1<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-MSMail-Priority: High<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-Mailer: PHP&quot;</span><span style="color: #339933;">.</span> <a href="http://www.php.net/phpversion"><span style="color: #990000;">phpversion</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span></div></div>
<p>Putting all these together we get this code. The final code that will insert data into our mysql database using php and send a mail also.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;height:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_submit'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$nfrm_name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$nfrm_mobile</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_mobile'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$nfrm_email</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$nfrm_message</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_message'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$sql</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT INTO tbl_enquiry (nfrm_name, nfrm_mobile, nfrm_email, nfrm_message) <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; VALUES ('<span style="color: #006699; font-weight: bold;">$nfrm_name</span>', '<span style="color: #006699; font-weight: bold;">$nfrm_mobile</span>', '<span style="color: #006699; font-weight: bold;">$nfrm_email</span>', '<span style="color: #006699; font-weight: bold;">$nfrm_message</span>')&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/mysql_query"><span style="color: #990000;">mysql_query</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql</span><span style="color: #339933;">,</span><span style="color: #000088;">$connection</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Error: '</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/mysql_error"><span style="color: #990000;">mysql_error</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$emailID</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;info@comany.com, ceo@comany.com&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Enquiry from. <span style="color: #006699; font-weight: bold;">$nfrm_name</span> . through our website&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #0000cc; font-style: italic;">&lt;&lt;&lt;EOD<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;table cellspacing=&quot;0&quot; cellpadding=&quot;1&quot; border=&quot;1&quot;&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tbody&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot; width=&quot;150&quot;&gt;Name: &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot;&gt;$nfrm_name&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot; width=&quot;150&quot;&gt;Mobile: &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot;&gt;$nfrm_mobile&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot; width=&quot;150&quot;&gt;Email: &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot;&gt;$nfrm_email&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot; width=&quot;150&quot;&gt;Message: &lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;td style=&quot;padding: 5px 10px;&quot;&gt;$nfrm_message&lt;/td&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tr&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/tbody&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &lt;/table&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
EOD</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$headers</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;From: website@company.com<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;MIME-Version: 1.0<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;Content-Type: text/html; charset=<span style="color: #000099; font-weight: bold;">\&quot;</span>iso-8859-1<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-Priority: 1<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-MSMail-Priority: High<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$headers</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot;X-Mailer: PHP&quot;</span><span style="color: #339933;">.</span> <a href="http://www.php.net/phpversion"><span style="color: #990000;">phpversion</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/mail"><span style="color: #990000;">mail</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$emailID</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #339933;">,</span> <span style="color: #000088;">$headers</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;h4&gt;Thank you for sending us an enquiry. We will get back to you.&lt;/h4&gt;&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Kindly use the form to submit the data!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>Hope you enjoyed this little long tutorial. Well it was needed and I believe it was worth the time. Because when you make big bucks with this knowledge you sure should come back and tell us your story. We love hearing them in our comments. Thanking for reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mediamilan.com/tutos/how-to-insert-data-into-mysql-database-using-php-form-and-then-send-mail-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to insert data into mysql database using PHP form and then send mail &#8211; Part 1</title>
		<link>http://www.mediamilan.com/tutos/how-to-insert-data-into-mysql-database-using-php-form-and-then-send-mail-part-1/</link>
		<comments>http://www.mediamilan.com/tutos/how-to-insert-data-into-mysql-database-using-php-form-and-then-send-mail-part-1/#comments</comments>
		<pubDate>Thu, 31 Jan 2013 10:30:31 +0000</pubDate>
		<dc:creator>Mr. JCRP</dc:creator>
		
		<guid isPermaLink="false">http://www.mediamilan.com/?post_type=tutos&#038;p=667</guid>
		<description><![CDATA[This is a beginner&#8217;s tutorial on how to use a PHP form with mysql database to save data and send email. Most of the times when we work on basic websites whether it is useful or not the client ask us to add a &#8216;Enquiry Form&#8217;. An enquiry form that sends mail to the client&#8217;s...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mediamilan.com/wp-content/uploads/2013/01/insert-into-mysql-database-PHP-and-mailing-part-1.jpg"><img src="http://www.mediamilan.com/wp-content/uploads/2013/01/insert-into-mysql-database-PHP-and-mailing-part-1.jpg" alt="" title="insert-into-mysql-database-PHP-and-mailing-part-1" width="500" height="300" class="aligncenter size-full wp-image-668" /></a></p>
<p>This is a beginner&#8217;s tutorial on how to use a PHP form with mysql database to save data and send email. Most of the times when we work on basic websites whether it is useful or not the client ask us to add a &#8216;Enquiry Form&#8217;. An enquiry form that sends mail to the client&#8217;s mail id. Sometimes when working on a CMS where a mysql database <em>(or any other database)</em> is used the clients require to store the enquiry form data into their database. For freelance beginners this is a huge challenge and this tutorial will make you confident next time you sign a deal.</p>
<p>This is a two part tutorial. In the first part we look at how to process the form and in the <a href="http://www.mediamilan.com/tutos/how-to-insert-data-into-mysql-database-using-php-form-and-then-send-mail-part-2/" title="Second Part of the Tutorial" target="_blank"><strong>SECOND PART</strong></a> we look at how to insert and send mail using PHP. I understand the whole crust is in the second part but if you are a beginner I strongly recommend you finish the first part and then go to the <a href="http://www.mediamilan.com/tutos/how-to-insert-data-into-mysql-database-using-php-form-and-then-send-mail-part-2/" title="Second Part of the Tutorial" target="_blank"><strong>SECOND PART</strong></a>.</p>
<p>In this tutorial we dive in deep to understand the do&#8217;s and dont&#8217;s while connecting with the MySQL database. We also learn about the naming conventions and how to increase the security of your code. Feel free to ask any questions in the comments section and we assure you that it will be cleared.</p>
<h3>Creating a PHP Form</h3>
<p>Take a look the code below. I will explain it one line at a time.</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">form</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;form&quot;</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;process.php&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span>Name *<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;enq_name&quot;</span> placeholder<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Full Name&quot;</span> required <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span>Mobile *<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;number&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;enq_mobile&quot;</span> required <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span>Email *<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;email&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;enq_email&quot;</span> required <span style="color: #66cc66;">/</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span>Message<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/label.html"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/textarea.html"><span style="color: #000000; font-weight: bold;">textarea</span></a> <span style="color: #000066;">rows</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;5&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;enq_message&quot;</span> <span style="color: #000066;">cols</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;15&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/textarea.html"><span style="color: #000000; font-weight: bold;">textarea</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/p.html"><span style="color: #000000; font-weight: bold;">p</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;enq_submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Apply Online&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">form</span></a>&gt;</span></div></div>
<p>There is nothing PHP about this form. It&#8217;s a simple straight forward HTML code. The PHP comes in later when we need to capture the data that is sent from the form.</p>
<p><a href="http://www.mediamilan.com/wp-content/uploads/2013/01/php-form-for-mysql-inset.jpg"><img src="http://www.mediamilan.com/wp-content/uploads/2013/01/php-form-for-mysql-inset.jpg" alt="" title="This is how the HTML Form looks like." width="504" height="421" class="aligncenter size-full wp-image-672" /></a></p>
<p>Let&#8217;s take a look at the line one.</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/form.html"><span style="color: #000000; font-weight: bold;">form</span></a> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;form&quot;</span> <span style="color: #000066;">method</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;post&quot;</span> <span style="color: #000066;">action</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;process.php&quot;</span>&gt;</span></div></div>
<p>We declare the &#8216;form&#8217; tag to let the browser know that we are working with a form now. Then comes the &#8216;form&#8217; class for CSS purpose. The &#8216;method&#8217; attribute is the way in which the &#8216;form&#8217; tag sends the information. There are two types of &#8216;method&#8217;, one is <a href="http://www.w3schools.com/tags/att_form_method.asp" target="_blank">&#8216;GET&#8217;</a> and second is <a href="http://www.w3schools.com/tags/att_form_method.asp" target="_blank">&#8216;POST&#8217;</a>. The &#8216;action&#8217; attribute tell the form tag where to <em>POST</em> the information. In our case we will be posting it to &#8216;process.php&#8217;.</p>
<p>From the second line on you do not require explanation if you are familiar with HTML. However there is one thing that you have to look at. Lets take a look at the line below.</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;enq_name&quot;</span> placeholder<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Full Name&quot;</span> required <span style="color: #66cc66;">/</span>&gt;</span></div></div>
<p>We create an input tag with its many attributes. The attribute to be noted here is &#8216;name&#8217;. This is very important as it acts as the <strong>key</strong> to the <strong>value</strong> entered by the user in the input tag. In simple words &#8211; consider &#8216;key&#8217; to be a container which is unique, <em>hence you cannot have two similar values for the &#8216;name&#8217; attribute</em>. A key can carry values assigned to it and this happens when the user clicks on the submit button. It is advisable to prefix the value of &#8216;name&#8217; attribute so that it does not clash with any other plugins or codes when you are working on a large project.</p>
<p>Now for the submit button.</p>
<div class="codecolorer-container html4strict railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/input.html"><span style="color: #000000; font-weight: bold;">input</span></a> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> <span style="color: #000066;">name</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;enq_submit&quot;</span> <span style="color: #000066;">value</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Apply Online&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span></div></div>
<p>Here even the submit button has a &#8216;name&#8217; attribute and a key given to it so that we can use it later.</p>
<h3>Processing a PHP form.</h3>
<p>Usually this means validating a form and then checking if the values entered have any malicious codes that will affect our database. Once we have done this we see what to do with the data that was sent via <strong>POST</strong> method.</p>
<p>This has many small steps involved. Don&#8217;t be scared its fairly simple. Let&#8217;s go one at a time. <em>(We will talk about validating the form a little later as it in itself is a huge topic and we have different ways to do that.)</em></p>
<h4>Creating the database</h4>
<p>If you do not know how to create a database kindly watch this video. </p>
<p><iframe src="http://www.youtube.com/embed/z3Aniu0rG14" frameborder="0" allowfullscreen></iframe></p>
<p>Once the database is ready it is time for us to create the tables. Check out the following video to see how a table is created in MySQL using phpMyAdmin.</p>
<p><iframe src="http://www.youtube.com/embed/IPcKR3bj_Ko" frameborder="0" allowfullscreen></iframe></p>
<p>This is our resultant table.</p>
<p><a href="http://www.mediamilan.com/wp-content/uploads/2013/01/enquiry-table-with-nodata.jpg"><img src="http://www.mediamilan.com/wp-content/uploads/2013/01/enquiry-table-with-nodata.jpg" alt="" title="Enquiry table with no data" width="891" height="389" class="aligncenter size-full wp-image-674" /></a></p>
<p><em>(Remember to prefix your column names so that they are unique and do not clash with any other columns. In this case its &#8216;nfrm&#8217; short hand for &#8216;new for&#8217;).</em></p>
<h4>Connecting to the database.</h4>
<p>As much as it sounds complicated it is fairly simple. It&#8217;s just three lines of code actually and you will be using this a lot if you are a PHP developer. So try to memorize this as it will be handy.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <br />
&nbsp; &nbsp; <span style="color: #000088;">$connection</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mysql_connect"><span style="color: #990000;">mysql_connect</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'server'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mysql_user'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mysql_password'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$connection</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Could not connect: '</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/mysql_error"><span style="color: #990000;">mysql_error</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>We use the function <strong>mysql_connect</strong> which opens a connection to the MySQL server. This function has three attributes <strong>server</strong>, <strong>mysql_user</strong>, <strong>mysql_password</strong>. Server is the location of the MySql database. Usually its &#8216;localhost&#8217;, so replace &#8216;server&#8217; with &#8216;localhost&#8217;. Then while creating the MySql database you would have created a username and password for it. Replace them in their appropriate places. (If you don&#8217;t know what they are kindly contact your hosting service provider or take a look at this video).</p>
<p>Once the MySQL connection is made we need to be able to access it. So we assign the result of <em>mysql_connect</em> function to a variable called <strong>$connection</strong>.</p>
<p>If all goes well then the connections is made. But if something goes wrong how do you find it out? We need a way to know what went wrong. Hence we do an <strong>if</strong> statement to find what went wrong. If the variable <em>$connection</em> is not set then die and print the <strong>mysql_error()</strong>. Hence the following two lines.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$connection</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/die"><span style="color: #990000;">die</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Could not connect: '</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/mysql_error"><span style="color: #990000;">mysql_error</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Thus you make a proper database connection.</p>
<h4>Fetching the POST data.</h4>
<p>Once the user clicks on submit button the HTML form sends data via the <em>POST</em> method using the <strong>$_POST</strong> global variable, in an array. Just like accessing any Array variable you access the $_POST variable too using PHP.</p>
<p>Remember the key values we set to the name attributes in the HTML form? Because we set it, its easy for us now to know the key values inside the <em>$_POST</em> array. So let start fetching the data now  and assign it to different variables.</p>
<p>Earlier when we were creating the form we had assigned name attribute to the <strong>submit</strong> button too. Well here is the reason. All HTML content are visible when we view the source of a page. So for the hackers it is easy to see where we are processing the page <em>(in our case is process.php)</em>. It is in this page that we have the username and password to out MySQL database. So it becomes a very easy target and hence the hackers usual try and manipulate the page. So as a part of security it is best practice to check where the variable has come from and then start processing the page. Another method is to store the connect details in a different PHP page and reference it in our processing page.</p>
<p>So we first check if the variable <strong>$_POST(enq_submit)</strong> has been set. If yes then we process the rest, else we just display a message asking them to use the form.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_submit'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Process the rest</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Kindly use the form to submit the data!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>Now to the processing of the <strong>$_POST</strong> global variable. Here we fetch each key value and assign it to a different variable, usually with a different prefix. We can assign to the same variable like this:</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$enq_name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></div></div>
<p>But again the hackers are aware of the key value and there are chances they manipulate it. So we change the prefix and assign them. At every point we need to be careful not to reveal any information. Hence the following code.</p>
<div class="codecolorer-container php railscasts" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:100%;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_submit'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$nfrm_name</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$nfrm_mobile</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_mobile'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$nfrm_email</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$nfrm_message</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'enq_message'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Kindly use the form to submit the data!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></div>
<p>Thank you for keeping up till now. In the <a href="http://www.mediamilan.com/tutos/how-to-insert-data-into-mysql-database-using-php-form-and-then-send-mail-part-2/" title="Second Part of the Tutorial" target="_blank"><strong>SECOND PART</strong></a> we look at how to insert and send mail using PHP. The complete crest of this tutorial is in the second part. So keep reading. </p>
<p>See you in the <a href="http://www.mediamilan.com/tutos/how-to-insert-data-into-mysql-database-using-php-form-and-then-send-mail-part-2/" title="Second Part of the Tutorial" target="_blank"><strong>SECOND PART</strong></a>. And if you have doubts kindly ping me in the comments. Thanks again for reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mediamilan.com/tutos/how-to-insert-data-into-mysql-database-using-php-form-and-then-send-mail-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oogway</title>
		<link>http://www.mediamilan.com/quotes/oogway/</link>
		<comments>http://www.mediamilan.com/quotes/oogway/#comments</comments>
		<pubDate>Sun, 06 Jan 2013 16:22:58 +0000</pubDate>
		<dc:creator>Mr. JCRP</dc:creator>
		
		<guid isPermaLink="false">http://www.mediamilan.com/?post_type=quotes&#038;p=662</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.mediamilan.com/quotes/oogway/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An exclusive encounter at an exclusive setting; An Open Letter To Whomsoever It May Concern</title>
		<link>http://www.mediamilan.com/an-exclusive-encounter-at-an-exclusive-setting-an-open-letter-to-whomsoever-it-may-concern/</link>
		<comments>http://www.mediamilan.com/an-exclusive-encounter-at-an-exclusive-setting-an-open-letter-to-whomsoever-it-may-concern/#comments</comments>
		<pubDate>Thu, 27 Dec 2012 16:07:14 +0000</pubDate>
		<dc:creator>Mr. JCRP</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.mediamilan.com/?p=654</guid>
		<description><![CDATA[This was one of those last-minute-random plans and like all last-minute plans turn out to be epic, I was hoping for the same this time around as well. I won&#8217;t say that I am not a party person, but it&#8217;s not like I visit clubs every weekend. Visiting clubs has always been a once-a-year affair....]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mediamilan.com/wp-content/uploads/2012/12/sweta-mantri.jpg"><img src="http://www.mediamilan.com/wp-content/uploads/2012/12/sweta-mantri.jpg" alt="" title="An Open Letter To Whomsoever It May Concern " width="720" height="540" class="aligncenter size-full wp-image-655" /></a></p>
<p>This was one of those last-minute-random plans and like all last-minute plans turn out to be epic, I was hoping for the same this time around as well.</p>
<p>I won&#8217;t say that I am not a party person, but it&#8217;s not like I visit clubs every weekend. Visiting clubs has always been a once-a-year affair. Moreover I was really surprised that my over-protective father allowed me for this, at a time when everybody around is doubting the security of women in our country. </p>
<p>Miami (Marriott)  is the most popular club in my city. I&#8217;ve been wanting to go to Miami, ever since I&#8217;ve come back from Mumbai; and yesterday was supposed to be The day. My cousins and I were supposed to reach the venue at 10.30 pm but got delayed by almost one and a half hour. We submitted our ID proof and were all set to have a blast.</p>
<p>The following is the conversation I had with the Manager of the club:</p>
<p><strong>Manager:</strong> Ma&#8217;am, I am arranging for a bench for you at one of the corners of the club. We request you to remain seated as it&#8217;s going to be dark and crowded. We&#8217;re really concerned about your safety and do not want you to have a fall. (This was because I walk with the help of callipers and crutches)</p>
<p><strong>Me:</strong> Hey, thank you so much for your concern and I really appreciate this. But I&#8217;ve come here to have a good time and enjoy myself, so I&#8217;d appreciate if you don&#8217;t worry about me.</p>
<p><strong>Manager:</strong> Yes Ma&#8217;am! We get your point. But, we have a protocol. We don&#8217;t even allow people with fractures inside. Let me just have a word with my senior and get back to you!</p>
<p><strong>Me:</strong> (Surprised and Speechless) OK.</p>
<p>The guy didn&#8217;t turn up for five minutes. We were supposed to get back home in an hour and wanted to get inside as soon as possible. I asked the bouncer about the status. He replied to me in Hindi saying &#8211; <em>Madam, aapko allow nahi karenge. Aap andar nahi jaa sakti</em>. Shocked at the response, I asked him to call the manager again.</p>
<p><strong>Manager:</strong> I am sorry Ma&#8217;am I cannot let you go inside.</p>
<p><strong>Me:</strong> You&#8217;ve gotta be kidding me! I&#8217;ve been to Scream, Area 51, Kue Bar and to clubs in Mumbai and Goa. I&#8217;ve been to rain dance Holi parties where it was slippery everywhere and I was all good. If I think I am not able to manage, I will come out. Let me take a call on this. I have people to take care of me and I am not going to hold you guys responsible if anything happens. I am here just for an hour. I have to be home by 1.30 am.</p>
<p><strong>Manager:</strong> This is solely for your safety purpose Ma&#8217;am. We&#8217;re really sorry.</p>
<p><strong>Me:</strong> Safety? You&#8217;re telling a 25 year old girl that she won&#8217;t be able to walk properly in a crowd just because she&#8217;s disabled? I&#8217;ve come here with my parents&#8217; permission. If they don&#8217;t have a problem with this, who are you to decide what I cannot do?  You know, I can sue you for this?    </p>
<p><strong>Manager:</strong> Ma&#8217;am please try and understand. We cannot let you in. </p>
<p>The conversation lasted for a couple of minutes more. I don&#8217;t remember what I told him. I was too shocked to even react. My cousins were standing up for me, but even they were taken aback.</p>
<p>We walked out of there. I went into the main lobby to talk to another senior manager. &#8220;I want to lodge a complaint against Miami&#8221;, I told them. I was connected to the Front Office Executive and argued with her over the issue. I told her that the fact that persons with broken hands and legs and with crutches are not allowed in the club is wrong in the first place.Secondly, if they have any such protocol, why not have it mentioned on a board or something at the entrance, so that other visitors are also aware of the fact and inform their friends accordingly. She herself did not know what to say and kept on insisting on the fact that this was for my safety.</p>
<p>My parents have never stopped me from doing anything that I like. If you&#8217;re still wondering how I dance &#8211; I groove to the music the very little that I can with the support of one crutch, moving my one hand to the beats of the dance number. I remember dancing to *Chak dhum dhum* for flat three minutes, for my cousin&#8217;s sangeet party when I was in class six. Whether it&#8217;s a wedding or a college party or a club, I cannot stop myself from doing a few matkas or jhatkas.</p>
<p>We all know the state of infrastructure for the disabled in the country. There are already very few places that an orthopedically challenged can go to independently. Five star hotels fall in the Spaces with Barrier Free Environment category; and now you&#8217;re telling me that I have restrictions applicable there as well?  </p>
<p>The Front Office Executive went on to tell me that I am free to sit anywhere else in the hotel but I cannot enter the club. I almost felt like telling her &#8211; <em>Thanks for your permission. I better be allowed to do that because I am paying you for your services</em>.</p>
<p>On second thoughts, I am wondering if I would have been allowed in the club, had I not been making the free entry on account of the Girls&#8217; Night. If the club or the hotel is so concerned about my safety, the least they could have done is to send a bouncer with me to ensure that people don&#8217;t bump into me for whatever reason.  </p>
<p>So basically, I am assuming that the club is okay with people getting drunk, falling down and doing all sorts of things inside, but they won&#8217;t allow a person with a physical challenge!  I really don&#8217;t know how to conclude this note. <strong>And, this is not about me. It is about any other disabled person, who wants to enjoy life their way.</strong></p>
<p>I am still finding it strange to come to terms with policies and protocols like these. It&#8217;s especially shocking that something like this came from a five star like Marriott. Had it been a shady dhaba or some other place, I wouldn&#8217;t have bothered to write this.</p>
<p>The next time I want to go to any restaurant, mall or club, I will ideally call them up and ask &#8211; <strong><em>&#8220;Hey, I am disabled and I am coming in on a free pass. Do I still hold the right to avail your services?&#8221;</em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mediamilan.com/an-exclusive-encounter-at-an-exclusive-setting-an-open-letter-to-whomsoever-it-may-concern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pain and Gain</title>
		<link>http://www.mediamilan.com/trailer/pain-and-gain/</link>
		<comments>http://www.mediamilan.com/trailer/pain-and-gain/#comments</comments>
		<pubDate>Thu, 27 Dec 2012 02:30:56 +0000</pubDate>
		<dc:creator>Mr. JCRP</dc:creator>
		
		<guid isPermaLink="false">http://www.mediamilan.com/?post_type=trailer&#038;p=648</guid>
		<description><![CDATA[Daniel Lugo (Mark Wahlberg) is a regular body builder who works at the Sun Gym along with his friend Adrian Doorbal (Anthony Mackie). Sick of living the poor life Lugo concocts a plan to kidnap Victor Kershaw (Tony Shalhoub), a regular at the gym and a rich spoiled business man, and extort him by means...]]></description>
			<content:encoded><![CDATA[<p>Daniel Lugo (Mark Wahlberg) is a regular body builder who works at the Sun Gym along with his friend Adrian Doorbal (Anthony Mackie). Sick of living the poor life Lugo concocts a plan to kidnap Victor Kershaw (Tony Shalhoub), a regular at the gym and a rich spoiled business man, and extort him by means of torture. With the help of recently released criminal Paul Doyle (Dwayne Johnson), the &#8216;Sun Gym Gang&#8217; successfully get Kershaw to sign over all his finances, but when Kershaw survives an attempted murder from the gang, he hires Detective Ed Du Bois (Ed Harris) to catch the criminals after the Miami Police Department fail to do so.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mediamilan.com/trailer/pain-and-gain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web and Mobile Conferences Roundup &#8211; DEC 2012</title>
		<link>http://www.mediamilan.com/web-and-mobile-conferences-roundup-dec-2012/</link>
		<comments>http://www.mediamilan.com/web-and-mobile-conferences-roundup-dec-2012/#comments</comments>
		<pubDate>Wed, 26 Dec 2012 02:30:10 +0000</pubDate>
		<dc:creator>Mr. JCRP</dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://www.mediamilan.com/?p=452</guid>
		<description><![CDATA[With the growing web &#038; mobile community, the number of conferences across the world also increases exponentially. It is practically impossible to attend all of them. So we spend hours and hours watching each video posted on the net and choose the best. And here we take time to post these best videos at the...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mediamilan.com/wp-content/uploads/2012/12/dec-2012-monthly-conference.jpg"><img src="http://www.mediamilan.com/wp-content/uploads/2012/12/dec-2012-monthly-conference.jpg" alt="" title="DEC 2012 Monthly Conference Roundup" width="724" height="466" class="aligncenter size-full wp-image-456" /></a></p>
<p>With the growing web &#038; mobile community, the number of conferences across the world also increases exponentially. It is practically impossible to attend all of them. So we spend hours and hours watching each video posted on the net and choose the best. And here we take time to post these best videos at the last week of every month so you can watch them at your leisurely pace. This bunch of videos is our installment for this month.</p>
<div class="u_line"></div>
<h3>Jeremy Keith &#8211; All Our Yesterdays</h3>
<p><iframe src="http://player.vimeo.com/video/34269615" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></p>
<p>Our communication methods have improved over time, from stone tablets, papyrus, and vellum through to the printing press and the World Wide Web. But while the web has democratised publishing, allowing anyone to share ideas with a global audience, it doesn’t appear to be the best medium for preserving our cultural resources: websites and documents disappear down the digital memory hole every day. This presentation will look at the scale of the problem and propose methods for tackling our collective data loss.<br />
Filmed at Build 2011: buildconf.com</p>
<div class="u_line"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.mediamilan.com/web-and-mobile-conferences-roundup-dec-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pune to Srivardhan</title>
		<link>http://www.mediamilan.com/travel/pune-to-srivardhan/</link>
		<comments>http://www.mediamilan.com/travel/pune-to-srivardhan/#comments</comments>
		<pubDate>Mon, 24 Dec 2012 20:15:48 +0000</pubDate>
		<dc:creator>Mr. JCRP</dc:creator>
		
		<guid isPermaLink="false">http://www.mediamilan.com/?post_type=travel&#038;p=627</guid>
		<description><![CDATA[Srivardhan is about 153kms from Pune. With a slow and neat three to four hours of drive you can reach the Srivardhan beach. Srivardhan is a very peaceful beach. Many tourists from Mumbai and Pune visit here only during the weekends. So if you want to enjoy the real beauty visit during the weekdays. It...]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.mediamilan.com/wp-content/uploads/2012/12/pune-srivardhan-10.jpg"><img src="http://www.mediamilan.com/wp-content/uploads/2012/12/pune-srivardhan-10.jpg" alt="" title="Pune to Srivardhan Bike Ride" width="1024" height="683" class="aligncenter size-full wp-image-638" /></a></p>
<p>Srivardhan is about 153kms from Pune. With a slow and neat three to four hours of drive you can reach the Srivardhan beach.</p>
<p>Srivardhan is a very peaceful beach. Many tourists from Mumbai and Pune visit here only during the weekends. So if you want to enjoy the real beauty visit during the weekdays. It is very long and lonely beach which is also very clean. There are a few beach bikes available for hire and it is run by the local people. </p>
<p>Visiting Srivardhan to watch the evening sunset can be the best thing to do if you come as couple. The localites from here also come visit the beach during the evening but it is very less. Alcohol is not encouraged here in the beach and so unlike other konkan beaches you wont see empty bottles polluting the beach. Srivardhan beach is very clean and good for a sub bath.</p>
<p>Few cottages on the shore of the sea provide food and stay. Mostly these are taken by the corporate gangs who visit during the weekend. So if you want to come here please make reservations.</p>
<p>I&#8217;m happy to have found this place because next time when I want to relax and get creative I know where to go.</p>
<p>Please click through other links on the top to see the <strong>The Gallery</strong>, <strong>How to Reach</strong> and many more&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mediamilan.com/travel/pune-to-srivardhan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kai po che!</title>
		<link>http://www.mediamilan.com/trailer/kai-po-che/</link>
		<comments>http://www.mediamilan.com/trailer/kai-po-che/#comments</comments>
		<pubDate>Sat, 22 Dec 2012 19:02:33 +0000</pubDate>
		<dc:creator>Mr. JCRP</dc:creator>
		
		<guid isPermaLink="false">http://www.mediamilan.com/?post_type=trailer&#038;p=623</guid>
		<description><![CDATA[Best friends Ishaan, Omi and Govind &#8211; young, ambitious and restless &#8211; are trying to make a mark in the India of the early 2000&#8242;s. These are exciting times &#8211; a new millennium has just dawned, India&#8217;s a nuclear power and ostensibly shining &#8211; a perfect place for the 3 Ahmedabad boys to start a...]]></description>
			<content:encoded><![CDATA[<p>Best friends Ishaan, Omi and Govind &#8211; young, ambitious and restless &#8211; are trying to make a mark in the India of the early 2000&#8242;s. These are exciting times &#8211; a new millennium has just dawned, India&#8217;s a nuclear power and ostensibly shining &#8211; a perfect place for the 3 Ahmedabad boys to start a business that could be their ticket to fame and riches. In a country where cricket is religion, they hit upon a brilliant plan &#8211; to start a training academy that could produce India&#8217;s next sporting superstars! What follows is without doubt the greatest adventure of their lives, as they attempt to navigate the big hurdles in the path of fulfilling their dreams. Based on Chetan Bhagat&#8217;s bestselling novel &#8220;The 3 Mistakes of My Life&#8221;, Kai Po Che (meaning a triumphant yell in Gujarati) is an unforgettable ode to friendship and the magical moments one shares with one&#8217;s closest pals &#8211; celebrating festivals, drunken dancing, watching cricket matches together, strategizing on how to catch the attention of the cute neighborhood girl, being there to watch each other&#8217;s back in troubled times and to celebrate one&#8217;s successes by screaming &#8220;Kai Po Che&#8221;!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mediamilan.com/trailer/kai-po-che/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Hobbit: An Unexpected Journey</title>
		<link>http://www.mediamilan.com/movies-review/the-hobbit-an-unexpected-journey/</link>
		<comments>http://www.mediamilan.com/movies-review/the-hobbit-an-unexpected-journey/#comments</comments>
		<pubDate>Fri, 21 Dec 2012 03:30:25 +0000</pubDate>
		<dc:creator>Mr. JCRP</dc:creator>
		
		<guid isPermaLink="false">http://www.mediamilan.com/?post_type=movies-review&#038;p=614</guid>
		<description><![CDATA[There are some points in the movie history where you should leave the characters and story as that it. Will you still like if Marty McFly from Back to the Future kept travelling through time and space? Or would you like to see another Indian Jones movie? Similarly the LOR trilogy was good and interesting....]]></description>
			<content:encoded><![CDATA[<p>There are some points in the movie history where you should leave the characters and story as that it. Will you still like if <em>Marty McFly</em> from <em>Back to the Future</em> kept travelling through time and space? Or would you like to see another <em>Indian Jones</em> movie? Similarly the <em>LOR</em> trilogy was good and interesting. But giving a prequel which is also a trilogy is not so cool. At least unless you have a strong story line and you have something new to show us.</p>
<p>I understand that there is show much to show and it is very difficult to show everything that is written in the book. But leaving people with questions is so irritating. This first part does exactly that. There are so many lose ends which awaits to be answered. Though the crest of the story was very small I felt it was dragged beyond need. </p>
<p>We have all seen what can happen in Lord of the Rings movie. We even saw the worst of the worst villain being defeated. I do not think there is anything much bigger than that and that is what this movie shows you too. Fairly i was disappointed. I did not like the characterization of the characters. No character stood strong including Bilbo Hobbit and the Gandalf or Thorin. </p>
<p>In few scenes where the orcs come I felt that few parts were over written to show their filth. It mean it was written deliberate to bring the yuck feeling. It did not merge with the story at all. Or rather it was again that &#8211; &#8216;we have already seen it feeling&#8217;. </p>
<p>I sure wanted to watch this movie to see whats new? To see something interesting. But nothing was there. Every time there was a CG shot invariably it is always dark and we can&#8217;t see any details which was irritating. You won&#8217;t believe but there were few scenes where I almost feel asleep. The climax fight is a testimony for that. They come out of the caves where there is good sunlight and suddenly when the villian comes in it is night. Please people&#8230; to hide the mistakes in CGI do not take night as your ally. </p>
<p>This is a small message to Peter Jackson. I understand your love for Lord of the Rings and J.R.R. Tolkien, but please do something new. We have seen enough from LOR world and we would love to read the book if we need to know anything more. You have raised the bar to great heights with Tin Tin and Avatar. Now it is time for your Weta studio to do something bigger. </p>
<p>As for the fans out there I would suggest this. If you like LOR trilogy and would like to savor those memories do not watch this movie has got nothing. I would suggest you to read the book instead. Its much better. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.mediamilan.com/movies-review/the-hobbit-an-unexpected-journey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
