CakePHP - Blank page on navigating to page

I have the following controller method:

function recover_password() { $this->layout = 'frontend'; $this->loadModel('PasswordReset'); $this->Fonyker->recusive = -1; if($this->data) { $fields = array( 'Fonyker.fonykid', 'Fonyker.username', '', '' ); $fonyker = $this->Fonyker->find('first', array( 'conditions' => array( 'OR' => array( '' => $this->data['Fonyker']['field'], 'Fonyker.username' => $this->data['Fonyker']['field'] ) ), 'fields' => $fields )); if($fonyker) { $this->PasswordReset->create(); $passwordReset = array(); $passwordReset = array( 'PasswordReset' => array( 'code' => hash('sha256', $fonyker['Fonyker']['fonykid'].StringUtils::getRandomString(20)), 'fonykid' => $fonyker['Fonyker']['fonykid'] ) ); $this->PasswordReset->save($passwordReset); $data = array( 'username' => $fonyker['Fonyker']['username'], 'code' => $passwordReset['PasswordReset']['code'], 'name' => $fonyker['Fonyker']['name'], 'email' => $fonyker['Fonyker']['email'] ); $this->_sendPasswordResetEmail($data); } else { } } }

This is the view:

<div class="prepend-top span-24"> <div class="prepend-8 span-8 append-8"> <?php echo $this->Form->create('Fonyker', array('action' => 'recover_password')); echo $this->Form->input('email', array( 'div' => array( 'class' => 'span-8' ), 'class' => 'input-text long', 'id' => 'FonykerEmail', 'label' => array( 'class' => 'inlined', 'text' => '' ), 'placeholder' => 'Username or Email' )); echo $this->Form->submit('',array( 'div' => array( 'class' => 'span-2 last' ), )); echo $this->Form->end(); ?> </div> </div>

When I navigate to the page all I get is a blank page, and sometimes this error: Fatal error: Maximum execution time of 60 seconds exceeded in Unknown on line 0

UPDATE: The error seems to be loading my model, this is the model I have declared:

