Wednesday, June 25, 2008

Empty & old Cake

Hi, pals!

I have one old project with cake 1.1. And, suddenly, I start to get a lot of "empty" message.

So, it's look like this:

site.com/ads/add

Model have (all field) -> VALID_NOT_EMPTY

In controller, before $this->Ad->save() I made this:

trim(...)
strip_tags(...)
And, even, I wrote:

if ($this->data['Field'] == '') die;

But... But after one-two day I can found in DB records with empty fields. ;(

Of couse, I trying to add record with empty fields an cann't do it. Cake work fine, and return me to /ads/add with error "Field cannot be empty"

But fields empty. I don't know, how spammers do it, but he do it fine ;-(

After week of a lot attempts to fight with this I start use function afterSave ;-)

So

afterSave

$id = $this->Model->GetId();
$data = $this->Model->read(null,$id);
if ($data['Field'] == '') -> $this->Model->del($id)

After this I got only useful record in database.

But, of couse, this decision is not so beauty ;-(

If you know HOW this spammers do it - I'll be very happy if you tell me

(Yes, I look apache logs and don't found anything strange)

Labels: , ,

Tuesday, July 10, 2007

News of CakePHP!

Hi to everyone!

I'm so sorry for long time without any posts. But, I hope, from this time I will write pften ;-)

So. If you don't visit Official Site of CakePHP - do it now. And you can get fresh version of CakePHP ;-)

I'm already get fresh 1.2 alpha, and reading in changes about next 1.2 will be BETA.

I think - it's good time to start learning 1.2 version, because is too many differences between 1.1 & 1.2 version, and when (I think about september/october) 1.2 version will have status: release, we had a lot knowledges about 1.2 and use them in full power.

Well, I think next my posting will be oriented for newbie in Cake and newbie in 1.2 (like me ;-)))

My last works in CakePHP use standard features, standard function. I understand, all around is Web 2.0, Web 3.0 etc. But my clients always say: "We want some new, difference from other" but, when our small web-company finishing project, they say "All good, but it's so unusual... Please make it like at site .... " ;-)

Well, that's all, folks! I'm going to learn 1.2

Labels: , , ,