Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    <?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');


    ?>

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,296
    Thanks
    57
    Thanked 524 Times in 511 Posts
    Blog Entries
    5
    Next time feel free to say hi or even use [php] tags

    PHP Code:
    <?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');


    ?>
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •