Welcome Guest, Not a member yet? Register   Sign In
  Encoding a password
Posted by: El Forum - 09-14-2007, 07:27 AM - No Replies

[eluser]Kemik[/eluser]
Hello,

I'm trying to use CI's $this->encrypt->encode() function to encode the users password and check it against the one in the database so they can login.

However, if I encode "test" the result changes every time. E.g. "test could = dfs77fdshdsfdfs= but then DSUDSDSDhds= next time (I just typed random characters there btw).

They always seem to have an = at the end of the string though.

What's the best way to encode a password and keep the string the same every time?

Edit. I've done some tests...

Password: test1
Password Hash: EhfaYeOPfM/rtDvbrJh/EecblQSrVtDfP6x/Lg8toug=
Decoded: test1

Password: test1
Password Hash: /HFJAzH04ublyUWzMgwhlLv/Q1SPEfpQ3QaCX0eDpOE=
Decoded: test1

There's just two examples.


  Implementing some code
Posted by: El Forum - 09-14-2007, 07:09 AM - No Replies

[eluser]manilodisan[/eluser]
I'm trying to implement what seems to be a very good class but I'm having big troubles. The code is supposed to help me cache the pages better and have some sort of a better control over the headers and stuff. The problem is that I have to use the code right after an ob_start() which should sit after the opening php tag and call the class right before the closing php tag. This would have been very simple on a regular php file but, as you can surely imagine, it's a little complicated with our controllers and views.

Here's a sample usage of the code:

Code:
<?php
//------------Start of file---------------

ob_start();            // <==== line 1
include('Conteg.inc'); // <==== line 2

//the page ...

new Conteg();          // <==== line 3
//-------------End of file----------------
?&gt;

Also, here's a link to the original package (it's on phpclasses.org you will need some sort of credentials), PLUS the original support page for this class with more details.


I would really appreciate your help.

Thank you.


  XML-RPC multicall
Posted by: El Forum - 09-14-2007, 07:03 AM - No Replies

[eluser]Unknown[/eluser]
Hallo,

I'm trying to make a XML-RPC multicall with the included XML-RPC library, but after reading and googling a lot I'm pretty sure this is not possible (with this library), right?


  how to call a controller's method from an other one?
Posted by: El Forum - 09-14-2007, 06:33 AM - No Replies

[eluser]ppeemm[/eluser]
Hi there

I am in a controller and I would like to call methods of another controller.
how can I do that?

thanks in advance


  $this-&gt;load-&gt;view unexpected behavior.
Posted by: El Forum - 09-14-2007, 05:29 AM - No Replies

[eluser]cdmn[/eluser]
I did a little test to check my theory.

What i did:
1. Created a view in subfolder: view/subfolder/test_view.php
2. Created another view in sub/subfolder: view/subfolder/_subfolder/inc_view.php
3. Created controller to call test_view.php view
4. Edited Loader library to echo view $path

test_view.php code:

Code:
&lt;?php

echo __FILE__;

$this->load->view('_subfolder/inc_view');

?&gt;

I get:
Quote:/home/user/public_html/system/application/views/subfolder/test_view.php
/home/user/public_html/system/application/views/_subfolder/test_view.php

As you can see, im right now at "subfolder/test_view.php" and im trying to load view from "_subfolder/", but it searches for a view in a root directory. Shouldn't it be searching at "subfolder" directory as I'm already there?


  Godaddy Installation Tips
Posted by: El Forum - 09-14-2007, 04:49 AM - No Replies

[eluser]conekt[/eluser]
Thank you to everyone who's posted on Godaddy installation issues.

Having just struggled with this issue myself, this seems to be the shortest path to proper performance on Godaddy. This is entirely based on other people's posts but, I didn't really see this all in one place so I thought I do just that.

In config.php:

Code:
$config['index_page'] = "index.php?";
$config['uri_protocol'] = "QUERY_STRING";

You should now be able to access everything as such:
Code:
http://yourdomain.com/index.php?controller/action/etc

Once you get to a point where you want to hide the 'index.php?' paste this into your .htaccess file:

Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?$1 [L]

You should now be able to access everything as such:
Code:
http://yourdomain.com/controller/action/etc

Hope this is helpful.


  Problem naming a controller "Directory"
Posted by: El Forum - 09-14-2007, 04:34 AM - No Replies

[eluser]Unknown[/eluser]
I would like to have a controller named Directory but doing so gives a "cannot redeclare class" fatal error. This seems odd as the user guide specifies the controller names which will conflict and "directory" is not one of them.

Further, there doesn't seem to be another directory class in CI - just a few $directory properties floating around. Anyone know what the problem is?

I suppose I could work around by routing requests to /directory/... to /mydirectory/... or something similar but it seems unnecessary.


  Intermittent site loading problem
Posted by: El Forum - 09-14-2007, 02:20 AM - No Replies

[eluser]freaksauce[/eluser]
I was wondering if anyone has experienced this problem. We developed a site using 1.5.4 and the version of PHP is 5.2.4 (it was 5.2.3 for the past month until today) on a unix box. We have a .htaccess file with the following code:

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|robots\.txt|images|css|js|swfs|tmp)
RewriteRule ^(.*)$ /index.php/$1 [L]

RewriteCond %{HTTP_HOST} ^www.oursite.com$ [NC]
RewriteRule ^(.*)$ http://oursite.com/$1 [R=301,L]

so that the index.php isn't showing and the www version gets redirected to just the http:// version.

Everything was fine for a couple of months whilst developing the site. It has been live for a month with no problems. I was until today using the native session class but have reverted to the code igniter version today using db.

