...

View Full Version : Undefined index: q in C:\xampp\htdocs\jobolicious\index.php on line 13 and 14



fool007
11-19-2011, 09:05 AM
<?php

include('config.php');
include('db_fns.php');

$controller = 'jobs';

$view = empty($_GET['view']) ? 'index' : $_GET['view'];

switch ($view) {

case "index":
$q = $_GET['q'];
$cid = $_GET['cid'];
$search_categories = find_categories();
$jobs = find_jobs($q, $cid);
break;

case "show":

break;

}

include($_SERVER['DOCUMENT_ROOT'].'/'.'jobolicious/views/layouts/'.$controller.'.php');


?>

tangoforce
11-19-2011, 07:18 PM
Next time feel free to say hi or even use
tags :thumbsup:

[php]
<?php

include('config.php');
include('db_fns.php');

$controller = 'jobs';

$view = empty($_GET['view']) ? 'index' : $_GET['view'];

switch ($view) {

case "index":
if (isset($_GET['q']))
{
$q = $_GET['q'];
$cid = $_GET['cid'];
$search_categories = find_categories();
$jobs = find_jobs($q, $cid);
}
else
{
print '$_GET[\'q\'] has not been sent.';
}
break;

case "show":

break;

}

include($_SERVER['DOCUMENT_ROOT'].'/'.'jobolicious/views/layouts/'.$controller.'.php');


?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum