Re: Problem with $this->redirect()

2006-09-16 Thread kacperix

Hi!

I was doing this:

I added in file .htaccess in app/webroot this line:

  RewriteBase /

And in file index.php in app/webroot this line:

if (!defined('WEBROOT_DIR')) {
 define('WEBROOT_DIR', basename(dirname(__FILE__)));
}


Change to:

if (!defined('WEBROOT_DIR')) {
 define('WEBROOT_DIR', '/');
}

Thank very much for all who was helping me :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Runniing application in different Time zones.

2006-09-16 Thread maestro777

I'm having difficulty with running my application in different
timezones.
Tried using putenv("TZ=".$tz); where $tz is the time zone previously
registered on a database. Put this code in the bootstrap.

The strange thing was this works only in one controller
(UsersController -  which is the entry point to my application). In
other controllers, the timezone revert back to the server's timezone.

Tried putting that code in the App_controller to execute in the
beforeRender(). But again it didn't work. Just want to avoid having to
execute this putenv() in every controller everytime, if possible.

Anyone successfully implemented a multi-timezone application, would be
grateful if you can give some pointers regarding this problem. Thanks


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Path and Webroot Questions

2006-09-16 Thread [EMAIL PROTECTED]

Hi all -
I'm a fairly new php developer (much previous ASP experience).  I'm
loving CakePHP so far.  It has allowed me to progress through my
current app so quickly.  I'm very pleased.
I have to plug into an existing static site.  I'd like to have the cake
installation contained within a directory "contest" and in web path
"/contest".  Thus filesystem as so:
/path/to/webroot/
   ...current static files and dirs
  /contest <- all cakephp core and my app in here

I have apache mod rewrite working correctly to my knowledge.  How would
I go about this type of configuration?  I had it working fine on
another box with an installation location of /path/to/webroot/cakephp
via http://mybox/cakephp.  Now I go and copy the working /cakephp
directory to a new spot called /contest and no go.  I verified that all
files got copied even the "hidden" .htaccess files.

I'm perplexed as it seems this type of setup is rather common and is
what is referred to in the manual as a "development" setup.

Sorry for the inane question, but I've been staring at it too long.

Best Regards,
Jeremy


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Unique foreign key combination

2006-09-16 Thread John Zimmerman
On 9/16/06, hypercubed <[EMAIL PROTECTED]> wrote:
I guess the difference between what I'm doing and your solution is thatif the the composite key combination is already set then I want tooverwrite it.  It is sort of like how Cake automatically checks if the
id exists to determine if it should do an insert or an update.So I guess my suggestion would be to use option 1 you described at the start.  I wouldn't recommend changing the way the primary key is stored as that could have unpredictable results with cake since it relies on it to interface with your table.  If it works now, an update to the cake core may break it.
If for some reason you only wanted to have an alternate plan in case of a duplicate, you could wait until the duplicate error occured using something similar to what I suggested, then get the id for the existing row, and resave (so option 1 only if error occurs).


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Unique foreign key combination

2006-09-16 Thread hypercubed

I guess the difference between what I'm doing and your solution is that
if the the composite key combination is already set then I want to
overwrite it.  It is sort of like how Cake automatically checks if the
id exists to determine if it should do an insert or an update.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Unique foreign key combination

2006-09-16 Thread John Zimmerman
On 9/16/06, hypercubed <[EMAIL PROTECTED]> wrote:
I have a table that contains a primary key and two foreign keys (i.e.id, A_id, B_id, all integers) as well as other data (this is not a jointable).  My data design is such that the combination A_id and B_id must
be unique.  I'm considering two ways of doing this:1) Before save query the DB and find the primary key (id) for a recordthat has A_id and B_id.  If that record exists set the id field in my$data and then Model->save().  This will overwrite the old record if it
exists and create a new one if it doesn't.2) Change id from an auto increment id to a text field.  Always set theid to be the composite (A_id . '/' . B_id).  This will also overwritethe old record if it exists and create a new one if it doesn't.
Any suggestions on which one I should implement or is there anotheroption?I am enforcing a unique composite key in a couple of my projects.
The primary key is still the id field which is set to autoincrement, so
modifying a record works exactly the same as a regular cake edit.

