Welcome Guest, Not a member yet? Register   Sign In
Search Criteria Ignored, Only Redirects to Else Statement
#5

(This post was last modified: 06-13-2019, 07:01 AM by Josh1985.)

(06-13-2019, 01:35 AM)hc-innov Wrote: syntax error!

PHP Code:
function search(){
var_dump($this->input->post());
exit;
if (
$this->input->post('submit'){
 
 die('Hello');
....
} else {
....

and post the result

Hmm, another Syntax Parse Error.....

Modified Function
Code:
function search(){
var_dump($this->input->post());
exit;
if ($this->input->post('submit'){
 die('Hello');
   $search = $this->input->post('query');
  $results = $this->recipe_model->search($search);
     $data = array(
     'title' => "Shirley's Recipes : Search Results",
     'columns' => array('toc', 'recipe_search'),
     'recipes' => $results,
  );
  $this->load->view('includes/template', $data);
  }
  else{
   redirect('recipe');
  }
}

Error
Code:
An uncaught Exception was encountered

Type: ParseError

Message: syntax error, unexpected ';'

Filename: /home/www/shirleysrecipes.100webspace.net/application/controllers/Recipe.php

Line Number: 55

Backtrace:

File: /home/www/shirleysrecipes.100webspace.net/index.php
Line: 315
Function: require_once

Line 55: die('Hello');
Reply


Messages In This Thread
RE: Search Criteria Ignored, Only Redirects to Else Statement - by Josh1985 - 06-13-2019, 06:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB