<?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>A lot Information</title>
	<atom:link href="http://www.network-content.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.network-content.com</link>
	<description>There are everything from everywhere</description>
	<lastBuildDate>Wed, 18 Jan 2012 00:04:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Linux Delete All Files In Directory</title>
		<link>http://www.network-content.com/linux-delete-all-files-in-directory/</link>
		<comments>http://www.network-content.com/linux-delete-all-files-in-directory/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 00:04:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.network-content.com/?p=116</guid>
		<description><![CDATA[This command delete all files in current directory: 1 sudo rm -rf * sudo rm -rf * &#160;]]></description>
			<content:encoded><![CDATA[<p>This command delete all files in current directory:</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="c">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
</pre>
</td>
<td class="de1">
<pre class="de1">sudo rm <span class="sy0">-</span>rf <span class="sy0">*</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">sudo rm -rf *</pre>
</div>
</div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.network-content.com/linux-delete-all-files-in-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>URL’s Content Using PHP cURL</title>
		<link>http://www.network-content.com/urls-content-using-php-curl/</link>
		<comments>http://www.network-content.com/urls-content-using-php-curl/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 17:56:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cURL]]></category>
		<category><![CDATA[file_get_contents]]></category>
		<category><![CDATA[get content]]></category>

		<guid isPermaLink="false">http://www.network-content.com/?p=105</guid>
		<description><![CDATA[Downloading content at a specific URL is common practice on the internet, especially due to increased usage of web services and APIs offered by Amazon, Alexa, Digg, etc. PHP&#8217;s cURL library, which often comes with default shared hosting configurations, allows web developers to complete this task. The Code: The Usage: Alternatively, you can use the [...]]]></description>
			<content:encoded><![CDATA[<p>Downloading content at a specific URL is common practice on the internet, especially due to increased usage of web services and APIs offered by Amazon, Alexa, Digg, etc. PHP&#8217;s cURL library, which often comes with default shared hosting configurations, allows web developers to complete this task.<br />
<strong>The Code:</strong></p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="php">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
</pre>
</td>
<td class="de1">
<pre class="de1"><span class="coMULTI">/* gets the data from a URL */</span>
<span class="kw2">function</span> get_data<span class="br0">&#40;</span><span class="re0">$url</span><span class="br0">&#41;</span>
<span class="br0">&#123;</span>
&nbsp; <span class="re0">$ch</span> <span class="sy0">=</span> <span class="kw3">curl_init</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp; <span class="re0">$timeout</span> <span class="sy0">=</span> <span class="nu0">5</span><span class="sy0">;</span>
&nbsp; <span class="kw3">curl_setopt</span><span class="br0">&#40;</span><span class="re0">$ch</span><span class="sy0">,</span>CURLOPT_URL<span class="sy0">,</span><span class="re0">$url</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp; <span class="kw3">curl_setopt</span><span class="br0">&#40;</span><span class="re0">$ch</span><span class="sy0">,</span>CURLOPT_RETURNTRANSFER<span class="sy0">,</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp; <span class="kw3">curl_setopt</span><span class="br0">&#40;</span><span class="re0">$ch</span><span class="sy0">,</span>CURLOPT_CONNECTTIMEOUT<span class="sy0">,</span><span class="re0">$timeout</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp; <span class="re0">$data</span> <span class="sy0">=</span> <span class="kw3">curl_exec</span><span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp; <span class="kw3">curl_close</span><span class="br0">&#40;</span><span class="re0">$ch</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp; <span class="kw1">return</span> <span class="re0">$data</span><span class="sy0">;</span>
<span class="br0">&#125;</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">/* gets the data from a URL */
function get_data($url)
{
  $ch = curl_init();
  $timeout = 5;
  curl_setopt($ch,CURLOPT_URL,$url);
  curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
  $data = curl_exec($ch);
  curl_close($ch);
  return $data;
}</pre>
</div>
</div>
<p><strong>The Usage:</strong></p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="php">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
</pre>
</td>
<td class="de1">
<pre class="de1"><span class="re0">$returned_content</span> <span class="sy0">=</span> get_data<span class="br0">&#40;</span><span class="st_h">'http://davidwalsh.name'</span><span class="br0">&#41;</span><span class="sy0">;</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">$returned_content = get_data('http://davidwalsh.name');</pre>
</div>
</div>
<p>Alternatively, you can use the <a title="file_get_contents" href="http://php.net/file_get_contents" target="_blank">file_get_contents</a> function remotely, but many hosts don&#8217;t allow this.</p>
<p>Info from: <a title="http://davidwalsh.name" href="http://davidwalsh.name" target="_blank">http://davidwalsh.name </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.network-content.com/urls-content-using-php-curl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP File Upload Tutorial</title>
		<link>http://www.network-content.com/php-file-upload-tutorial/</link>
		<comments>http://www.network-content.com/php-file-upload-tutorial/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 23:09:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php script]]></category>

		<guid isPermaLink="false">http://www.network-content.com/?p=101</guid>
		<description><![CDATA[This tutorial will demonstrate how to handle file uploads in PHP. We will create a simple XHTML form with a file field, and a PHP script that handles the form submission by moving the uploaded file to a designated directory. This tutorial assumes you are using PHP 4.4.0 or higher. XHTML for the File Upload [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial will demonstrate how to handle file uploads in PHP. We will create a simple XHTML form with a file field, and a PHP script that handles the form submission by moving the uploaded file to a designated directory. This tutorial assumes you are using PHP 4.4.0 or higher.</p>
<p>XHTML for the File Upload Form</p>
<p>The XHTML code for the file field is simply an input field with the type attribute set to &#8220;file&#8221;, and the name attribute set to an arbitrary value. The value provided for the name attribute will be used to identify the uploaded file in our PHP script after the form is submitted. In addition, the containing form tag must have the enctype attribute set to &#8220;multipart/form-data&#8221; in order for it to work correctly. There is also an optional hidden field for the maximum file size, appropriately named MAX_FILE_SIZE. Note that the MAX_FILE_SIZE parameter can be easily circumvented via a cross-site request forgery. Therefore, the code that handles the uploaded file should always perform a separate check of file size, independent of the MAX_FILE_SIZE parameter.</p>
<p>Below is an example form that can be used to accept the file. This form assumes that the script that will handle the upload is named &#8220;upload.php&#8221;.</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="html4strict">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
2
3
4
5
6
7
8
</pre>
</td>
<td class="de1">
<pre class="de1"><span class="sc2">&lt;<span class="kw2">form</span> <span class="kw3">enctype</span><span class="sy0">=</span><span class="st0">&quot;multipart/form-data&quot;</span> <span class="kw3">action</span><span class="sy0">=</span><span class="st0">&quot;upload.php&quot;</span></span>
<span class="sc2">&nbsp; &nbsp; <span class="kw3">method</span><span class="sy0">=</span><span class="st0">&quot;post&quot;</span>&gt;</span>
<span class="sc2">&lt;<span class="kw2">input</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;hidden&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;MAX_FILE_SIZE&quot;</span></span>
<span class="sc2">&nbsp; &nbsp; <span class="kw3">value</span><span class="sy0">=</span><span class="st0">&quot;50000&quot;</span> <span class="sy0">/</span>&gt;</span>
Select a File:<span class="sc2">&lt;<span class="kw2">br</span> <span class="sy0">/</span>&gt;</span>
<span class="sc2">&lt;<span class="kw2">input</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;file&quot;</span> <span class="kw3">size</span><span class="sy0">=</span><span class="st0">&quot;20&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;thefile&quot;</span> <span class="sy0">/</span>&gt;&lt;<span class="kw2">br</span> <span class="sy0">/</span>&gt;</span>
<span class="sc2">&lt;<span class="kw2">input</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;submit&quot;</span> <span class="kw3">name</span><span class="sy0">=</span><span class="st0">&quot;Submit&quot;</span> <span class="kw3">value</span><span class="sy0">=</span><span class="st0">&quot;Submit&quot;</span> <span class="sy0">/</span>&gt;</span>
<span class="sc2">&lt;<span class="sy0">/</span><span class="kw2">form</span>&gt;</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">&lt;form enctype="multipart/form-data" action="upload.php"
	method="post"&gt;
&lt;input type="hidden" name="MAX_FILE_SIZE"
	value="50000" /&gt;
Select a File:&lt;br /&gt;
&lt;input type="file" size="20" name="thefile" /&gt;&lt;br /&gt;
&lt;input type="submit" name="Submit" value="Submit" /&gt;
&lt;/form&gt;</pre>
</div>
</div>
<p>PHP Code for the File Upload Handler</p>
<p>Information about the uploaded file is stored in the $_FILES array. The name of the file field on the page determines the key of the uploaded file in this array, e.g. $_FILES['thefile'].</p>
<p>Our PHP code will check the $_FILES array for the key corresponding to the name of the file field in the form we created above. If the key exists, the file upload handling logic will be performed.</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="php">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
2
3
</pre>
</td>
<td class="de1">
<pre class="de1"><span class="kw1">if</span><span class="br0">&#40;</span><span class="kw3">array_key_exists</span><span class="br0">&#40;</span><span class="st_h">'thefile'</span><span class="sy0">,</span> <span class="re0">$_FILES</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; <span class="co1">// Handle the uploaded file here</span>
<span class="br0">&#125;</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">if(array_key_exists('thefile', $_FILES)) {
	// Handle the uploaded file here
}</pre>
</div>
</div>
<p>The handler script must check a number of conditions in order to validate the submission. It should confirm that a file was actually selected, that the file does not exceed maximum acceptable size, and that the PHP engine itself did not encounter an error while handling the file.</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="php">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre>
</td>
<td class="de1">
<pre class="de1"><span class="kw1">if</span><span class="br0">&#40;</span><span class="kw3">array_key_exists</span><span class="br0">&#40;</span><span class="st_h">'thefile'</span><span class="sy0">,</span> <span class="re0">$_FILES</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp;
<span class="co1">// Validate the uploaded file</span>
<span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'thefile'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'size'</span><span class="br0">&#93;</span> <span class="sy0">===</span> <span class="nu0">0</span>
<span class="sy0">||</span> <span class="kw3">empty</span><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'thefile'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'tmp_name'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; <span class="kw1">echo</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;p&gt;No file was selected.&lt;/p&gt;<span class="es1">\r</span><span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'thefile'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'size'</span><span class="br0">&#93;</span> <span class="sy0">&gt;</span> <span class="nu0">50000</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; <span class="kw1">echo</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;p&gt;The file was too large.&lt;/p&gt;<span class="es1">\r</span><span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'thefile'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'error'</span><span class="br0">&#93;</span> <span class="sy0">!==</span> UPLOAD_ERR_OK<span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; <span class="co1">// There was a PHP error</span>
&nbsp; &nbsp; <span class="kw1">echo</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;p&gt;There was an error uploading.&lt;/p&gt;<span class="es1">\r</span><span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; <span class="co1">// Do the rest of the file handling here</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="br0">&#125;</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">if(array_key_exists('thefile', $_FILES)) {

// Validate the uploaded file
if($_FILES['thefile']['size'] === 0
|| empty($_FILES['thefile']['tmp_name'])) {
    echo("&lt;p&gt;No file was selected.&lt;/p&gt;\r\n");
} else if($_FILES['thefile']['size'] &gt; 50000) {
    echo("&lt;p&gt;The file was too large.&lt;/p&gt;\r\n");
} else if($_FILES['thefile']['error'] !== UPLOAD_ERR_OK) {
    // There was a PHP error
    echo("&lt;p&gt;There was an error uploading.&lt;/p&gt;\r\n");
} else {
	// Do the rest of the file handling here
}

}</pre>
</div>
</div>
<p>Each item in the $_FILES array is itself an array representing various attributes of the uploaded file. If a file was not selected for the corresponding field, the &#8220;size&#8221; item will be zero, and the &#8220;tmp_name&#8221; item will be empty.</p>
<p>Assuming a successful upload, the &#8220;size&#8221; item will contain the actual size of the uploaded file in bytes. The &#8220;tmp_name&#8221; item will contain the name of the temporary file where the upload was saved. The handler script must move the temporary file to another location, otherwise the PHP engine will delete the file upon completion of the request.</p>
<p>The &#8220;error&#8221; item will contain a code reflecting the status of the upload. If the upload was successful, it will return the constant UPLOAD_ERR_OK. The list of possible error codes can be found in the PHP Manual.</p>
<p>Lastly, our example script must move the uploaded file to another directory. The code below will create a destination directory named &#8220;uploads&#8221; if it does not exist, and call the PHP function move_uploaded_file() to move the file to that directory.</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="php">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">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
</pre>
</td>
<td class="de1">
<pre class="de1"><span class="kw1">if</span><span class="br0">&#40;</span><span class="kw3">array_key_exists</span><span class="br0">&#40;</span><span class="st_h">'thefile'</span><span class="sy0">,</span> <span class="re0">$_FILES</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp;
<span class="co1">// Validate the uploaded file</span>
<span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'thefile'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'size'</span><span class="br0">&#93;</span> <span class="sy0">===</span> <span class="nu0">0</span>
<span class="sy0">||</span> <span class="kw3">empty</span><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'thefile'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'tmp_name'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; <span class="kw1">echo</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;p&gt;No file was selected.&lt;/p&gt;<span class="es1">\r</span><span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'thefile'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'size'</span><span class="br0">&#93;</span> <span class="sy0">&gt;</span> <span class="nu0">50000</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; <span class="kw1">echo</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;p&gt;The file was too large.&lt;/p&gt;<span class="es1">\r</span><span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'thefile'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'error'</span><span class="br0">&#93;</span> <span class="sy0">!==</span> UPLOAD_ERR_OK<span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; <span class="co1">// There was a PHP error</span>
&nbsp; &nbsp; <span class="kw1">echo</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;p&gt;There was an error uploading.&lt;/p&gt;<span class="es1">\r</span><span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
&nbsp;
<span class="co1">// Create uploads directory if necessary</span>
<span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span><span class="kw3">file_exists</span><span class="br0">&#40;</span><span class="st_h">'uploads'</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw3">mkdir</span><span class="br0">&#40;</span><span class="st_h">'uploads'</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// Move the file</span>
<span class="kw1">if</span><span class="br0">&#40;</span><span class="kw3">move_uploaded_file</span><span class="br0">&#40;</span><span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'thefile'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'tmp_name'</span><span class="br0">&#93;</span><span class="sy0">,</span>
<span class="st_h">'uploads/'</span> <span class="sy0">.</span> <span class="re0">$_FILES</span><span class="br0">&#91;</span><span class="st_h">'thefile'</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="st_h">'name'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; <span class="kw1">echo</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;p&gt;File uploaded successfully!&lt;/p&gt;<span class="es1">\r</span><span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span>
&nbsp; &nbsp; <span class="kw1">echo</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;p&gt;There was an error moving the file.&lt;/p&gt;<span class="es1">\r</span><span class="es1">\n</span>&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="br0">&#125;</span>
&nbsp;
<span class="br0">&#125;</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">if(array_key_exists('thefile', $_FILES)) {

// Validate the uploaded file
if($_FILES['thefile']['size'] === 0
|| empty($_FILES['thefile']['tmp_name'])) {
    echo("&lt;p&gt;No file was selected.&lt;/p&gt;\r\n");
} else if($_FILES['thefile']['size'] &gt; 50000) {
    echo("&lt;p&gt;The file was too large.&lt;/p&gt;\r\n");
} else if($_FILES['thefile']['error'] !== UPLOAD_ERR_OK) {
    // There was a PHP error
    echo("&lt;p&gt;There was an error uploading.&lt;/p&gt;\r\n");
} else {

// Create uploads directory if necessary
if(!file_exists('uploads')) mkdir('uploads');

// Move the file
if(move_uploaded_file($_FILES['thefile']['tmp_name'],
'uploads/' . $_FILES['thefile']['name'])) {
    echo("&lt;p&gt;File uploaded successfully!&lt;/p&gt;\r\n");
} else {
    echo("&lt;p&gt;There was an error moving the file.&lt;/p&gt;\r\n");
}

}

}</pre>
</div>
</div>
<p>Make sure to use the move_uploaded_file() function rather than one of the general purpose file handling functions, as this function will perform a security check to confirm that the specified file is in fact a valid uploaded file.</p>
<p>Hopefully this tutorial has given you a good idea of how file uploads are handled in PHP. Please note that this simple example code is provided for learning purposes only. When allowing uploads on a public website, you would probably want to add some form of authorization, and filter the types of files being uploaded.</p>
<p>Info from: <a title="http://www.dbscripts.net" href="http://www.dbscripts.net" target="_blank">http://www.dbscripts.net </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.network-content.com/php-file-upload-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website Thumbnail Generator PHP Script</title>
		<link>http://www.network-content.com/php-thumbnail-generator-script/</link>
		<comments>http://www.network-content.com/php-thumbnail-generator-script/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 22:58:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.network-content.com/?p=97</guid>
		<description><![CDATA[&#160;  Requirements: Windows hosting PHP GD library (installed on most hostings) Permissions to execute third-party applications (i.e. exe files) Permissions to execute Internet Explorer How it works: Website Thumbnail Generator checks if it already has website image in the cache, and shows it in the browser. If no cached image then IECapt would be run [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p><strong> Requirements:</strong><br />
Windows hosting<br />
PHP GD library (installed on most hostings)<br />
Permissions to execute third-party applications (i.e. exe files)<br />
Permissions to execute Internet Explorer</p>
<p><strong>How it works:</strong><br />
Website Thumbnail Generator checks if it already has website image in the cache, and shows it in the browser.<br />
If no cached image then IECapt would be run from the script.<br />
IECapt would run Internet Explorer, grab full sized website screenshot from it, and save image into the folder you specified in script settings.<br />
Then Website Thumbnail Generator would resize image, and show it in the browser.</p>
<p><a href="http://www.network-content.com/wp-content/uploads/2012/01/webthumb.zip">Download script here: webthumb</a></p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="php">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
</pre>
</td>
<td class="de1">
<pre class="de1"><span class="kw2">&lt;?php</span>
<span class="co2">###############################################################</span>
<span class="co2"># Website Thumbnail Image Generator 1.1</span>
<span class="co2">###############################################################</span>
<span class="co2"># Visit http://www.zubrag.com/scripts/ for updates</span>
<span class="co2">###############################################################</span>
<span class="co2">#</span>
<span class="co2"># REQUIREMENTS:</span>
<span class="co2"># PHP 4.0.6 and GD 2.0.1 or later</span>
<span class="co2"># May not work with GIFs if GD2 library installed on your server</span>
<span class="co2"># does not support GIF functions in full</span>
<span class="co2">#</span>
<span class="co2"># Parameters that can be passed via url (if not passed will be used values which are set below):</span>
<span class="co2"># url - url of the target website</span>
<span class="co2"># x - max width</span>
<span class="co2"># y - max height</span>
<span class="co2"># q - quality (applicable only to JPG, 1 to 100, 100 - best)</span>
<span class="co2">#</span>
<span class="co2"># Sample usage:</span>
<span class="co2"># 1. webthumb.php?url=http://www.microsoft.com</span>
<span class="co2"># 2. Set maximum thumbnail size to 150</span>
<span class="co2"># &nbsp; &nbsp;webthumb.php?url=http://www.thumbnails.com&amp;x=150&amp;y=150</span>
<span class="co2">###############################################################</span>
&nbsp;
<span class="co1">// Folder to save all thumbnails.</span>
<span class="co1">// Must end with slash!!!</span>
<span class="re0">$thumbnails_folder</span> <span class="sy0">=</span> <span class="st_h">'Z:/home/localhost/www/thumb/cache/'</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// thumbnails expiration time in minutes</span>
<span class="re0">$cache_expire_time</span> <span class="sy0">=</span> <span class="nu0">60</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// quality (for jpeg only)</span>
<span class="re0">$image_quality</span> <span class="sy0">=</span> <span class="nu0">100</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// resulting image type (1 = GIF, 2 = JPG, 3 = PNG)</span>
<span class="re0">$image_type</span> <span class="sy0">=</span> <span class="nu0">3</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// maximum thumb side size</span>
<span class="re0">$max_x</span> <span class="sy0">=</span> <span class="nu0">100</span><span class="sy0">;</span>
<span class="re0">$max_y</span> <span class="sy0">=</span> <span class="nu0">100</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// If not equal 0 then cut original image size before resizing (in pixels).</span>
<span class="co1">// Long page will have bad thumbnail, its better to cut page length first.</span>
<span class="re0">$cut_x</span> <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span>
<span class="re0">$cut_y</span> <span class="sy0">=</span> <span class="nu0">1024</span><span class="sy0">;</span>
&nbsp;
<span class="co2">###############################################################################</span>
<span class="co2"># END OF SETTINGS. DO NOT EDIT BELOW</span>
<span class="co2">###############################################################################</span>
&nbsp;
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">isset</span><span class="br0">&#40;</span><span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st_h">'url'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; <span class="re0">$website_url</span> <span class="sy0">=</span> <span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st_h">'url'</span><span class="br0">&#93;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="kw1">else</span> <span class="br0">&#123;</span>
&nbsp; <span class="kw3">die</span><span class="br0">&#40;</span><span class="st0">&quot;Site URL must be specified.&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$image_type</span> <span class="sy0">==</span> <span class="nu0">1</span><span class="br0">&#41;</span> <span class="re0">$output_format</span> <span class="sy0">=</span> <span class="st_h">'gif'</span><span class="sy0">;</span>
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$image_type</span> <span class="sy0">==</span> <span class="nu0">2</span><span class="br0">&#41;</span> <span class="re0">$output_format</span> <span class="sy0">=</span> <span class="st_h">'jpg'</span><span class="sy0">;</span>
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$image_type</span> <span class="sy0">==</span> <span class="nu0">3</span><span class="br0">&#41;</span> <span class="re0">$output_format</span> <span class="sy0">=</span> <span class="st_h">'png'</span><span class="sy0">;</span>
&nbsp;
<span class="re0">$website_url_md5</span> <span class="sy0">=</span> <span class="kw3">md5</span><span class="br0">&#40;</span><span class="re0">$website_url</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="re0">$cached_filename</span> <span class="sy0">=</span> <span class="re0">$thumbnails_folder</span> <span class="sy0">.</span> <span class="re0">$website_url_md5</span> <span class="sy0">.</span> <span class="st_h">'.'</span> <span class="sy0">.</span> <span class="re0">$output_format</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// See if we have cached website screenshot image (to minimize server load)</span>
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="kw3">file_exists</span><span class="br0">&#40;</span><span class="re0">$cached_filename</span><span class="br0">&#41;</span>
<span class="sy0">||</span> <span class="kw3">filemtime</span> <span class="br0">&#40;</span><span class="re0">$cached_filename</span><span class="br0">&#41;</span> <span class="sy0">+</span> <span class="re0">$cache_expire_time</span> <span class="sy0">*</span> <span class="nu0">60</span> <span class="sy0">&lt;</span> <span class="kw3">time</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp;
&nbsp; <span class="co1">// Get website image and save it on the server.</span>
&nbsp; <span class="sy0">@</span><span class="kw3">exec</span><span class="br0">&#40;</span><span class="st_h">'IECapt.exe '</span> <span class="sy0">.</span> <span class="kw3">escapeshellarg</span><span class="br0">&#40;</span><span class="re0">$website_url</span><span class="br0">&#41;</span> <span class="sy0">.</span> <span class="st_h">' '</span> <span class="sy0">.</span> <span class="kw3">escapeshellarg</span><span class="br0">&#40;</span><span class="re0">$cached_filename</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="br0">&#125;</span> <span class="co1">// if (!file_exists</span>
&nbsp;
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="kw3">file_exists</span><span class="br0">&#40;</span><span class="re0">$cached_filename</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp; <span class="kw3">die</span><span class="br0">&#40;</span><span class="st0">&quot;Thumbnail Generation Error. Thumbnail not created.&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="co1">// create class instance</span>
<span class="kw1">include</span><span class="br0">&#40;</span><span class="st0">&quot;image.class.php&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="re0">$img</span> <span class="sy0">=</span> <span class="kw2">new</span> Zubrag_image<span class="sy0">;</span>
&nbsp;
<span class="co1">// get parameters</span>
<span class="re0">$img</span><span class="sy0">-&gt;</span><span class="me1">image_type</span> &nbsp; <span class="sy0">=</span> <span class="re0">$image_type</span><span class="sy0">;</span>
<span class="re0">$img</span><span class="sy0">-&gt;</span><span class="me1">quality</span> &nbsp; &nbsp; &nbsp;<span class="sy0">=</span> <span class="kw3">isset</span><span class="br0">&#40;</span><span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st_h">'q'</span><span class="br0">&#93;</span><span class="br0">&#41;</span> ? <span class="kw3">intval</span><span class="br0">&#40;</span><span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st_h">'q'</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">:</span> <span class="re0">$image_quality</span><span class="sy0">;</span>
<span class="re0">$img</span><span class="sy0">-&gt;</span><span class="me1">max_x</span> &nbsp; &nbsp; &nbsp; &nbsp;<span class="sy0">=</span> <span class="kw3">isset</span><span class="br0">&#40;</span><span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st_h">'x'</span><span class="br0">&#93;</span><span class="br0">&#41;</span> ? <span class="kw3">intval</span><span class="br0">&#40;</span><span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st_h">'x'</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">:</span> <span class="re0">$max_x</span><span class="sy0">;</span>
<span class="re0">$img</span><span class="sy0">-&gt;</span><span class="me1">max_y</span> &nbsp; &nbsp; &nbsp; &nbsp;<span class="sy0">=</span> <span class="kw3">isset</span><span class="br0">&#40;</span><span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st_h">'y'</span><span class="br0">&#93;</span><span class="br0">&#41;</span> ? <span class="kw3">intval</span><span class="br0">&#40;</span><span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st_h">'y'</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="sy0">:</span> <span class="re0">$max_y</span><span class="sy0">;</span>
<span class="re0">$img</span><span class="sy0">-&gt;</span><span class="me1">save_to_file</span> <span class="sy0">=</span> <span class="kw4">false</span><span class="sy0">;</span>
<span class="re0">$img</span><span class="sy0">-&gt;</span><span class="me1">cut_x</span> &nbsp; &nbsp; &nbsp; &nbsp;<span class="sy0">=</span> <span class="re0">$cut_x</span><span class="sy0">;</span>
<span class="re0">$img</span><span class="sy0">-&gt;</span><span class="me1">cut_y</span> &nbsp; &nbsp; &nbsp; &nbsp;<span class="sy0">=</span> <span class="re0">$cut_y</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// generate thumbnail and show it</span>
<span class="re0">$img</span><span class="sy0">-&gt;</span><span class="me1">GenerateThumbFile</span><span class="br0">&#40;</span><span class="re0">$cached_filename</span><span class="sy0">,</span> <span class="st_h">''</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="sy1">?&gt;</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">&lt;?php
###############################################################
# Website Thumbnail Image Generator 1.1
###############################################################
# Visit http://www.zubrag.com/scripts/ for updates
###############################################################
#
# REQUIREMENTS:
# PHP 4.0.6 and GD 2.0.1 or later
# May not work with GIFs if GD2 library installed on your server
# does not support GIF functions in full
#
# Parameters that can be passed via url (if not passed will be used values which are set below):
# url - url of the target website
# x - max width
# y - max height
# q - quality (applicable only to JPG, 1 to 100, 100 - best)
#
# Sample usage:
# 1. webthumb.php?url=http://www.microsoft.com
# 2. Set maximum thumbnail size to 150
#    webthumb.php?url=http://www.thumbnails.com&amp;x=150&amp;y=150
###############################################################

// Folder to save all thumbnails.
// Must end with slash!!!
$thumbnails_folder = 'Z:/home/localhost/www/thumb/cache/';

// thumbnails expiration time in minutes
$cache_expire_time = 60;

// quality (for jpeg only)
$image_quality = 100;

// resulting image type (1 = GIF, 2 = JPG, 3 = PNG)
$image_type = 3;

// maximum thumb side size
$max_x = 100;
$max_y = 100;

// If not equal 0 then cut original image size before resizing (in pixels).
// Long page will have bad thumbnail, its better to cut page length first.
$cut_x = 0;
$cut_y = 1024;

###############################################################################
# END OF SETTINGS. DO NOT EDIT BELOW
###############################################################################

if (isset($_REQUEST['url'])) {
  $website_url = $_REQUEST['url'];
}
else {
  die("Site URL must be specified.");
}

if ($image_type == 1) $output_format = 'gif';
if ($image_type == 2) $output_format = 'jpg';
if ($image_type == 3) $output_format = 'png';

$website_url_md5 = md5($website_url);

$cached_filename = $thumbnails_folder . $website_url_md5 . '.' . $output_format;

// See if we have cached website screenshot image (to minimize server load)
if (!file_exists($cached_filename)
|| filemtime ($cached_filename) + $cache_expire_time * 60 &lt; time() ) {

  // Get website image and save it on the server.
  @exec('IECapt.exe ' . escapeshellarg($website_url) . ' ' . escapeshellarg($cached_filename));

} // if (!file_exists

if (!file_exists($cached_filename)) {
  die("Thumbnail Generation Error. Thumbnail not created.");
}

// create class instance
include("image.class.php");
$img = new Zubrag_image;

// get parameters
$img-&gt;image_type   = $image_type;
$img-&gt;quality      = isset($_REQUEST['q']) ? intval($_REQUEST['q']) : $image_quality;
$img-&gt;max_x        = isset($_REQUEST['x']) ? intval($_REQUEST['x']) : $max_x;
$img-&gt;max_y        = isset($_REQUEST['y']) ? intval($_REQUEST['y']) : $max_y;
$img-&gt;save_to_file = false;
$img-&gt;cut_x        = $cut_x;
$img-&gt;cut_y        = $cut_y;

// generate thumbnail and show it
$img-&gt;GenerateThumbFile($cached_filename, '');

?&gt;</pre>
</div>
</div>
<p>Info from: <a title="http://www.zubrag.com" href="http://www.zubrag.com" target="_blank">http://www.zubrag.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.network-content.com/php-thumbnail-generator-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UNIX File Permissions Tutorial</title>
		<link>http://www.network-content.com/unix-file-permissions-tutorial/</link>
		<comments>http://www.network-content.com/unix-file-permissions-tutorial/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 22:48:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.network-content.com/?p=94</guid>
		<description><![CDATA[Understanding file permissions on Unix: a brief tutorial (For files on AFS fileservers, see below) Every user on a Unix system has a unique username, and is a member of at least one group (the primary group for that user). This group information is held in the password file (/etc/passwd). A user can also be [...]]]></description>
			<content:encoded><![CDATA[<h2>Understanding file permissions on Unix: a brief tutorial<br />
(For files on AFS fileservers, see below)</h2>
<p>Every user on a Unix system has a unique username, and is a member of at least one group (the primary group for that user). This group information is held in the password file (/etc/passwd). A user can also be a member of one or more other groups. The auxiliary group information is held in the file /etc/group. Only the administrator can create new groups or add/delete group members (one of the shortcomings of the system).</p>
<p>Every directory and file on the system has an owner, and also an associated group. It also has a set of permission flags which specify separate read, write and execute permissions for the &#8216;user&#8217; (owner), &#8216;group&#8217;, and &#8216;other&#8217; (everyone else with an account on the computer) The &#8216;ls&#8217; command shows the permissions and group associated with files when used with the -l option. On some systems (e.g. Coos), the &#8216;-g&#8217; option is also needed to see the group information.</p>
<p>An example of the output produced by &#8216;ls -l&#8217; is shown below.<br />
drwx&#8212;&#8212; 2 richard staff 2048 Jan 2 1997 private<br />
drwxrws&#8212; 2 richard staff 2048 Jan 2 1997 admin<br />
-rw-rw&#8212;- 2 richard staff 12040 Aug 20 1996 admin/userinfo<br />
drwxr-xr-x 3 richard user 2048 May 13 09:27 public<br />
Understanding how to read this output is useful to all unix users, but especially people using group access permissions.</p>
<p>Field 1: a set of ten permission flags.<br />
Field 2: link count (don&#8217;t worry about this)<br />
Field 3: owner of the file<br />
Field 4: associated group for the file<br />
Field 5: size in bytes<br />
Field 6-8: date of last modification (format varies, but always 3 fields)<br />
Field 9: name of file (possibly with path, depending on how ls was called)</p>
<p>The permission flags are read as follows (left to right) position Meaning<br />
1 directory flag, &#8216;d&#8217; if a directory, &#8216;-&#8217; if a normal file, something else occasionally may appear here for special devices.<br />
2,3,4 read, write, execute permission for User (Owner) of file<br />
5,6,7 read, write, execute permission for Group<br />
8,9,10 read, write, execute permission for Other<br />
value Meaning<br />
- in any position means that flag is not set<br />
r file is readable by owner, group or other<br />
w file is writeable. On a directory, write access means you can add or delete files<br />
x file is executable (only for programs and shell scripts &#8211; not useful for data files). Execute permission on a directory means you can list the files in that directory<br />
s in the place where &#8216;x&#8217; would normally go is called the set-UID or set-groupID flag.</p>
<p>On an executable program with set-UID or set-groupID, that program runs with the effective permissions of its owner or group.<br />
For a directory, the set-groupID flag means that all files created inside that directory will inherit the group of the directory. Without this flag, a file takes on the primary group of the user creating the file. This property is important to people trying to maintain a directory as group accessible. The subdirectories also inherit the set-groupID property.</p>
<p>The default file permissions (umask):<br />
Each user has a default set of permissions which apply to all files created by that user, unless the software explicitly sets something else. This is often called the &#8216;umask&#8217;, after the command used to change it. It is either inherited from the login process, or set in the .cshrc or .login file which configures an individual account, or it can be run manually.</p>
<p>Typically the default configuration is equivalent to typing &#8216;umask 22&#8242; which produces permissions of:<br />
-rw-r&#8211;r&#8211; for regular files, or<br />
drwxr-xr-x for directories.<br />
In other words, user has full access, everyone else (group and other) has read access to files, lookup access to directories.</p>
<p>When working with group-access files and directories, it is common to use &#8216;umask 2&#8242; which produces permissions of:<br />
-rw-rw-r&#8211; for regular files, or<br />
drwxrwxr-x for directories.<br />
For private work, use &#8216;umask 77&#8242; which produces permissions:<br />
-rw&#8212;&#8212;- for regular files, or<br />
drwx&#8212;&#8212; for directories.<br />
The logic behind the number given to umask is not intuitive.</p>
<p>The command to change the permission flags is &#8220;chmod&#8221;. Only the owner of a file can change its permissions.</p>
<p>The command to change the group of a file is &#8220;chgrp&#8221;. Only the owner of a file can change its group, and can only change it to a group of which he is a member.</p>
<p>See the online manual pages for details of these commands on any particular system (e.g. &#8220;man chmod&#8221;).</p>
<p>Examples of typical useage are given below:</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="c">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
</pre>
</td>
<td class="de1">
<pre class="de1">chmod g<span class="sy0">+</span>w myfile</pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">chmod g+w myfile</pre>
</div>
</div>
<p>give group write permission to &#8220;myfile&#8221;, leaving all other permission flags alone</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="c">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
</pre>
</td>
<td class="de1">
<pre class="de1"> chmod g<span class="sy0">-</span>rw myfile </pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse"> chmod g-rw myfile </pre>
</div>
</div>
<p>remove read and write access to &#8220;myfile&#8221;, leaving all other permission flags alone</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="c">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
</pre>
</td>
<td class="de1">
<pre class="de1">chmod g<span class="sy0">+</span>rwxs mydir </pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">chmod g+rwxs mydir </pre>
</div>
</div>
<p>give full group read/write access to directory &#8220;mydir&#8221;, also setting the set-groupID flag so that directories created inside it inherit the group</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="c">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
</pre>
</td>
<td class="de1">
<pre class="de1">chmod u<span class="sy0">=</span>rw<span class="sy0">,</span>go<span class="sy0">=</span> privatefile </pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">chmod u=rw,go= privatefile </pre>
</div>
</div>
<p>explicitly give user read/write access, and revoke all group and other access, to file &#8216;privatefile&#8217;</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="c">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
</pre>
</td>
<td class="de1">
<pre class="de1">&nbsp;chmod <span class="sy0">-</span>R g<span class="sy0">+</span>rw</pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse"> chmod -R g+rw</pre>
</div>
</div>
<p>give group read write access to this directory, and everything inside of it (-R = recursive)</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="c">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
</pre>
</td>
<td class="de1">
<pre class="de1">&nbsp;chgrp <span class="sy0">-</span>R medi</pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse"> chgrp -R medi</pre>
</div>
</div>
<p>change the ownership of this directory to group &#8216;medi&#8217; and everything inside of it (-R = recursive). The person issuing this command must own all the files or it will fail.</p>
<p>&nbsp;</p>
<p>WARNINGS:</p>
<p>Putting &#8216;umask 2&#8242; into a startup file (.login or .cshrc) will make these settings apply to everything you do unless manually changed. This can lead to giving group access to files such as saved email in your home directory, which is generally not desireable.</p>
<p>Making a file group read/write without checking what its group is can lead to accidentally giving access to almost everyone on the system. Normally all users are members of some default group such as &#8220;users&#8221;, as well as being members of specific project-oriented groups. Don&#8217;t give group access to &#8220;users&#8221; when you intended some other group.</p>
<p>Remember that to read a file, you need execute access to the directory it is in AND read access to the file itself. To write a file, your need execute access to the directory AND write access to the file. To create new files or delete files, you need write access to the directory. You also need execute access to all parent directories back to the root. Group access will break if a parent directory is made completely private.<br />
AFS Access Control Lists (ACLs)<br />
Files on the central AFS fileservers all have the traditional Unix permissions as explained above, but they are also controlled by Access Control Lists (ACL) which take precedence. They provide access levels more flexible than the user/group/other attribute bits, but they work on the level of complete directories, not files. The command to set and list ACLs is fs.<br />
&#8220;fs&#8221; is a big ugly command that does lots of things related to AFS filesystems depending on the arguments you call it with.</p>
<p>For details see the man pages for: fs_setacl, fs_listacl, fs_cleanacl, fs_copyacl</p>
<p>For brief help, do (e.g.) &#8220;fs help setacl&#8221;</p>
<p>The default is to give the same permissions to a new directory as are on the parent directory. In practice, this is usually to give complete rights to the owner of the directory, and lookup rights to any other user (equivalent to execute attribute on a directory).</p>
<p>To render a directory private, the simplest command is:</p>
<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="c">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
</pre>
</td>
<td class="de1">
<pre class="de1">fs setacl <span class="sy0">-</span>d DIRNAME <span class="sy0">-</span>clear <span class="sy0">-</span>a MYNAME all </pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">fs setacl -d DIRNAME -clear -a MYNAME all </pre>
</div>
</div>
<p>- replace DIRNAME with the appropriate directory name (or &#8220;.&#8221; for the current directory, and MYNAME with your login name.</p>
<p>Check it with:</p>
<p>fs listacl DIRNAME</p>
<p>It should reply with:<br />
Access list for DIRNAME is<br />
Normal rights:<br />
USERNAME rlidwka</p>
<p>(see man fs_setacl for a description of the meaning of the flags &#8220;rlidwka&#8221;)</p>
<p>To explicitly give public read/lookup access, use:</p>
<p>fs setacl -d DIRNAME -a system:anyuser read</p>
<p>This can be abbreviated to</p>
<p>fs sa DIRNAME system:anyuser read</p>
<p>If &#8220;fs&#8221; is not found, or the man pages are not found, your paths are not set up correctly. I recommend you run /usr/local/bin/mknewdotfiles to correct that.</p>
<p>Info from: <a title="http://www.dartmouth.edu" href="http://www.dartmouth.edu" target="_blank">http://www.dartmouth.edu </a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.network-content.com/unix-file-permissions-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Query Example Script</title>
		<link>http://www.network-content.com/mysql-query-example-script/</link>
		<comments>http://www.network-content.com/mysql-query-example-script/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 16:52:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql query]]></category>

		<guid isPermaLink="false">http://www.network-content.com/?p=91</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="php">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre>
</td>
<td class="de1">
<pre class="de1"><span class="kw2">&lt;?php</span>
<span class="co1">// Connection</span>
<span class="kw3">mysql_connect</span><span class="br0">&#40;</span><span class="st0">&quot;localhost&quot;</span><span class="sy0">,</span> <span class="st0">&quot;name&quot;</span><span class="sy0">,</span> <span class="st0">&quot;pass&quot;</span><span class="br0">&#41;</span> or <span class="kw3">die</span><span class="br0">&#40;</span><span class="kw3">mysql_error</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw3">mysql_select_db</span><span class="br0">&#40;</span><span class="st0">&quot;test&quot;</span><span class="br0">&#41;</span> or <span class="kw3">die</span><span class="br0">&#40;</span><span class="kw3">mysql_error</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="re0">$result</span> <span class="sy0">=</span> <span class="kw3">mysql_query</span><span class="br0">&#40;</span><span class="st0">&quot;SELECT name,age FROM users&quot;</span><span class="br0">&#41;</span>
or <span class="kw3">die</span><span class="br0">&#40;</span><span class="kw3">mysql_error</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span> &nbsp;
&nbsp;
<span class="re0">$row</span> <span class="sy0">=</span> <span class="kw3">mysql_fetch_array</span><span class="br0">&#40;</span> <span class="re0">$result</span> <span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="kw1">echo</span> <span class="st0">&quot;Name: &quot;</span><span class="sy0">.</span><span class="re0">$row</span><span class="br0">&#91;</span><span class="st_h">'name'</span><span class="br0">&#93;</span><span class="sy0">;</span>
<span class="kw1">echo</span> <span class="st0">&quot; Age: &quot;</span><span class="sy0">.</span><span class="re0">$row</span><span class="br0">&#91;</span><span class="st_h">'age'</span><span class="br0">&#93;</span><span class="sy0">;</span>
&nbsp;
<span class="sy1">?&gt;</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">&lt;?php
// Connection
mysql_connect("localhost", "name", "pass") or die(mysql_error());
mysql_select_db("test") or die(mysql_error());

$result = mysql_query("SELECT name,age FROM users")
or die(mysql_error());  

$row = mysql_fetch_array( $result );

echo "Name: ".$row['name'];
echo " Age: ".$row['age'];

?&gt;</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.network-content.com/mysql-query-example-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Insert Example Script</title>
		<link>http://www.network-content.com/mysql-insert-example-script/</link>
		<comments>http://www.network-content.com/mysql-insert-example-script/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 16:16:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.network-content.com/?p=86</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="php">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
2
3
4
5
6
7
8
9
10
11
</pre>
</td>
<td class="de1">
<pre class="de1"><span class="kw2">&lt;?php</span>
<span class="co1">// Connect</span>
<span class="kw3">mysql_connect</span><span class="br0">&#40;</span><span class="st0">&quot;localhost&quot;</span><span class="sy0">,</span> <span class="st0">&quot;name&quot;</span><span class="sy0">,</span> <span class="st0">&quot;pass&quot;</span><span class="br0">&#41;</span> or <span class="kw3">die</span><span class="br0">&#40;</span><span class="kw3">mysql_error</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw3">mysql_select_db</span><span class="br0">&#40;</span><span class="st0">&quot;dbname&quot;</span><span class="br0">&#41;</span> or <span class="kw3">die</span><span class="br0">&#40;</span><span class="kw3">mysql_error</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="co1">// Insert into &quot;test&quot;</span>
<span class="kw3">mysql_query</span><span class="br0">&#40;</span><span class="st0">&quot;INSERT INTO test (name, nickname) VALUES ('Arnold', 'Shwarc')&quot;</span><span class="br0">&#41;</span> or <span class="kw3">die</span><span class="br0">&#40;</span><span class="kw3">mysql_error</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="kw1">echo</span> <span class="st0">&quot;Done!&quot;</span><span class="sy0">;</span>
&nbsp;
<span class="sy1">?&gt;</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">&lt;?php
// Connect
mysql_connect("localhost", "name", "pass") or die(mysql_error());
mysql_select_db("dbname") or die(mysql_error());

// Insert into "test"
mysql_query("INSERT INTO test (name, nickname) VALUES ('Arnold', 'Shwarc')") or die(mysql_error());

echo "Done!";

?&gt;</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.network-content.com/mysql-insert-example-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Table Example MySQL</title>
		<link>http://www.network-content.com/create-table-example-mysql/</link>
		<comments>http://www.network-content.com/create-table-example-mysql/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 16:10:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[create table]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://www.network-content.com/?p=82</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="php">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
2
3
4
5
6
7
8
9
10
11
12
13
</pre>
</td>
<td class="de1">
<pre class="de1"><span class="kw2">&lt;?php</span>
&nbsp;
<span class="kw3">mysql_connect</span><span class="br0">&#40;</span><span class="st0">&quot;localhost&quot;</span><span class="sy0">,</span> <span class="st0">&quot;name&quot;</span><span class="sy0">,</span> <span class="st0">&quot;pass&quot;</span><span class="br0">&#41;</span> or <span class="kw3">die</span><span class="br0">&#40;</span><span class="kw3">mysql_error</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw3">mysql_select_db</span><span class="br0">&#40;</span><span class="st0">&quot;dbname&quot;</span><span class="br0">&#41;</span> or <span class="kw3">die</span><span class="br0">&#40;</span><span class="kw3">mysql_error</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="kw3">mysql_query</span><span class="br0">&#40;</span><span class="st0">&quot;CREATE TABLE example(</span>
<span class="st0">id INT NOT NULL AUTO_INCREMENT,</span>
<span class="st0">PRIMARY KEY(id),</span>
<span class="st0"> name VARCHAR(30),</span>
<span class="st0"> age INT)&quot;</span><span class="br0">&#41;</span>
&nbsp;or <span class="kw3">die</span><span class="br0">&#40;</span><span class="kw3">mysql_error</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="sy1">?&gt;</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">&lt;?php

mysql_connect("localhost", "name", "pass") or die(mysql_error());
mysql_select_db("dbname") or die(mysql_error());

mysql_query("CREATE TABLE example(
id INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
 name VARCHAR(30),
 age INT)")
 or die(mysql_error());

?&gt;</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.network-content.com/create-table-example-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Connect Example Script</title>
		<link>http://www.network-content.com/mysql-connect-example-script/</link>
		<comments>http://www.network-content.com/mysql-connect-example-script/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 16:06:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysql connect]]></category>

		<guid isPermaLink="false">http://www.network-content.com/?p=78</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="php">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
2
3
4
</pre>
</td>
<td class="de1">
<pre class="de1"><span class="kw2">&lt;?php</span>
<span class="kw3">mysql_connect</span><span class="br0">&#40;</span><span class="st0">&quot;localhost&quot;</span><span class="sy0">,</span> <span class="st0">&quot;name&quot;</span><span class="sy0">,</span> <span class="st0">&quot;password&quot;</span><span class="br0">&#41;</span> or <span class="kw3">die</span><span class="br0">&#40;</span><span class="kw3">mysql_error</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">echo</span> <span class="st0">&quot;Connected Done&lt;br /&gt;&quot;</span><span class="sy0">;</span>
<span class="sy1">?&gt;</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">&lt;?php
mysql_connect("localhost", "name", "password") or die(mysql_error());
echo "Connected Done&lt;br /&gt;";
?&gt;</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.network-content.com/mysql-connect-example-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello World PHP Script</title>
		<link>http://www.network-content.com/hello-world-php-script/</link>
		<comments>http://www.network-content.com/hello-world-php-script/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 13:41:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[hello wold]]></category>

		<guid isPermaLink="false">http://www.network-content.com/?p=61</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<style type="text/css">
.bwp-syntax-wrapper li {white-space: normal;}
</style>
<div class="bwp-syntax-block clearfix">
<div class="bwp-syntax-toolbar">
<div class="bwp-syntax-control"><a href="javascript:;" class="bwp-syntax-source-switch" title="View Source Code"></a></div>
</div>
<div class="bwp-syntax-wrapper clearfix bwp-syntax-simple">
<table class="php">
<tbody>
<tr class="li1">
<td class="ln">
<pre class="de1">1
2
3
</pre>
</td>
<td class="de1">
<pre class="de1"><span class="kw2">&lt;?php</span>
<span class="kw1">echo</span> <span class="st0">&quot;Hello World!&quot;</span><span class="sy0">;</span>
<span class="sy1">?&gt;</span></pre>
</td>
</tr>
</tbody>
</table>
</div>
<div class="bwp-syntax-source">
<pre class="no-parse">&lt;?php
echo "Hello World!";
?&gt;</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.network-content.com/hello-world-php-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