When adding a record MySQL will throw an error which is uncaught by the
cake model, but the save will fail.  Currently this is how I am dealing
with the insert failure in my controller.  I am working on something
more robust to put in my model.

//check for mysql errors like unique failures, my model is Guideline in this scenario

$connection =& ConnectionManager::getInstance();
$source =& $connection->getDataSource($this->Guideline->useDbConfig);

$db_error   =  $source->lastError();

if ( strstr($db_error, 'Duplicate') ) { //mysql error message contains this string

    $this->Guideline->invalidate('row'); //this is one of my "unique" composite keys

    //I add this error message onto the errortag in the view
    $this->set('duplicateError', 'This guideline already exists in your matrix.'); 

}


So far everything is workigng great and I have had no problems. 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Unique foreign key combination

2006-09-16 Thread hypercubed

I have a table that contains a primary key and two foreign keys (i.e.
id, A_id, B_id, all integers) as well as other data (this is not a join
table).  My data design is such that the combination A_id and B_id must
be unique.  I'm considering two ways of doing this:

1) Before save query the DB and find the primary key (id) for a record
that has A_id and B_id.  If that record exists set the id field in my
$data and then Model->save().  This will overwrite the old record if it
exists and create a new one if it doesn't.

2) Change id from an auto increment id to a text field.  Always set the
id to be the composite (A_id . '/' . B_id).  This will also overwrite
the old record if it exists and create a new one if it doesn't.

Any suggestions on which one I should implement or is there another
option?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Copying a db record

2006-09-16 Thread [EMAIL PROTECTED]

Dirk - you were right!

First, I replaced the $this->Applicant->save($this->data); line with a
direct SQL query, inserting a record. Lo and behold, it inserted 3
records, exactly the same as before.

I went to the layout file (I was using the default cakephp layout) and
removed the favicon.ico reference.

Bingo - only one record gets inserted. I put back the
$this->Applicant->save($this->data); line and removed the direct SQL
query line - again, it worked flawlessly, with only one insert.

So, the question is, why does a separate call to a non-existent
favicon.ico file cause CakePHP to execute the controller several
times??

Thank you everyone for your help!!!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Problem with $this->redirect()

2006-09-16 Thread John Zimmerman
On 9/16/06, kacperix <[EMAIL PROTECTED]> wrote:
Still this same problem. On provider's server still is bad redirecting.I don't know what is wrong. Maybe some constant, module or sth else inapache or sth like this is wrong??  HELP!!!
If mod_rewrite is enabled on the host, all the .htaccess files are in the correct places, then the only other thing I can think of is that the permissions are not set so they are readable by the webserver.  You can double check that with your FTP  client.
Other than that I would recommend contacting your host because it doesn't seem to be a problem with Cake itself.  It is either a misconfiguration on their end, or they are intentionally doing something with mod_rewrite that has side effects for users.
If they can't help you get it solved I would look at changing web hosts.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Problem with $this->redirect()

2006-09-16 Thread kacperix

Still this same problem. On provider's server still is bad redirecting.
I don't know what is wrong. Maybe some constant, module or sth else in
apache or sth like this is wrong??  HELP!!!


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: $_POST returns empty value, but mod_rewrite working.

2006-09-16 Thread Andris Paikens

I knew about this way but as I didn't use it, was forgotten about it.
Without .htaccess files and with "define ('BASE_URL', env('SCRIPT_NAME'));"
everything works just fine.

Thanks, at least something now is working.

On 16/09/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Why don't you try to take off .htaccess files and change core.php
> configuration to use the index.php directly.  See if that works that
> way without mod_rewrite and then you will know for sure.
>
>
> >
>


-- 
Andris Paikens
-
+371 9356529
We are all lost generation. All of us. Most of us just don't know it
yet. But don't forget anything. This is our time. /Shaman'is/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: $_POST returns empty value, but mod_rewrite working.

2006-09-16 Thread [EMAIL PROTECTED]

Why don't you try to take off .htaccess files and change core.php
configuration to use the index.php directly.  See if that works that
way without mod_rewrite and then you will know for sure.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Login renders blank page!

2006-09-16 Thread [EMAIL PROTECTED]

Also, exit() isn't the recommended method to quit processing a method
in CakePHP.  If you were to do this there is code after the redirect
that could be executed.  Not to mention the CakePHP cleanup.  Case in
point would be a redirect for a user to a page after he deletes
something while the delete happens in the background.

Instead you can use return false; to stop processing.

At any rate whenever you have multiple renders or a redirect it is best
to place a return false after each of them to stop method processing
from anything weird that could happen if left to processing that
particular method.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: $_POST returns empty value, but mod_rewrite working.

2006-09-16 Thread Andris Paikens

I already sent mail to server maintainer, let's wait for his answer. I
also suppose there is something wrong with server configuration.

What seems strange - I placed independent form (without Cake and
mod_rewrite, in seperate directory) and post worked as usual, so
something with server and mod_rewrite is not ok.

I'll let know what was solution.

Andris

On 16/09/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> If the $_POST isn't getting set by a form, then that almost seems like
> an webserver issue.  Now, if the $_POST wasn't being put into CakePHP's
> $this->params['form'] it would be a CakePHP thing.
>
> I have had problems if I didn't explicitly put the method="post" in the
> form tag back when I was using the now deprecated formTag.
>
>
> >
>


-- 
Andris Paikens
-
+371 9356529
We are all lost generation. All of us. Most of us just don't know it
yet. But don't forget anything. This is our time. /Shaman'is/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: $_POST returns empty value, but mod_rewrite working.

2006-09-16 Thread [EMAIL PROTECTED]

If the $_POST isn't getting set by a form, then that almost seems like
an webserver issue.  Now, if the $_POST wasn't being put into CakePHP's
$this->params['form'] it would be a CakePHP thing.

I have had problems if I didn't explicitly put the method="post" in the
form tag back when I was using the now deprecated formTag.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Login renders blank page!

2006-09-16 Thread Baydel

Hi,

Many thanks,  CASE issues, you are right. The controllers are working
now but i still have an issue with login and handling session

I noticed that pages that should redirect users to a login page if not
logged in does not come up, I have  a validatesessioncheck method  in
my appcontroller which should redirect users to the login page if not
authenticated. I guess this problem is a fallout of the login attempt
that returns a blank page.


Thanks

Baydel


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Problem with $this->redirect()

2006-09-16 Thread kacperix

> 1. What hosting company are you with?

I am with hosting company from Poland. It's was NetArt:
http://www.nazwa.pl

2. Have you tried to run it locally; like on Windows with a WAMP
   setup?  It so are you having the same problem?

Yes I run it localy on Windows with a WAMP and all is OK!!

P.S. I try again reinstall cake project on my hosting server.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Login renders blank page!

2006-09-16 Thread AD7six

Hi Baydel,

Have you checked the case of your files? Give your subscription model
files is named "Subscription" emphasis on the 'S', I would guess your
home controller file is named "Home_controller.php" - you need
everything lower case.

The session error is caused by the space you have at the beginning of
your subscription model file. If there is no visible space - you have a
BOM (Byte Order Mark) which you need to remove.

HTH,

AD7six


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Login renders blank page!

2006-09-16 Thread Baydel

Hi,

When DEBUG is set to 1 i get the follwing errors

Missing controller
You are seeing this error because controller HomeController could not
be found.

Notice: this error is being rendered by the
app/views/errors/missing_controller.thtml view file, a
user-customizable error page for handling invalid controller
dispatches.

Fatal: Unable to load controller HomeController

Fatal: Create Class:






in file : app/controllers/home_controller.php


