Racking my brain on why this is returning PHP Error: Undefined offset: 1
public function index($hash)
{
//$hash = 44253_13456789
list($part1,$part2) = explode('_', $hash);
$id = $part1;
$tpl_data = array('id' => $id );
$this->load->view('main/index', $tpl_data);
}
the error is happening on the list() = explode(); Thanks for any insight on this.
Here is the URL for the error. http://www.onlinealbumproofing.com/beta/ipad/index/44253_1368207168
UPDATED:
Here is the controller code.
echo $hash;
list($part1,$part2) = explode('_', $hash);
$id = $part1;
$tpl_data = array('id' => $id );
$this->load->view('ipad/index', $tpl_data);
Updated Again.... OK, so looks like the error is happening on the ajax request
var id = $('body').attr('id');
$.ajax({
url: 'ipad/loadImages',
type: 'POST',
dataType: 'json',
data: {id: id},
success: function(json, textStatus, xhr) {
for (var i = 0; i < json.images.length; i++) {
//do something
}
}, error: function(json, textStatus) {
console.log(textStatus);
}
});
$hashis "44253_13456789"? Then this should not happen!