<?xml version="1.0" encoding="utf-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">

    <title type="text">CodeIgniter Forums</title>
    <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/" />
    <link rel="self" type="application/atom+xml" href="http://codeigniter.com/forums/atom/" />
    <updated>0</updated>
    <rights>Copyright (c) 2012</rights>
    <generator uri="http://www.pmachine.com/" version="2.2.2">ExpressionEngine</generator>
    <id>tag:codeigniter.com,2012:02:13</id>


    <entry>
      <title>xamppWin&#45;1.7.3 vs CodeIgniter (version problem)</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/210921/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.210921</id>
      <published>2012-02-13T06:56:20Z</published>
      <updated>0</updated>
      <author><name>Akash Ansari</name></author>
      <content type="html">
      <![CDATA[
        <p>I am using <span style="color:orange;"><b>codeigniter 2.1.0</b></span> on <span style="color:green;"><b>xampp 1.7.3</b></span><br />
But now i want to use <span style="color:orange;"><b>CI 1.7.1</b></span><img src="http://ellislab.com/images/smileys/tongue_laugh.gif" width="19" height="19" alt="tongue laugh" style="border:0;" /> (bcoz there are many tutorials of older versions&#8230;.like <span style="color:green;"><b>net-tuts</b></span>)</p>

<p>So pls suggest me a <span style="color:red;"><b>xampp version</b> according to <b>CI 1.7.1</b></span> and give me some links of <b>CI 2.1.0</b> tutorials.</p>

<p><br />
THANKS IN ADVANCE&#8230;.<img src="http://ellislab.com/images/smileys/smirk.gif" width="19" height="19" alt="smirk" style="border:0;" /></p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>pagination problem</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/210917/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.210917</id>
      <published>2012-02-13T06:23:36Z</published>
      <updated>0</updated>
      <author><name>junaids</name></author>
      <content type="html">
      <![CDATA[
        <p>Hi,<br />
I just tried the pagination class. And want to show one item per page. But it is not working and displaying 2 items per page. Here is my code</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">show_products</span><span style="color: #007700">()<br />&nbsp;&nbsp;</span><span style="color: #0000BB">&#123;<br />&nbsp;&nbsp;&nbsp;&nbsp;$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">library</span><span style="color: #007700">(</span><span style="color: #DD0000">'pagination'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$config&#91;</span><span style="color: #DD0000">'base_url'</span><span style="color: #0000BB">&#93;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'http://localhost/ci_series/gallery/show_products/'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$config&#91;</span><span style="color: #DD0000">'total_rows'</span><span style="color: #0000BB">&#93;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">4</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$config&#91;</span><span style="color: #DD0000">'per_page'</span><span style="color: #0000BB">&#93;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">pagination</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">initialize</span><span style="color: #007700">(</span><span style="color: #0000BB">$config</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">model</span><span style="color: #007700">(</span><span style="color: #DD0000">'Gallery_model'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data&#91;</span><span style="color: #DD0000">'products'</span><span style="color: #0000BB">&#93;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Gallery_model</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">show_products</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data&#91;</span><span style="color: #DD0000">'images'</span><span style="color: #0000BB">&#93;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">Gallery_model</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">get_images</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">view</span><span style="color: #007700">(</span><span style="color: #DD0000">'show_products'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">);<br />&nbsp;&nbsp;</span><span style="color: #0000BB">&#125;&nbsp;</span>
</span>
</code></div>
<p>and view</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">&lt;</span><span style="color: #0000BB">div&nbsp;id</span><span style="color: #007700">=</span><span style="color: #DD0000">"blank_gallery"</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">Product&nbsp;Description</span><span style="color: #007700">&lt;/</span><span style="color: #0000BB">div</span><span style="color: #007700">&gt;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">foreach(</span><span style="color: #0000BB">$products&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$product</span><span style="color: #007700">):&nbsp;</span><span style="color: #0000BB">?&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">'Product&nbsp;Name'&nbsp;</span><span style="color: #0000BB">?&gt;&nbsp;</span><span style="color: #007700">:<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$product</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">name</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">br</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">'Product&nbsp;Price'&nbsp;</span><span style="color: #0000BB">?&gt;&nbsp;</span><span style="color: #007700">:&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$product</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">price</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">br</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">COLOR&nbsp;</span><span style="color: #007700">:</span><span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$product</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">option_color</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">br</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">SIZE&nbsp;</span><span style="color: #007700">:</span><span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$product</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">option_size</span><span style="color: #007700">;&nbsp;</span><span style="color: #0000BB">?&gt;</span><span style="color: #007700">&lt;</span><span style="color: #0000BB">br</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">IMG</span><span style="color: #007700">:&nbsp;&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;?php&nbsp;echo&nbsp;</span><span style="color: #0000BB">$images&#91;</span><span style="color: #DD0000">&nbsp;</span><span style="color: #0000BB">$product</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">id</span><span style="color: #DD0000">&nbsp;&#93;&#91;'url'&#93;&nbsp;?&gt;"</span><span style="color: #007700">/&gt;&lt;</span><span style="color: #0000BB">br</span><span style="color: #007700">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">THUMB</span><span style="color: #007700">:&nbsp;&lt;</span><span style="color: #0000BB">img&nbsp;src</span><span style="color: #007700">=</span><span style="color: #DD0000">"&lt;?php&nbsp;echo&nbsp;</span><span style="color: #0000BB">$images&#91;</span><span style="color: #DD0000">&nbsp;</span><span style="color: #0000BB">$product</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">id</span><span style="color: #DD0000">&nbsp;&#93;&#91;'thumb_url'&#93;&nbsp;?&gt;"</span><span style="color: #007700">/&gt;&lt;</span><span style="color: #0000BB">br</span><span style="color: #007700">&gt;<br /></span><span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">endforeach;&nbsp;</span><span style="color: #0000BB">?&gt;&nbsp;<br />&lt;?php&nbsp;</span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">pagination</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">create_links</span><span style="color: #007700">();&nbsp;</span><span style="color: #0000BB">?&gt;&nbsp;</span>
</span>
</code></div>
<p>Suggestions please..</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>upload</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/210911/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.210911</id>
      <published>2012-02-13T03:28:13Z</published>
      <updated>0</updated>
      <author><name>einsteinity</name></author>
      <content type="html">
      <![CDATA[
        <p>hi, i am newbie in codeigniter.</p>

<p>i want to create an upload page where user can upload files to the server (it is only a testing for me so it will run on localhost), and i want to make sure that the file is not vulnerable. is it enough to use the upload class or should i integrate it with antivirus too? if i should make an integration, how to do it?</p>

<p>thank you.</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>question about session</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/210906/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.210906</id>
      <published>2012-02-13T02:20:05Z</published>
      <updated>0</updated>
      <author><name>datactrl</name></author>
      <content type="html">
      <![CDATA[
        <p>I save user login ID in session. And when user logout, I update user table in postgresql database with logout time and user ID from session data. I found sometimes logout time on user table wasn&#8217;t updated. I wonder the user ID in session data has already gone(expired) before user logout. Does session expire by some exception rather than settings on </p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">$config&#91;</span><span style="color: #DD0000">'sess_expiration'</span><span style="color: #0000BB">&#93;&nbsp;</span>
</span>
</code></div><p>? Because the default value is long enough, 7200.</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>online to offline &#8220;error 404 page not found&#8221;</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/210880/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.210880</id>
      <published>2012-02-12T09:18:12Z</published>
      <updated>0</updated>
      <author><name>nicosa</name></author>
      <content type="html">
      <![CDATA[
        <p>Dear all,<br />
i have a problem when migrate from online to offline(xampp) station.<br />
when i type localhost/xxxx. appear error 404 page no found. what do i have to change in source code?</p>

<p>need your help, thank</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>CodeIgniter suitable for my project&#63;</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/210857/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.210857</id>
      <published>2012-02-11T14:31:28Z</published>
      <updated>0</updated>
      <author><name>Teecee</name></author>
      <content type="html">
      <![CDATA[
        <p>Hi everyone,</p>

<p>I have been presented with a project to update an old and dated website; www.rccdams.co.uk</p>

<p>It was originally built using PHP 4 and a variety of static html templates.</p>

<p>My question is this:<br />
Since it&#8217;s not a complex site (the most complex it gets is the dam database search) is it worth reworking the site in CodeIgniter? Will there be any benefit?</p>

<p>I have to add that although I&#8217;m well versed in designing and building HTML sites and have used WordPress and Concrete5 in the past, I&#8217;d classify myself as a PHP novice and have never used CodeIgniter before.</p>

<p>There is additional functionality that the site owner has requested (apart from dragging it into this century!) and I thought I could do this using add-ons.</p>

<p>The site has no content management system to speak of, so I was thinking of using PyroCMS.</p>

<p>Anyway, any help, advice, information would be gratefully received.</p>

<p>Many thanks,<br />
Tony.</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>SpareRoom (sajjad786)</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/210843/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.210843</id>
      <published>2012-02-11T09:28:31Z</published>
      <updated>0</updated>
      <author><name>Sajjad Abbas</name></author>
      <content type="html">
      <![CDATA[
        <p>Find a flatshare or flatmate fast! 1000s of rooms for rent in flatshares across London, Manchester, Birmingham, Bristol, Leeds, Edinburgh, Glasgow and the rest. http://www.spareroom.co.uk/</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>cannot overwrite URI method _detect_uri</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/210763/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.210763</id>
      <published>2012-02-10T11:28:00Z</published>
      <updated>0</updated>
      <author><name>redwiz</name></author>
      <content type="html">
      <![CDATA[
        <p>My situation is a bit complicated, i&#8217;ll try to explain.<br />
I use CI with query strings disabled, with the default URI system based on segments.</p>

<p>Unfortunately sometimes i&#8217;m forced to accept query strings in my URL&#8217;s becuase google adwords manual tagging campaigns need that:</p>

<p>http://support.google.com/adwords/certification/bin/answer.py?hl=en&amp;answer=156114</p>

<p>The solution to my problem is to tell apache rewrite th e url ignoring every query string (question mark at the end of the rule):</p>

<p>RewriteCond $1 !^(index\.php|assets|media|robots\.txt)<br />
RewriteRule ^(.*)$ /index.php/$1? [L]</p>

<p>The system works well almost everywhere, except if i have an URL without segments with a query string:</p>

<p>http://site.com/?string</p>

<p>in this case URI class take the query string as the first segment of URI, this happen becuase insisde function _detect_uri:</p><blockquote>
<p>// This section ensures that even on servers that require the URI to be in the query string (Nginx) a correct<br />
// URI is found, and also fixes the QUERY_STRING server var and $_GET array.</p>
</blockquote>

<p>Ok, i had to deal with that, no problem, i just have to extend URI and rewrite tyhat function.<br />
But i couldn&#8217;t because _detect_uri is declared as private and cannot be extended unless a change directly inside the system core URI class, that is something i prefer avoid, to keep my code portable between CI installation (and hopefully versions).</p>

<p>So the question is, what&#8217;s the point to have private functions inside  CI libraries?<br />
Why do not let the developer make all the changes he wants?<br />
And, at last, why don&#8217;t you declare all non public functions as protected instead private?</p>

<p><br />
thanks a lot </p>

<p>Andrea Consigli</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>How to add FOREIGN KEY constraint when creating a table&#63;</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/210748/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.210748</id>
      <published>2012-02-10T07:59:39Z</published>
      <updated>2012-02-10T08:17:37Z</updated>
      <author><name>kadishmal</name></author>
      <content type="html">
      <![CDATA[
        <p>I am trying to create a table which has a foreign key reference to another table. The table is being created by CodeIgnier. However, in</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dbforge</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">add_key</span><span style="color: #007700">()&nbsp;</span>
</span>
</code></div><p> I cannot see how would I indicate that this key should be a foreign key which references another key. How would I do that?</p>
      ]]>
      </content>
    </entry>

    <entry>
      <title>An experiment about translation special characters among html,php and mysql. Some problems.</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/forums/viewthread/210740/" />      
      <id>tag:codeigniter.com,2012:forums/viewthread/.210740</id>
      <published>2012-02-10T04:49:52Z</published>
      <updated>0</updated>
      <author><name>huaxz1986</name></author>
      <content type="html">
      <![CDATA[
        <p>First I get data from html: </p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">addslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$POST&#91;</span><span style="color: #DD0000">'text'</span><span style="color: #0000BB">&#93;</span><span style="color: #007700">)&nbsp;</span>
</span>
</code></div>
<p>I found that mysql_real_escape_string() can work too, but there is no function to delete the &#8216;\&#8217; that mysql_real_escape_string() add.<br />
Second insert data into MYSQL.</p>

<p>The reverse action:<br />
First get data from MYSQL:</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">stripslashes</span><span style="color: #007700">(</span><span style="color: #0000BB">$result&#91;</span><span style="color: #DD0000">'text'</span><span style="color: #0000BB">&#93;</span><span style="color: #007700">)&nbsp;</span>
</span>
</code></div>
<p>Then show data in html,with htmlspecialchars() and nl2br().<br />
Finally, I surprisingly see that some of data is shown with entity in html, not characters such as &lt; &gt; &#8217; &#8220;.However some of data is shown correctly.<br />
That is why? </p>
      ]]>
      </content>
    </entry>


</feed>