Which says it cant find my HomeController, which really is there.


The I also get this messy error about session which was why i turned
debug off before


Warning: session_start(): Cannot send session cookie - headers already
sent by (output started at
/hsphere/local/home/forexhou/forexhouse.net/app/models/Subscription.php:2)
in /hsphere/local/home/forexhou/forexhouse.net/cake/libs/session.php on
line 131

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at
/hsphere/local/home/forexhou/forexhouse.net/app/models/Subscription.php:2)
in /hsphere/local/home/forexhou/forexhouse.net/cake/libs/session.php on
line 131


Thanks

Baydel


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: PHP 4.4.2 and MySQL 4.1.16.

2006-09-16 Thread sujith

Dear Chris,

Thanks a lot for the great help. I cant use latest versions for my
development machine as the working server is having the old versions.

I express my sincere thanks again for your prompt response. 

Sujith


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Login renders blank page!

2006-09-16 Thread AD7six

Hi Baydel,

set Debug to > 0 in /app/config/core.php and read the 1) more
descripive error message and 2) (otherwise hidden) error message.

That would be the first thing to check for anyway ;).

Cheers,

AD7six


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Problem with $this->redirect()

2006-09-16 Thread John Zimmerman
On 9/16/06, kacperix <[EMAIL PROTECTED]> wrote:
>1. What is your Operating System?It's Linux, but what distribution I don't know because my hostingprovider dosn't wrote this.>2. How did you install Apache/PHP/Database? (
i.e. on Windows XAMPP/>WAMP/ individual installers, etc...)All was instal by my hosting provider.>3. What program did you use to extract your cake installation?WinRar>4. If you upgraded your version of cake did you also incorporate
>updates into the /app directory?I didn't upgrade my cake site. This is my first cake project.>5. Check to make sure all 3 .htaccess files are present and readable>by the webserver.  ( 
i.e. /.htaccess, /app/.htaccess,>/app/webroot/.htaccess )Yes, All 3 .htaccess files are present and readableCouple of questions to add based on that...What hosting company are you with?
Have you tried to run it locally; like on Windows with a WAMP setup?  It so are you having the same problem?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.  To post to this group, send email to cake-php@googlegroups.com  To unsubscribe from this group, send email to [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/cake-php  -~--~~~~--~~--~--~---


Re: Login renders blank page!

2006-09-16 Thread Chris Hartjes

On 9/16/06, Baydel <[EMAIL PROTECTED]> wrote:
>
> $this->redirect('/');
> }

I may be wrong, but shouldn't you also be doing an exit() after the
redirect request?  Or even better, redirect people to a
controller/action pair upon successful authentication?

-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: PHP 4.4.2 and MySQL 4.1.16.

2006-09-16 Thread Chris Hartjes

You're kidding that you can't find the exact versions, right?

Older versions of PHP: http://www.php.net/releases.php

Older versions of MySQL: http://downloads.mysql.com/archives.php

Honestly, that took a combined total of 30 seconds looking at php.net
and mysql.com.  Next time I suggest you check those places before
saying you couldn't find the exact versions.

Any reason you can't use PHP 4.4.4 (latest stable version) or newer
versions of MySQL?

On 9/16/06, sujith <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> I need the php4.4.2 and MySQL 4.1.16. for windows. I couldnt get the
> exact versions
> Anybody pelase help me.
>
> Thanks in advance
> Sujith
>
>
> >
>


-- 
Chris Hartjes

"The greatest inefficiencies come from solving problems you will never have."
-- Rasmus Lerdorf

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Problem with $this->redirect()

2006-09-16 Thread kacperix



>1. What is your Operating System?

It's Linux, but what distribution I don't know because my hosting
provider dosn't wrote this.


>2. How did you install Apache/PHP/Database? (i.e. on Windows XAMPP/
>WAMP/ individual installers, etc...)

All was instal by my hosting provider.

>3. What program did you use to extract your cake installation?

WinRar