Now the problem is that sometimes the site will not load at all. It just sits there with a blank page, we put a test file in a /tmp directory and it echoed a string no problem, when we go back to the index it doesn't load. I believe it is getting as far as the controller as if you delete the database settings you get an error saying couldn't find table in the model. Our host says he can see us connecting even though we aren't seeing a page so it is not a server connection.

I've run out of ideas to try and narrow the problem down, anyone every experienced anything like this?


  Developing on a public/private server
Posted by: El Forum - 09-13-2007, 09:41 PM - No Replies

[eluser]Monotoba[/eluser]
Hi All,

First, let me appologies if this is the wrong forum to post this in?...

My latest project requires that I work with a team member (graphic artist and UI developer) 2000 miles away. We need to setup a development server that will allow us to work on the site but I don't want all of the dev stuff public until it is complete. The distant team member is great with graphics and js but I dont want to ask him to setup VPN access on his machine.

I also need to provide some simple data collection forms on the very same server/site for the client to run some simple polls while we complete the site. To get his team buy-in the client wants to let his staff vote on the site template to be used in the final site and make suggestions and comments regarding their own project.

I would normally setup my development server in house and modify my host files so I could use the corrent url for the site. However, the need for external access without a vpn precludes this practice.

It would be nice if there were some type of A/B switch that would allow serving one site or the other based on a uri/url parameter. An A/B switch might later be helpful in gathering data in regards to site layout and feature use much like Amazon does...

So how would you gents handle this situation? I have a ton of ideas but not sure what would be best...


  Slowness on Dreamhost
Posted by: El Forum - 09-13-2007, 09:30 PM - No Replies

[eluser]woopsicle[/eluser]
Hi everyone,

I have finished developing a site on my local server (vmware of xubuntu/apache/php/mysql running inside windowsxp).

Locally, the load times are really great - with the {elapsed_time} for every page being 0.01-0.08 seconds (even for the more query intensive pages).

So, thinking everything was wonderful, I have moved to my production server (just a DreamHost shared server).

Now, I would expect that pages render slowly on Dreamhost - but I wouldn't expect the {elapsed_time} output to jump up to 1-10 seconds for pages (which is has).

So i have been trying to debug - and even with absolutely no autoloading, logging set to 0 and a controller with:

Code:
&lt;?php

class Index extends Controller
{
    public $data = array();

    function Index()
    {
        parent::Controller();

        $this->load->view('index', $this->data);
    }

}
?&gt;

and a view file of:

Code:
{elapsed_time}

my load times are still anywhere from 0.1 to 2 seconds (depending on the refresh). To me, this is very high??

I have captured the log file contents (by changing the log threshold to 4 for a bit) and this is what it says:

Code:
DEBUG - 2007-09-13 20:23:32 --&gt; Config Class Initialized
DEBUG - 2007-09-13 20:23:32 --&gt; Hooks Class Initialized
DEBUG - 2007-09-13 20:23:33 --&gt; No URI present. Default controller set.
DEBUG - 2007-09-13 20:23:33 --&gt; Router Class Initialized
DEBUG - 2007-09-13 20:23:33 --&gt; Output Class Initialized
DEBUG - 2007-09-13 20:23:33 --&gt; Input Class Initialized
DEBUG - 2007-09-13 20:23:33 --&gt; Global POST and COOKIE data sanitized
DEBUG - 2007-09-13 20:23:33 --&gt; URI Class Initialized
DEBUG - 2007-09-13 20:23:33 --&gt; Language Class Initialized
DEBUG - 2007-09-13 20:23:33 --&gt; Loader Class Initialized
DEBUG - 2007-09-13 20:23:33 --&gt; Controller Class Initialized
DEBUG - 2007-09-13 20:23:33 --&gt; File loaded: /home/.hasbro/blah/blah.com/system/application/views/index.php
DEBUG - 2007-09-13 20:23:33 --&gt; Controller Class Initialized
DEBUG - 2007-09-13 20:23:33 --&gt; File loaded: /home/.hasbro/blah/blah.com/system/application/views/index.php
DEBUG - 2007-09-13 20:23:33 --&gt; Final output sent to browser
DEBUG - 2007-09-13 20:23:33 --&gt; Total execution time: 0.4661


You can see the File loaded: part happens twice for some reason, this only seems to happen in the index.php page - but i dont' think that is the reason for the load times as the other pages which don't have duplicated 'File loaded:' message are still producing similar load times.

I guess i have eliminated to following as the causes:
* mysql being on a separate server to apache - as the slow times happen even when database library isn't loaded
* my code - works fine locally, and also its slow on dreamhost even when i have the most basic controller and view in existence.

anyone have any ideas??

PS> just in case anyone is wondering, the memory usage seems to be around 1.5mb so i think that part is ok.


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Latest Threads
Heads up for users using ...
by davis.lasis
1 hour ago
curl + response body
by okatse
2 hours ago
Tool bar not showing
by grimpirate
3 hours ago
The Hidden Cost of “Innov...
by fcoder
10 hours ago
tool bar not showing
by InsiteFX
Yesterday, 09:09 PM
Validation does not appea...
by grimpirate
Yesterday, 01:55 PM
Block IP addresses of bad...
by grimpirate
Yesterday, 01:47 PM
Override Router
by grimpirate
Yesterday, 01:30 PM
CodeIgniter.com - Report ...
by Vikas Mehta
06-30-2025, 10:30 AM
best way to store tokens ...
by ahallrod
06-30-2025, 10:03 AM

Forum Statistics
» Members: 154,366
» Latest member: Michal788
» Forum threads: 78,436
» Forum posts: 379,709

Full Statistics

Search Forums

(Advanced Search)


Theme © iAndrew 2016 - Forum software by © MyBB