<?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>Bagesh Singh&#039;s Blog &#187; Php interview question</title>
	<atom:link href="http://www.bageshsingh.com/bagesh-blog/category/interview-question/php-interview-question/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bageshsingh.com/bagesh-blog</link>
	<description>Shortest Distance to  Web Solutions &#38; Software Solutions</description>
	<lastBuildDate>Wed, 22 Feb 2012 18:42:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to optimize php code.</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/09/how-to-optimize-php-code/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/09/how-to-optimize-php-code/#comments</comments>
		<pubDate>Fri, 02 Sep 2011 20:40:19 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Php interview question]]></category>
		<category><![CDATA[As a last resort]]></category>
		<category><![CDATA[Avoid calling the dl() function]]></category>
		<category><![CDATA[Avoid mod_access if you can]]></category>
		<category><![CDATA[best of luck. What is the process for PHP code Optimisation]]></category>
		<category><![CDATA[big and small - they slow things down]]></category>
		<category><![CDATA[Compress your output to save network bandwidth]]></category>
		<category><![CDATA[Don't fret about Apache 2.0]]></category>
		<category><![CDATA[Don't rely on references without testing; they are rarely as effective as you'd think]]></category>
		<category><![CDATA[Get a good understanding of how garbage collection works]]></category>
		<category><![CDATA[How to optimize php code]]></category>
		<category><![CDATA[In this post we are going to learn how to optimize our php code]]></category>
		<category><![CDATA[Listen to all errors]]></category>
		<category><![CDATA[Optimise compilation of your PHP binary if possible]]></category>
		<category><![CDATA[Pre-increment where possible]]></category>
		<category><![CDATA[Priorities optimisation of tight loops for the most payback]]></category>
		<category><![CDATA[Store a local pointer to an array element to save indexing into the array each time you need it]]></category>
		<category><![CDATA[try inlining function]]></category>
		<category><![CDATA[Try to avoid using PHP in CGI mode]]></category>
		<category><![CDATA[Use persistent resource where appropriate]]></category>
		<category><![CDATA[Use the comma operator to join arguments when calling echo]]></category>
		<category><![CDATA[Use the Zend Optimizer and a code cache]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1629</guid>
		<description><![CDATA[In this post we are  going to learn how to optimize our php code. once you optimize your php code then your applicationa and website will be very fast this will make quality code. Hi php programmer don&#8217;t forget these rules if you want to be good in php and want to work in MNC [...]]]></description>
			<content:encoded><![CDATA[<p>In this post we are  going to learn how to optimize our php code.</p>
<p>once you optimize your php code then your applicationa and website will be very fast<br />
this will make quality code. Hi php programmer don&#8217;t forget these rules if you want to<br />
be good in php and want to work in MNC because all mnc and all good companies follow<br />
these rules strictly even this is gud question for interview for php. best of luck.</p>
<p>What is the process for PHP code Optimisation.</p>
<p>Use the Zend Optimizer and a code cache</p>
<p>Use the comma operator to join arguments when calling echo</p>
<p>Priorities optimisation of tight loops for the most payback</p>
<p>Pre-increment where possible</p>
<p>Don&#8217;t rely on references without testing; they are rarely as effective as you&#8217;d think</p>
<p>Get a good understanding of how garbage collection works</p>
<p>Listen to all errors, big and small &#8211; they slow things down</p>
<p>Store a local pointer to an array element to save indexing into the array each time you need it</p>
<p>Compress your output to save network bandwidth</p>
<p>Try to avoid using PHP in CGI mode</p>
<p>Avoid calling the dl() function</p>
<p>Use persistent resource where appropriate</p>
<p>Optimise compilation of your PHP binary if possible</p>
<p>Avoid mod_access if you can</p>
<p>Don&#8217;t fret about Apache 2.0</p>
<p>As a last resort, try inlining function</p>
<div id="seo_alrp_related"><h2>Posts Related to How to optimize php code.</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/09/how-to-optimize-mysql-query-and-mysql-database/" rel="bookmark">How to optimize mysql query and mysql database?</a></h3><p>There is lots of way to optimize mysql. once you optimize your query and database of mysql it will make your website and application very ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-make-controller-without-a-model-in-cakephp/" rel="bookmark">How To Make Controller Without a Model in cakephp ?</a></h3><p>class MyController extends AppController {     // var $uses = null; works too     var $uses = array();     function index()     {     } } If you omit the ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/09/programmer-vs-company-how-any-programmer-will-feel-secure-in-company/" rel="bookmark">Programmer VS Company : How any programmer will feel secure in Company?</a></h3><p>Programmer VS Company All of friends I am going to share my Experience about the company and Programmer ,what I feel in last 7 Years ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/inserting-multiple-rows-in-cakephp/" rel="bookmark">Inserting Multiple Rows in Cakephp</a></h3><p>I had a situation where I needed to iterate through a list of items and insert new rows for each. I quickly discovered that if ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/04/using-custom-table-for-custom-module-in-magento/" rel="bookmark">Using Custom Table for Custom Module in Magento</a></h3><p>If you want to create a custom module in Magento that has something to do with storing data into a custom table and using that ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/09/how-to-optimize-php-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Please explain .frm .myd .myi in mysql?</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/please-explain-frm-myd-myi-in-mysql/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/please-explain-frm-myd-myi-in-mysql/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 18:40:02 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql interview question]]></category>
		<category><![CDATA[Php interview question]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1599</guid>
		<description><![CDATA[Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type. The â€˜.frmâ€™ file stores the table definition. The data file has a â€˜.MYDâ€™ (MYData) extension. The index file has a â€˜.MYIâ€™ (MYIndex) extension. Posts Related to [...]]]></description>
			<content:encoded><![CDATA[<p>Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the<br />
file type.</p>
<ul>
<li>The â€˜.frmâ€™ file stores the table definition.</li>
<li>The data file has a â€˜.MYDâ€™ (MYData) extension.</li>
<li>The index file has a â€˜.MYIâ€™ (MYIndex) extension.</li>
</ul>
<div id="seo_alrp_related"><h2>Posts Related to Please explain .frm .myd .myi in mysql? </h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/05/how-do-you-install-an-extension-in-joomla/" rel="bookmark">How do you install an extension in joomla?</a></h3><p>Before starting it always is wise to read the documentation associated with an extension. Most extensions have homepages and forums, and it is a good ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/what-is-maximum-size-of-a-database-in-mysql/" rel="bookmark">What is maximum size of a database in MySQL?</a></h3><p>If the operating system or filesystem places a limit on the number of files in a directory, MySQL is bound by that constraint.The efficiency of ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/05/php-ftp-functions-list/" rel="bookmark">PHP FTP Functions List</a></h3><p>ftp_cdup — Changes to the parent directory ftp_chdir — Changes directories on a FTP server ftp_close — Closes an FTP connection ftp_connect — Opens an ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/manage-server-hard-disk-using-php/" rel="bookmark">Manage Server Hard Disk Using PHP</a></h3><p>PHP provides some sweet functions to manage the server's hard disk. Here's how to use them. copy() Copies a file from a source file. $result ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/create-a-csv-file-from-mysql-with-php/" rel="bookmark">Create a CSV file from MySQL with PHP</a></h3><p>There are a couple of ways to export data from MySQL to a CSV file but neither of them supports adding a header row to ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/please-explain-frm-myd-myi-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Is the Difference Between Mysql_Connect() and Mysql_Pconnect()?</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/what-is-the-difference-between-mysql_connect-and-mysql_pconnect/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/what-is-the-difference-between-mysql_connect-and-mysql_pconnect/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 18:38:11 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql interview question]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Php interview question]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1591</guid>
		<description><![CDATA[When they are using mysql_connect() function, every time it is opening and closing the database connection, depending on the request . mysql_connect() and mysql_pconnect() both are working for database connection but with small difference. In mysql_pconnect(), â€˜pâ€™ stands for persistence connection. But in case of mysql_pconnect() function, first, when connecting, the function would try to [...]]]></description>
			<content:encoded><![CDATA[<p>When they are using mysql_connect() function, every time it is opening and closing the database connection, depending on the request .</p>
<p>mysql_connect() and mysql_pconnect() both are working for database connection but with small difference. In mysql_pconnect(), â€˜pâ€™ stands for persistence connection.</p>
<p>But in case of mysql_pconnect() function,<br />
first, when connecting, the function would try to find a (persistent) connection thatâ€™s already open with the same host, username and password. If three is found, an identifier for it will be returned in lieu of opening a new connection.<br />
Second, the connection to the SQL server won’t be closed when the execution of the script ends. In lieu, the connection will remain open for future use (mysql_close() won’t close connection established by mysql_pconnect()).</p>
<p>Mysql_pconncet() is useful when you have a lot of traffic on your site. At that time for every request it won’t open a connection but will take it from the pool. This will increase the efficiency of your site. But for general use mysql_connect() is best.</p>
<div id="seo_alrp_related"><h2>Posts Related to What Is the Difference Between Mysql_Connect() and Mysql_Pconnect()? </h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/05/php-ftp-functions-list/" rel="bookmark">PHP FTP Functions List</a></h3><p>ftp_cdup — Changes to the parent directory ftp_chdir — Changes directories on a FTP server ftp_close — Closes an FTP connection ftp_connect — Opens an ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/05/php-oracle-function-list/" rel="bookmark">PHP Oracle Function List</a></h3><p>Ora_Bind — bind a PHP variable to an Oracle parameter Ora_Close — close an Oracle cursor Ora_ColumnName — get name of Oracle result column Ora_ColumnSize ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-make-dsn-and-dsn-less-connections/" rel="bookmark">How to make DSN and DSN-less connections</a></h3><p>DSN stands for 'Data Source Name'. It is an easy way to assign useful and easily rememberable names to data sources which may not be ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/05/php-mysql-functions-list/" rel="bookmark">PHP Mysql Functions List</a></h3><p>mysql_affected_rows — Get number of affected rows in previous MySQL operation mysql_change_user — Change logged in user of the active connection mysql_client_encoding — Returns the ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/03/advanced-integration-method-aim/" rel="bookmark">Advanced Integration Method (AIM)</a></h3><p>AIM is Authorize.Net's recommended connection method and offers the most secure and flexible integration. AIM allows merchants to host their own secure payment form and ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/what-is-the-difference-between-mysql_connect-and-mysql_pconnect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Connect to MySQL Database Using PHP?</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-connect-to-mysql-database-using-php/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-connect-to-mysql-database-using-php/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 18:37:25 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql interview question]]></category>
		<category><![CDATA[Php interview question]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1589</guid>
		<description><![CDATA[&#60;?php $username = "your_name"; $password = "your password"; $hostname = "localhost"; $dbname = "database name"; //Connection to the MySql Database $dbhandle = mysql_connect($hostname, $username, $password)  or die("Unable to connect to MySQL"); mysql_select_db("$dbname",$db); echo "Connected to MySQL"; ?&#62; Posts Related to How to Connect to MySQL Database Using PHP? PHP: Export Database Schema as XMLSometimes it [...]]]></description>
			<content:encoded><![CDATA[<div>
<div><code>&lt;?php</code></div>
<div><code>$username</code> <code>= </code><code>"your_name"</code><code>;</code></div>
<div><code>$password</code> <code>= </code><code>"your password"</code><code>;</code></div>
<div><code>$hostname</code> <code>= </code><code>"localhost"</code><code>;</code></div>
<div><code>$dbname</code> <code>= </code><code>"database name"</code><code>;</code></div>
<div></div>
<div><code>//Connection to the MySql Database</code></div>
<div><code>$dbhandle</code> <code>= mysql_connect(</code><code>$hostname</code><code>, </code><code>$username</code><code>, </code><code>$password</code><code>)</code></div>
<div><code> </code><code>or</code> <code>die</code><code>(</code><code>"Unable to connect to MySQL"</code><code>);</code></div>
<div><code>mysql_select_db(</code><code>"$dbname"</code><code>,</code><code>$db</code><code>);</code></div>
<div></div>
<div><code>echo</code> <code>"Connected to MySQL"</code><code>;</code></div>
<div><code>?&gt;</code></div>
</div>
<div id="seo_alrp_related"><h2>Posts Related to How to Connect to MySQL Database Using PHP? </h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/php-export-database-schema-as-xml/" rel="bookmark">PHP: Export Database Schema as XML</a></h3><p>Sometimes it can be useful to have a dump of the current database schema. The script below reads the schema from a MySQL database and outputs ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/how-can-i-retrieve-values-from-one-database-server-and-store-them-in-other-database-server-using-php/" rel="bookmark">How Can I Retrieve Values from One Database Server and Store them in Other Database Server Using PHP?</a></h3><p>We can always fetch from one database and rewrite to another. Here is a very simple solution. 1 2 3 4 5 6 7 $db1 ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/load-json-data-with-jquery-php-and-mysql/" rel="bookmark">Load JSON data with jQuery, PHP and MySQL</a></h3><p>This post shows how to populate a select box based on the value of the another, by getting JSON data with jQuery from a PHP ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-encrypt-passwords-in-the-database/" rel="bookmark">How to Encrypt Passwords in the Database</a></h3><p>If you are developing a password-protected web site, you have to make a decision about how to store user password information securely. What is "secure," ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/05/php-mysql-functions-list/" rel="bookmark">PHP Mysql Functions List</a></h3><p>mysql_affected_rows — Get number of affected rows in previous MySQL operation mysql_change_user — Change logged in user of the active connection mysql_client_encoding — Returns the ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-connect-to-mysql-database-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CURL URLS with a get variable</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-urls-with-a-get-variable/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-urls-with-a-get-variable/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 18:34:19 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[cURL PHP]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Php interview question]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1580</guid>
		<description><![CDATA[I had the following experience when harvesting urls with a get variable from a page using cUrl. HTML pages will output ampersands as &#38;amp when the page is read by the curl function. If you code a script to find all hyperlinks, it will use &#38;amp instead of &#38;, especially using a regular expression search. [...]]]></description>
			<content:encoded><![CDATA[<p>I had the following experience when harvesting urls with a get variable from a page using cUrl. HTML pages will output ampersands as &amp;amp when the page is read by the curl function.</p>
<p>If you code a script to find all hyperlinks, it will use &amp;amp instead of &amp;, especially using a regular expression search.</p>
<p>It is hard to detect because when you output the url to the browser it renders the html. To fix, add a line to replace the &amp;amp with &amp;.</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
</td>
<td>
<div>
<div><code>&lt;?php</code></div>
<div><code>function</code> <code>processURL(</code><code>$url</code><code>){</code></div>
<div><code>    </code><code>$url</code><code>=</code><code>str_replace</code><code>(</code><code>'&amp;amp;'</code><code>,</code><code>'&amp;'</code><code>,</code><code>$url</code><code>);</code></div>
<div><code>    </code><code>$ch</code><code>=curl_init();</code></div>
<div><code>    </code><code>curl_setopt(</code><code>$ch</code><code>, CURLOPT_URL, </code><code>$url</code><code>);</code></div>
<div><code>    </code><code>curl_setopt (</code><code>$ch</code><code>, CURLOPT_RETURNTRANSFER, 1);</code></div>
<div><code>    </code><code>$xml</code> <code>= curl_exec (</code><code>$ch</code><code>);</code></div>
<div><code>    </code><code>curl_close (</code><code>$ch</code><code>);</code></div>
<div><code>    </code><code>echo</code> <code>$xml</code><code>;</code></div>
<div><code>}</code></div>
<div><code>?&gt;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
<div id="seo_alrp_related"><h2>Posts Related to CURL URLS with a get variable</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/example-download-website-webpage-trough-curl-php/" rel="bookmark">Example: Download Website / Webpage Trough CURL PHP</a></h3><p>You can access / display any webpage through the following code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/simple-curl-php-example/" rel="bookmark">Simple CURL PHP Example</a></h3><p>Following code returns the curl output as a string. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/curl-php-email-this-page-to-a-friend/" rel="bookmark">CURL PHP: Email this page to a friend</a></h3><p>Using curl to take snapshots of the current page for emailing the HTML is a clever little idea. (ie: Email this page to a friend) ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/disadvantage-of-curl-library-php-example/" rel="bookmark">Disadvantage of cURL Library PHP example</a></h3><p>Although it has been noted that cURL outperforms both file_get_contents and fopen when it comes to getting a file over a HTTP link, the disadvantage ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/05/php-curl-functions-list/" rel="bookmark">PHP Curl Functions List</a></h3><p>curl_close — Close a CURL session curl_errno — Return an integer containing the last error number curl_error — Return a string containing the last error ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-urls-with-a-get-variable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CURL PHP wrapper for https results</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-php-wrapper-for-https-results/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-php-wrapper-for-https-results/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 18:33:52 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[cURL PHP]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Php interview question]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1578</guid>
		<description><![CDATA[If you want to write a sort of php wrapper to include the results of another http(s) request maybe pointing to a totally different site or just different code (mod_perl with HTML::Mason, in my case) into a php based layout, and just pass-thru all GET and POST variables to the sub-request, the following snippet can [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to write a sort of php wrapper to include the results of another http(s) request maybe pointing to a totally different site or just different code (mod_perl with HTML::Mason, in my case) into a php based layout, and just pass-thru all GET and POST variables to the sub-request, the following snippet can be used. Note there is no error handling, so this is subject to the underlying application.</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
</td>
<td>
<div>
<div><code>&lt;?php</code></div>
<div><code>$ch</code> <code>= curl_init(</code><code>$sub_req_url</code><code>);</code></div>
<div><code>$encoded</code> <code>= </code><code>''</code><code>;</code></div>
<div><code>// include GET as well as POST variables; your needs may vary.</code></div>
<div><code>foreach</code><code>(</code><code>$_GET</code> <code>as</code> <code>$name</code> <code>=&gt; </code><code>$value</code><code>) {</code></div>
<div><code>  </code><code>$encoded</code> <code>.= urlencode(</code><code>$name</code><code>).</code><code>'='</code><code>.urlencode(</code><code>$value</code><code>).</code><code>'&amp;'</code><code>;</code></div>
<div><code>}</code></div>
<div><code>foreach</code><code>(</code><code>$_POST</code> <code>as</code> <code>$name</code> <code>=&gt; </code><code>$value</code><code>) {</code></div>
<div><code>  </code><code>$encoded</code> <code>.= urlencode(</code><code>$name</code><code>).</code><code>'='</code><code>.urlencode(</code><code>$value</code><code>).</code><code>'&amp;'</code><code>;</code></div>
<div><code>}</code></div>
<div><code>// chop off last ampersand</code></div>
<div><code>$encoded</code> <code>= </code><code>substr</code><code>(</code><code>$encoded</code><code>, 0, </code><code>strlen</code><code>(</code><code>$encoded</code><code>)-1);</code></div>
<div><code>curl_setopt(</code><code>$ch</code><code>, CURLOPT_POSTFIELDS,  </code><code>$encoded</code><code>);</code></div>
<div><code>curl_setopt(</code><code>$ch</code><code>, CURLOPT_HEADER, 0);</code></div>
<div><code>curl_setopt(</code><code>$ch</code><code>, CURLOPT_POST, 1);</code></div>
<div><code>curl_exec(</code><code>$ch</code><code>);</code></div>
<div><code>curl_close(</code><code>$ch</code><code>);</code></div>
<div><code>?&gt;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
<div id="seo_alrp_related"><h2>Posts Related to CURL PHP wrapper for https results </h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/05/php-url-functions-list/" rel="bookmark">PHP URL Functions List</a></h3><p>base64_decode — Decodes data encoded with MIME base64 base64_encode — Encodes data with MIME base64 parse_url — Parse a URL and return its components rawurldecode ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/what-are-the-advantages-of-curl-library/" rel="bookmark">What Are the Advantages of CURL Library?</a></h3><p>PHP supports libcurl is a library that allows you to connect and communicate to many different types of servers with many different types of protocols. ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/curl-php-connect-to-a-secure-server/" rel="bookmark">cURL PHP: Connect to a Secure Server</a></h3><p>If you want to connect to a secure server for posting info/reading info, you need to make cURL with the openSSL options. Then the sequence ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/curl-to-submit-to-an-aspaspx-page/" rel="bookmark">cURL to submit to an ASP/ASPX page</a></h3><p>For anyone trying to use cURL to submit to an ASP/ASPX page that uses an image as the submit button. Make sure that you have ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2010/11/load-json-data-with-jquery-php-and-mysql/" rel="bookmark">Load JSON data with jQuery, PHP and MySQL</a></h3><p>This post shows how to populate a select box based on the value of the another, by getting JSON data with jQuery from a PHP ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-php-wrapper-for-https-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CURL PHP: Get information regarding a specific transfercurl_getinfo â€” Get information regarding a specific transfer – curl_getinfo()</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-php-get-information-regarding-a-specific-transfercurl_getinfo-ae%e2%80%9d-get-information-regarding-a-specific-transfer-%e2%80%93-curl_getinfo/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-php-get-information-regarding-a-specific-transfercurl_getinfo-ae%e2%80%9d-get-information-regarding-a-specific-transfer-%e2%80%93-curl_getinfo/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 18:33:25 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[cURL PHP]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Php interview question]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1576</guid>
		<description><![CDATA[&#60;?php // Create a curl handle $ch = curl_init('http://www.yahoo.com/'); // Execute curl_exec($ch); // Check if any error occured if(!curl_errno($ch)) {  $info = curl_getinfo($ch);  echo 'Took ' . $info['total_time'] . ' seconds to send a request to ' . $info['url']; } // Close handle curl_close($ch); ?&#62; Posts Related to CURL PHP: Get information regarding a specific [...]]]></description>
			<content:encoded><![CDATA[<div>
<div><code>&lt;?php</code></div>
<div><code>// Create a curl handle</code></div>
<div><code>$ch</code> <code>= curl_init(</code><code>'<a href="http://www.yahoo.com/">http://www.yahoo.com/</a>'</code><code>);</code></div>
<div></div>
<div><code>// Execute</code></div>
<div><code>curl_exec(</code><code>$ch</code><code>);</code></div>
<div></div>
<div><code>// Check if any error occured</code></div>
<div><code>if</code><code>(!curl_errno(</code><code>$ch</code><code>))</code></div>
<div><code>{</code></div>
<div><code> </code><code>$info</code> <code>= curl_getinfo(</code><code>$ch</code><code>);</code></div>
<div></div>
<div><code> </code><code>echo</code> <code>'Took '</code> <code>. </code><code>$info</code><code>[</code><code>'total_time'</code><code>] . </code><code>' seconds to send a request to '</code> <code>. </code><code>$info</code><code>[</code><code>'url'</code><code>];</code></div>
<div><code>}</code></div>
<div></div>
<div><code>// Close handle</code></div>
<div><code>curl_close(</code><code>$ch</code><code>);</code></div>
<div><code>?&gt;</code></div>
</div>
<div id="seo_alrp_related"><h2>Posts Related to CURL PHP: Get information regarding a specific transfercurl_getinfo â€” Get information regarding a specific transfer – curl_getinfo() </h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/05/php-curl-functions-list/" rel="bookmark">PHP Curl Functions List</a></h3><p>curl_close — Close a CURL session curl_errno — Return an integer containing the last error number curl_error — Return a string containing the last error ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/a-simple-whoisdomain-availability-check-using-curl-php/" rel="bookmark">A simple whois/domain availability check using cURL PHP</a></h3><p>CURL Register Your domain but check its availability: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/simple-curl-php-example/" rel="bookmark">Simple CURL PHP Example</a></h3><p>Following code returns the curl output as a string. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/example-download-website-webpage-trough-curl-php/" rel="bookmark">Example: Download Website / Webpage Trough CURL PHP</a></h3><p>You can access / display any webpage through the following code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/curl-php-trouble-on-server-2003-iis-6-php_curl/" rel="bookmark">CURL PHP : Trouble on server 2003, IIS 6 php_curl</a></h3><p>run (as an administrator) php.exe -i &gt; C:\phpinfo.txt and go open C:\phpinfo.txt, look in the file to see if CURL was loading, if it’s there ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-php-get-information-regarding-a-specific-transfercurl_getinfo-ae%e2%80%9d-get-information-regarding-a-specific-transfer-%e2%80%93-curl_getinfo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Example: Download Website / Webpage Trough CURL PHP</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/example-download-website-webpage-trough-curl-php/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/example-download-website-webpage-trough-curl-php/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 18:33:04 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[cURL PHP]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Php interview question]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1574</guid>
		<description><![CDATA[You can access / display any webpage through the following code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 [...]]]></description>
			<content:encoded><![CDATA[<p>You can access / display any webpage through the following code:</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
<div>19</div>
<div>20</div>
<div>21</div>
<div>22</div>
<div>23</div>
<div>24</div>
<div>25</div>
<div>26</div>
<div>27</div>
<div>28</div>
<div>29</div>
<div>30</div>
<div>31</div>
<div>32</div>
<div>33</div>
<div>34</div>
<div>35</div>
<div>36</div>
<div>37</div>
<div>38</div>
<div>39</div>
<div>40</div>
<div>41</div>
<div>42</div>
<div>43</div>
<div>44</div>
<div>45</div>
<div>46</div>
<div>47</div>
<div>48</div>
</td>
<td>
<div>
<div><code>&lt;?php</code></div>
<div><code>    </code><code>echo</code> <code>DownloadUrl(</code><code>'<a href="http://www.imjan.com/">http://www.imjan.com</a>'</code><code>); // Type Website URL to download</code></div>
<div></div>
<div><code>    </code><code>function</code> <code>DownloadUrl(</code><code>$Url</code><code>){</code></div>
<div></div>
<div><code>            </code><code>// is curl installed?</code></div>
<div><code>            </code><code>if</code> <code>(!function_exists(</code><code>'curl_init'</code><code>)){</code></div>
<div><code>                    </code><code>die</code><code>(</code><code>'CURL is not installed!'</code><code>);</code></div>
<div><code>            </code><code>}</code></div>
<div></div>
<div><code>            </code><code>// create a new curl resource</code></div>
<div><code>            </code><code>$ch</code> <code>= curl_init();</code></div>
<div></div>
<div><code>            </code><code>/*</code></div>
<div><code>            </code><code>Here you find more options for curl:</code></div>
<div></div>
<div><code><a href="http://www.php.net/curl_setopt">http://www.php.net/curl_setopt</a></code></div>
<div></div>
<div><code>            </code><code>*/</code></div>
<div></div>
<div><code>            </code><code>// set URL to download</code></div>
<div><code>            </code><code>curl_setopt(</code><code>$ch</code><code>, CURLOPT_URL, </code><code>$Url</code><code>);</code></div>
<div></div>
<div><code>            </code><code>// set referer:</code></div>
<div><code>            </code><code>curl_setopt(</code><code>$ch</code><code>, CURLOPT_REFERER, </code><code>"<a href="http://www.google.com/">http://www.google.com/</a>"</code><code>);</code></div>
<div></div>
<div><code>            </code><code>// user agent:</code></div>
<div><code>            </code><code>curl_setopt(</code><code>$ch</code><code>, CURLOPT_USERAGENT, </code><code>"MozillaXYZ/1.0"</code><code>);</code></div>
<div></div>
<div><code>            </code><code>// remove header? 0 = yes, 1 = no</code></div>
<div><code>            </code><code>curl_setopt(</code><code>$ch</code><code>, CURLOPT_HEADER, 0);</code></div>
<div></div>
<div><code>            </code><code>// should curl return or print the data? true = return, false = print</code></div>
<div><code>            </code><code>curl_setopt(</code><code>$ch</code><code>, CURLOPT_RETURNTRANSFER, true);</code></div>
<div></div>
<div><code>            </code><code>// timeout in seconds</code></div>
<div><code>            </code><code>curl_setopt(</code><code>$ch</code><code>, CURLOPT_TIMEOUT, 10);</code></div>
<div></div>
<div><code>            </code><code>// download the given URL, and return output</code></div>
<div><code>            </code><code>$output</code> <code>= curl_exec(</code><code>$ch</code><code>);</code></div>
<div></div>
<div><code>            </code><code>// close the curl resource, and free system resources</code></div>
<div><code>            </code><code>curl_close(</code><code>$ch</code><code>);</code></div>
<div></div>
<div><code>            </code><code>// print output</code></div>
<div><code>            </code><code>return</code> <code>$output</code><code>;</code></div>
<div><code>    </code><code>}</code></div>
<div><code>?&gt;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
<div id="seo_alrp_related"><h2>Posts Related to Example: Download Website / Webpage Trough CURL PHP</h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/simple-curl-php-example/" rel="bookmark">Simple CURL PHP Example</a></h3><p>Following code returns the curl output as a string. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/05/php-curl-functions-list/" rel="bookmark">PHP Curl Functions List</a></h3><p>curl_close — Close a CURL session curl_errno — Return an integer containing the last error number curl_error — Return a string containing the last error ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/curl-urls-with-a-get-variable/" rel="bookmark">CURL URLS with a get variable</a></h3><p>I had the following experience when harvesting urls with a get variable from a page using cUrl. HTML pages will output ampersands as &amp;amp when ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/disadvantage-of-curl-library-php-example/" rel="bookmark">Disadvantage of cURL Library PHP example</a></h3><p>Although it has been noted that cURL outperforms both file_get_contents and fopen when it comes to getting a file over a HTTP link, the disadvantage ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/a-simple-whoisdomain-availability-check-using-curl-php/" rel="bookmark">A simple whois/domain availability check using cURL PHP</a></h3><p>CURL Register Your domain but check its availability: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/example-download-website-webpage-trough-curl-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CURL PHP: Email this page to a friend</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-php-email-this-page-to-a-friend/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-php-email-this-page-to-a-friend/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 18:32:29 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[cURL PHP]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Php interview question]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1572</guid>
		<description><![CDATA[Using curl to take snapshots of the current page for emailing the HTML is a clever little idea. (ie: Email this page to a friend) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 &#60;?php //to be explained below! session_write_close(); $pageurl = "http://www.site.com/content.php?PHPSESSID=123XYZ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); [...]]]></description>
			<content:encoded><![CDATA[<p>Using curl to take snapshots of the current page for emailing the HTML is a clever little idea. (ie: Email this page to a friend)</p>
<div>
<div id="highlighter_396792">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
<div>8</div>
<div>9</div>
<div>10</div>
<div>11</div>
<div>12</div>
<div>13</div>
<div>14</div>
<div>15</div>
<div>16</div>
<div>17</div>
<div>18</div>
</td>
<td>
<div>
<div><code>&lt;?php</code></div>
<div><code>//to be explained below!</code></div>
<div><code>session_write_close();</code></div>
<div></div>
<div><code>$pageurl</code> <code>= "http:</code><code>//www.site.com/content.php?PHPSESSID=123XYZ</code></div>
<div><code>curl_setopt(</code><code>$ch</code><code>, CURLOPT_RETURNTRANSFER, 1);</code></div>
<div></div>
<div><code>curl_setopt (</code><code>$ch</code><code>, CURLOPT_URL, </code><code>$pageurl</code> <code>);</code></div>
<div><code>$html</code> <code>= curl_exec ( </code><code>$ch</code> <code>);</code></div>
<div><code>curl_close(</code><code>$ch</code><code>);</code></div>
<div></div>
<div><code>//then you need to fix pathing to absolute</code></div>
<div><code>$search</code> <code>= </code><code>"/(src|href|background)="</code><code>[^:,^&gt;,^\</code><code>"]*\"/i"</code><code>;</code></div>
<div></div>
<div><code>preg_match_all ( </code><code>$search</code><code>, </code><code>$html</code><code>, </code><code>$a_matches</code> <code>);</code></div>
<div></div>
<div><code>//you can figure out the rest ! but thought the reg expression is useful as well</code></div>
<div><code>?&gt;</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>But here is the catch, you may want to make sure curl connects to the server under the same session as the browser. So naturally you pass the session cookie through the curl system either by the cookie jar system, or through the query string in the path.</p>
<p>This is where you will get stuck. PHP will need write access to the same session file simultaneously!! causing serious hanging issues!</p>
<p>This is why you should close off your session before you make curl take a page snapshot!</p>
<div id="seo_alrp_related"><h2>Posts Related to CURL PHP: Email this page to a friend </h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/05/php-curl-functions-list/" rel="bookmark">PHP Curl Functions List</a></h3><p>curl_close — Close a CURL session curl_errno — Return an integer containing the last error number curl_error — Return a string containing the last error ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/curl-urls-with-a-get-variable/" rel="bookmark">CURL URLS with a get variable</a></h3><p>I had the following experience when harvesting urls with a get variable from a page using cUrl. HTML pages will output ampersands as &amp;amp when ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/curl-php-trouble-on-server-2003-iis-6-php_curl/" rel="bookmark">CURL PHP : Trouble on server 2003, IIS 6 php_curl</a></h3><p>run (as an administrator) php.exe -i &gt; C:\phpinfo.txt and go open C:\phpinfo.txt, look in the file to see if CURL was loading, if it’s there ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/03/how-to-do-file-uploading-using-php-curl/" rel="bookmark">how to do File Uploading Using PHP Curl</a></h3><p>File uploading through PHP Curl is very simple. You just have to append @ in front of path of file name &amp; send it to ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-get-the-current-page-url/" rel="bookmark">How to Get the Current Page URL</a></h3><p>Sometimes, you might want to get the current page URL that is shown in the browser URL window. For example if you want to let ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-php-email-this-page-to-a-friend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cURL to submit to an ASP/ASPX page</title>
		<link>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-to-submit-to-an-aspaspx-page/</link>
		<comments>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-to-submit-to-an-aspaspx-page/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 18:31:58 +0000</pubDate>
		<dc:creator>Bagesh Singh</dc:creator>
				<category><![CDATA[cURL PHP]]></category>
		<category><![CDATA[Interview Question]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Php interview question]]></category>

		<guid isPermaLink="false">http://www.bageshsingh.com/bagesh-blog/?p=1570</guid>
		<description><![CDATA[For anyone trying to use cURL to submit to an ASP/ASPX page that uses an image as the submit button. Make sure that you have ‘button_name.x’ and ‘button_name.y’ in the post fields. PHP names these fields ‘button_name_x’ and ‘button_name_y’, while ASP uses a dot. Also, as noted above, be sure to include the ‘__VIEWSTATE’ input [...]]]></description>
			<content:encoded><![CDATA[<p>For anyone trying to use cURL to submit to an ASP/ASPX page that uses an image as the submit button.</p>
<p>Make sure that you have ‘button_name.x’ and ‘button_name.y’ in the post fields. PHP names these fields ‘button_name_x’ and ‘button_name_y’, while ASP uses a dot.</p>
<p>Also, as noted above, be sure to include the ‘__VIEWSTATE’ input field in your post request.</p>
<div id="seo_alrp_related"><h2>Posts Related to cURL to submit to an ASP/ASPX page </h2><ul><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/03/how-to-do-file-uploading-using-php-curl/" rel="bookmark">how to do File Uploading Using PHP Curl</a></h3><p>File uploading through PHP Curl is very simple. You just have to append @ in front of path of file name &amp; send it to ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/how-to-disable-the-enter-key-on-html-form/" rel="bookmark">How to disable the Enter key on HTML form</a></h3><p>Normally when you have a form with several text input fields, it is undesirable that the form gets submitted when the user hits ENTER in ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/05/php-curl-functions-list/" rel="bookmark">PHP Curl Functions List</a></h3><p>curl_close — Close a CURL session curl_errno — Return an integer containing the last error number curl_error — Return a string containing the last error ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/jquery-cakephp-%e2%80%93-enabling-submit-button-if-text-entered/" rel="bookmark">JQUERY cakePHP – Enabling submit button if text entered</a></h3><p>jQuery code snippet: 1 2 3 4 5 6 7 $('#username').keyup(function() {     if ($('#username').val() != '') {         $('#submit').removeAttr('disabled');     } else {         $('#submit').attr('disabled', 'disabled');     } }); ...</p></div></li><li><div class="seo_alrp_rl_content"><h3><a href="http://www.bageshsingh.com/bagesh-blog/2011/08/using-javascript-to-post-data-between-pages/" rel="bookmark">Using Javascript to POST Data Between Pages</a></h3><p>The following is a simple example of how to submit data from one HTML page to another using the POST method from Javascript. Normally, if ...</p></div></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.bageshsingh.com/bagesh-blog/2011/08/curl-to-submit-to-an-aspaspx-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