>4. If you upgraded your version of cake did you also incorporate
>updates into the /app directory?

I didn't upgrade my cake site. This is my first cake project.

>5. Check to make sure all 3 .htaccess files are present and readable
>by the webserver.  ( i.e. /.htaccess, /app/.htaccess,
>/app/webroot/.htaccess )

Yes, All 3 .htaccess files are present and readable


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Login renders blank page!

2006-09-16 Thread Baydel

I just deployed my first cake application to the web, the apps works
well on my development system. But on moving to production on a shared
server, several issues cropped up like, session problems, mod-Rewrite
issues etc.

I have solved some of these problems going thru the posts on this
group, but the two listed below have proved so stubborn:

1. some of my controllers could not be found yet they exist and work
well in the development platform. I keep getting the error

'Not found
The requested address index was not found on this server.'

2. My login renders a blank page when a usual is autheticated, but if
the authentication fails it shows appropraitely.

Below is my code

function login()
{
//Don't show the error message if no data has been submitted.
$this->set('error', false);

// If a user has submitted form data:
if (!empty($this->data))
{
// First, let's see if there are any users in the database
// with the username supplied by the user using the form:

$someone =
$this->User->findByUsername($this->data['User']['username']);

// At this point, $someone is full of user data, or its
empty.
// Let's compare the form-submitted password with the one
in
// the database.

if(!empty($someone['User']['password']) &&
$someone['User']['password'] == $this->data['User']['password'])
{

if(trim($someone['User']['active'])== 0)
{
// Remember the $error var in 
the view? Let's set that to true:
$this->set('error', true);
//give message about inactivity
$this->set('errmessage', 'Your account has been
deactivated, please contact the site administrator');
//render form again
$this->render();
//then exit
exit();
}


// This means they were the same. We can now build some
basic
// session information to remember this user as
'logged-in'.

$this->Session->write('User', $someone['User']);

// Now that we have them stored in a session, forward
them on
// to a landing page for the application.

$this->redirect('/');
}
// Else, they supplied incorrect data:
else
{
// Remember the $error var in the view? Let's set that
to true:
$this->set('error', true);
//give message about not known
$this->set('errmessage', 'The login credentials you
supplied could not be recognized. Please try again.');
}
}
}

Please any help will be appreciated

Baydel


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



PHP 4.4.2 and MySQL 4.1.16.

2006-09-16 Thread sujith

Hi All,

I need the php4.4.2 and MySQL 4.1.16. for windows. I couldnt get the
exact versions
Anybody pelase help me.

Thanks in advance
Sujith


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



$_POST returns empty value, but mod_rewrite working.

2006-09-16 Thread Andris Paikens

Helo there,

I've been playing with CakePhp for some time and so far it was easy and great.
But now this problem arises - project is moved to production server,
to which i have only limited ftp access and after moving forms return
empty $_POST array.

mod_rewrite, as I guess, is working - i can view various pages, use
models, controllers etc. as far as no data posting is involved.
.htaccess files are unmodified - original ones that come with CakePhp.
Project is working on other servers.

Seems that there is something wrong with apache configuration /
mod_rewrite rules in .htaccess files, but still after searching google
and this group i can't figure out what exactly.

Maybe someone has ran into same problem and knows solution?

Thanks in advance.

-- 
Andris Paikens
-
+371 9356529
We are all lost generation. All of us. Most of us just don't know it
yet. But don't forget anything. This is our time. /Shaman'is/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---



Re: Copying a db record

2006-09-16 Thread [EMAIL PROTECTED]

Do a LogError('controller action called'); at the top of your
controller action and see in app/tmp/logs/error.log, how often the
controller action is really called. I had a very similar problem this
week and it turned out, that the action was called several times.

The source of the problem was, that I had a favicon.ico link in the
header that tried to locate a favicon.ico in the actual directory. And
due to my route structure, my controller action was called three times.

You can also try to use the Firefox Extension "Live HTTP Headers" to
find such things.

May that helps.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---