<?php class PassswordReset extends AppModel { var $name = 'PasswordReset'; var $displayField = 'id'; var $validate = array( 'code' => array( 'alphanumeric' => array( 'rule' => array('alphanumeric'), //'message' => 'Your custom message here', //'allowEmpty' => false, //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations ), ), 'fonykid' => array( 'alphanumeric' => array( 'rule' => array('alphanumeric'), //'message' => 'Your custom message here', //'allowEmpty' => false, //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations ), ) ); } ?>

If I remove the loadModel() call the page loads.

-------------Problems Reply------------

Do you have a table in the database called password_resets? Also, you may want to move your loadModel to the line right before you need it.

Category:php Views:2 Time:2011-08-02

Related post

  • How do I programatically turn off show pages in navigation for sharepoint 2008-10-23

    I am progamatically creating a SharePoint site using SPWeb spWeb = spSite.AllWebs.Add(...); What code do I need run to set the spWeb to turn off the "Show pages in navigation" option? Answer: publishingWeb.IncludePagesInNavigation = false; ----------

  • Navigating to IP address shows different page than navigating to hostname? 2009-06-05

    I'm looking at a web site we'll call . A quick traceroute shows that its IP address is . When I browse to "" in Firefox, I am shown the web site (a login page). However, when I browse to 20

  • Silverlight 3/4 Navigation Application - Access child page controls from Parent page 2009-12-17

    How can I access child page controls from the parent page in a Silverlight 3/4 Navigation Application? I wish to hide an image from the child page when I click a button in the parent page. --------------Solutions------------- I think you can do this

  • GWT - how to organize project to have multiple web pages and navigation between them 2010-02-17

    I'm a newbie to GWT (by the way being really impressed by it) and find it really attractive to a person like me with good knowledge of C++/.NET desktop technologies willing to write web applications. I started my own project based on the generated sa

  • Stop Master page refreshing while navigating between pages? 2010-04-21

    I'm using Master Page in my application, in the master page I put a ContentPlaceHolder in Update Panel to support AJAX in child pages, the question is how to stop Refreshing "master page controls" while navigating between pages? For navigatio

  • Navigating Silverlight pages from HTML 2010-08-24

    I am developing a website that contains a number of "forms" for entering data, etc, and I plan on using Silverlight and RIA Services for managing the data within these forms. The rest of the site will be normal HTML/CSS/JavaScript. The plan was to cr

  • Remove blank line on every web page 2010-09-29

    I have 3 blank lines at the beginning of every page that is causing errors of an add-on with (PS I have worked closely with their support team). I can see the lines using firebug, but don't know which file is causing them. I am trying to

  • WP7 determining which page I navigated from 2010-11-01

    I have 3 pages. Page 1 is search criteria, page 2 is list, page 3 is details. If I go to page 2 from page 1 I want to call a web service and load details onto the page. If I go to page 2 from page 3 (ie using the back button) I don’t want to reload t

  • One Main Page and Navigation using CSS 2011-03-10

    I'm trying to create my first website using HTML/CSS. My goal here is to have one single main page, and when a person clicks the navigation links, it updates the main-content portion of the index.html file (but doesnt update the rest of the content l

  • Prestashop Blank Page Payment and Modules page 2011-04-17

    I've re-uploaded fresh copy of Prestashop v1.4.0.17 many times to my hosting, but I'm getting blank page Payment and Modules page: It is fine in my localhost. Any idea why this happens? --------------Solutions------------- Solution: http://www.presta

  • iPhone : how can i move to front page in navigation Controller? 2011-04-25

    how can I move to front page in navigation Controller? i know that if i want to move to rootpage, i can use [self.navigationController popToRootViewControllerAnimated:YES]; but i want to move in front of 2pages. not root page and before page. how can

  • Flickering when navigating between pages 2011-05-10

    My phonegap/jquery mobile application flickers most of the time when I navigate between the pages. Is this normal or is there a solution for this? --------------Solutions------------- .ui-page { -webkit-backface-visibility: hidden; } This worked for

  • Changing urls in the address bar after page-forward navigation to create bookmarkable urls 2011-07-19

    JSF by default, uses a internal page forward mechanism instead of page redirect. This, however, leaves me with a bit of problem. I need to create bookmark-able urls but since the url doesn't change with navigation, I am afraid as to how I can modify

  • Current page in navigation using Javascript and jQuery 2011-07-28

    I'm trying to set the current page to reflect in a main navigation bar. I've set a div in each page for JS / jQuery to check it's the right page with the following code: $(document).ready(function() { if ($('div').is('#example1-page')) { $("a#nav-exa

  • How to save content on the page after navigating on it back 2011-11-24

    I have a page with 4 TextBoxes. Each time pressing on the TextBox I use the NavigationService to navigate to the new page in order to make a comfortable input through Itembox. I use NavigationContext in order to send the selection from the Itembox. B

  • Navigating between pages with JQuery Mobile 2012-01-31

    I am working on an application that uses JQuery Mobile. My application has 3 screens, that are separated into two separate ASP.NET files. These screens are "Page 1", Page 2 - A", and "Page 2 - B". These screens are placed in the following files: page

  • JSF 2. Strange behavior navigating between pages using IE7 2012-04-18

    I have a web application where the first page is a login page, and once I am logged correctly, the main page is displayed. The page has a tabbed menu and if the first time I click on one of the tabs, the main page is refreshed again instead of going

  • When I open certain websites on my laptop, the pages are blank. It thinks the pages are done? 2013-06-12

    When I try to open certain websites on my laptop the pages are blank. they will open on a desktop so I know it's not the website. For example. I cannot get into my email (hotmail). it thinks the page is finished, but it is blank. I found another page

  • How do i get a blank screen to write a page of names on it? 2012-01-16

    How do i get a blank screen to write a page of names on it? --------------Solutions------------- Hi, If you want to start a Text file of some type, just type Notepad or WordPad in the Search... WordPad is a little fancier than Notepad, but both will

Copyright (C), All Rights Reserved.

processed in 0.090 (s). 11 q(s)