Welcome Guest, Not a member yet? Register   Sign In
White blank page & no error given
#1

[eluser]cngzdyrn[/eluser]
Hi brothers,

I have a trouble, please help me.

My application works on my localhost. But after upload production server some controllers give blank page error. Php dent give error without i open php errors. After that i choose a controller which has a problem. And i looked controller code and i found code which it cause problem. The code below. After i remove it is working.

Code:
if(!empty($this->input->post('district_id'))){
$insert_data['district_id'] = $this->input->post('district_id');
}
if(!empty($this->input->post('town_id'))){
$insert_data['town_id'] = $this->input->post('town_id');
}


What is problem? Do u have any idea?
#2

[eluser]ivantcholakov[/eluser]
Code:
empty($this->input->post('district_id'))

This works on higher PHP versions.

Rewrite the snippet this way:

Code:
$district_id = $this->input->post('district_id');
$town_id = $this->input->post('town_id');

if (!empty($district_id)) {
     $insert_data['district_id'] = $district_id;
}

if (!empty($town_id)) {
     $insert_data['town_id'] = $town_id;
}
#3

[eluser]cngzdyrn[/eluser]
in my local i am using php 5.5.3 , and in production i am using 5.4.25. So localhost php version newer.I already knew that, I can solve this problem with your method. But is there any php config change to solve this problem?

Thanks...
#4

[eluser]ivantcholakov[/eluser]
http://www.php.net/manual/en/migration55...atures.php - "empty() supports arbitrary expressions".

There is no such an option in PHP. You have to check your empty() usages and to rewrite them according to the old syntax.

#5

[eluser]cngzdyrn[/eluser]
Thanks a lot. I update php version from 5.4.25 to 5.5.9. I solved the problem. Thanks for your help.
#6

[eluser]CroNiX[/eluser]
input() returns boolean FALSE if it did not exist in post (same with session and many others).




Theme © iAndrew 2016 - Forum software by © MyBB