Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
|
BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
This is the forum to discuss the Wrox book Professional CodeIgniter by Thomas Myer; ISBN: 9780470282458
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 4th, 2012, 09:32 AM
Registered User
 
Join Date: Sep 2012
Posts: 9
Thanks: 0
Thanked 3 Times in 3 Posts
Default Product Edit Page Returns Blank Page on Update

I am using the latest framework of CI, and while the book is written for 1.7, I have not had many major issues. I know what/where code needs to be updated for the latest framework, and so far I have had great success ... until now.

I am creating the page and functions for the Product Edit Page. The page displays as expected, however when I click the button to update the product information, I am returned a blank page.

The path I start on is : localhost/ci_fullsite_professional/admin/products/edit/17

I click submit and I get localhost/ci_fullsite_professional/admin/products/edit. I expect to the see the dashboard and the flashdata message stating the product was updated.

I can create and delete products successfully. I can create, edit and delete Categories successfully ... it's just the update of the product that returns blank.

UPDATE:
After some debugging, I found the problem code being the image upload ... however, when I look at the code I see no issues.
Code:
if(!$this->upload->do_upload('image')){
	$this->upload->display_errors();
	exit();
}
$image = $this->upload->data();

if ($image['file_name']){
	$data['image'] = "assets/images/products/".$image['file_name'];
}
			
if(!$this->upload->do_upload('thumbnail')){
	$this->upload->display_errors();
	exit();
}
$thumb = $this->upload->data();

if ($thumb['file_name']){
	$data['thumbnail'] = "assets/images/products/".$thumb['file_name'];
}
I have tried add this:
Code:
if ($_FILES['image']['name']){
	if(!$this->upload->do_upload('image')){
		$this->upload->display_errors();
	exit();
	}
	$image = $this->upload->data();
	... etc ...
AND I have tried add this:
Code:
if (strlen($_FILES['image']['name'])){
	if(!$this->upload->do_upload('image')){
		$this->upload->display_errors();
		exit();
	}
	$image = $this->upload->data();
	... etc ...
Anyone have any ideas?

Last edited by plavalle; September 4th, 2012 at 12:09 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
PDF giving first page as blank if page count > 1 using xsl:fo srmxslca XSLT 14 May 5th, 2011 05:01 AM
Displaying Product Categories - the page links talofo BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 6 October 12th, 2009 09:53 AM
why blank page? gilgalbiblewheel Classic ASP Databases 6 December 31st, 2004 09:30 PM
Results Page always returns '0 found' jonrayworth Dreamweaver (all versions) 4 November 9th, 2003 05:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.