1. #1
    Flipkikker's Avatar
    Registered
    05/06/04
    Location
    Antwerpen
    Posts
    5,700
    iTrader
    3 (100%)
    Mentioned
    0 Post(s)
    Reputation
    4/23

    PHP: include path

    lo,

    Ik heb een probleempje met mijn php script
    Ik wou het dit keer meteen overzichtelijk aanpakken en werkte dan ook met includes, natuurlijk werkt de parser weer tegen en vindt hij de bestanden niet

    PHP Code:
    <!-- ___index.php___ -->
    <?php

    /****
     *** SETUP VARIABLES ***
    ****/

    // INITIALISING 'OPTION' VALUE
      
    $option "INFO";
    if(isset(
    $_GET['gallery1']))
    {
      
    $option "GAL1";
    }
    elseif(isset(
    $_GET['gallery2']))
    {
      
    $option "GAL2";
    }
    elseif(isset(
    $_GET['links']))
    {
      
    $option "LINK";
    }elseif(isset(
    $_GET['contact']))
    {
      
    $option "CONT";
    }


    /****
     *** RENDER PAGE ***
    ****/

    /** TOP *////

    include("includes/top.php?included=$option");


    /** MIDDLE *////

    // VERIFICATION 'OPTION' VALUE

    switch($option)
    {
    case 
    'INFO':
      include(
    "includes/info.php?included");
      break;
    case 
    'GAL1':
      include(
    "includes/gallery.php?included=1");
      break;
    case 
    'GAL2':
      include(
    "includes/gallery.php?included=2");
      break;
    case 
    'LINK':
      include(
    "includes/link.php?included");
      break;
    case 
    'CONT':
      include(
    "includes/contact.php?included");
      break;
    }


    /** BOTTOM *////

    if($option != 'INFO' && $option != 'LINK' && $option != 'CONT')
    {
      include(
    "includes/bottom.php?included");
    }


    ?>
    PHP Code:
    <!-- ___includes/top.php___ -->
    <?php

    if(isset($_GET['included']))
    {

    $menu $_GET['included'];

    ?>

    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <link rel="stylesheet" href="css/style.css" title="puutjuwelen">
    <title>PuutJuwelen 05/02/2005</title>
    </head>
    <body scroll="auto">
    <table id="site" cellspacing="0">
    <tr>
      <td id="tleftf">&nbsp;</td>
      <td id="tleftf2">&nbsp;</td>
      <td id="tcenterf" colspan="3">&nbsp;</td>
      <td id="trightf2">&nbsp;</td>
      <td id="trightf">&nbsp;</td>
    </tr>
    <tr>
      <td id="hleftf">&nbsp;</td>
      <td id="hleftf2">&nbsp;</td>
      <td id="header" colspan="3">&nbsp;</td>
      <td id="hrightf2">&nbsp;</td>
      <td id="hrightf">&nbsp;</td>
    </tr>
    <tr>
      <td id="mleftf">&nbsp;</td>
      <td id="mleftf2">&nbsp;</td>
      <td id="mcenterf" colspan="3"><a class="menu" <?php if($menu=='INFO'){ ?>id="activated" <?php }?> href="index.php">Info</a><a class="menu" <?php if($menu=='GAL1'){ ?>id="activated" <?php }?> href="index.php?gallery1">Gallerij 1</a></a><a class="menu" <?php if($menu=='GAL2'){ ?>id="activated" <?php }?> href="index.php?gallery2">Gallerij 2</a><a class="menu" <?php if($menu=='LINK'){ ?>id="activated" <?php }?> href="index.php?links">Links</a><a class="menu" <?php if($menu=='CONT'){ ?>id="activated" <?php }?> href="index.php?contact">Contact</a></td>
      <td id="mrightf2">&nbsp;</td>
      <td id="mrightf">&nbsp;</td>
    </tr>


    <?php

    }


    ?>
    De bestanden index.php en top.php staan hierboven, top.php is enkel om te tonen waarvoor ik die $_GET nodig heb
    Hieronder heb ik de foutmelding vermeld:
    Quote Originally Posted by index.php
    This quote is hidden because you are ignoring this member. Show
    Warning: main(includes/top.php?included=INFO): failed to open stream: No such file or directory in c:\domains\puutjuwelen.sohosted.com\wwwroot\puutju welen\index.php on line 32

    Warning: main(includes/top.php?included=INFO): failed to open stream: No such file or directory in c:\domains\puutjuwelen.sohosted.com\wwwroot\puutju welen\index.php on line 32

    Warning: main(): Failed opening 'includes/top.php?included=INFO' for inclusion (include_path='.;C:\PHP\pear') in c:\domains\puutjuwelen.sohosted.com\wwwroot\puutju welen\index.php on line 32

    Warning: main(includes/info.php?included): failed to open stream: No such file or directory in c:\domains\puutjuwelen.sohosted.com\wwwroot\puutju welen\index.php on line 42

    Warning: main(includes/info.php?included): failed to open stream: No such file or directory in c:\domains\puutjuwelen.sohosted.com\wwwroot\puutju welen\index.php on line 42

    Warning: main(): Failed opening 'includes/info.php?included' for inclusion (include_path='.;C:\PHP\pear') in c:\domains\puutjuwelen.sohosted.com\wwwroot\puutju welen\index.php on line 42
    Er moet blijkbaar iets ingesteld worden van include path ofzo

    Mvg RealReality

    [edit]Nog even het adres van de testsite erbij vermelden http://puutjuwelen.sohosted.com/puutjuwelen[/edit]
    Last edited by Flipkikker; 17-03-2005 at 19:15.
    =)
    no votes  

  2. #2
    0n3Liner's Avatar
    Registered
    10/09/03
    Location
    daar
    Posts
    1,198
    iTrader
    0
    Mentioned
    0 Post(s)
    Reputation
    2/2
    de php parser gaat zoeken naar een file met de naam 'includes/top.php?included=INFO' en die bestaat natuurlijk niet, als je get vars wil meegeven meot je dat gewoon in de balk doen, ze worden automatisch wel mee doorgegeven naar included pages.
    no votes  

  3. #3
    Flipkikker's Avatar
    Registered
    05/06/04
    Location
    Antwerpen
    Posts
    5,700
    iTrader
    3 (100%)
    Mentioned
    0 Post(s)
    Reputation
    4/23
    dus hij denkt dat "includes/top.php?included=INFO" de bestandsnaam is en ziet het laatste deel niet aan als een get statement
    =)
    no votes  

  4. #4
    orez's Avatar
    Registered
    17/07/02
    Location
    Meulebeke
    Posts
    4,346
    iTrader
    7 (89%)
    Mentioned
    0 Post(s)
    jij vraagt op

    $_GET['included']

    wat haalt hij op ? het woord "INFO"

    moet jij schrijven

    PHP Code:
    require_once($_GET['included'] . ".php"); 
    of include();
    of .inc whatever jij verkiest
    zodat em
    INFO.php ophaalt...
    de pagina INFO bestaat idd niet
    Accent - jobs for people : Junior Marketing Manager / Web & Graphical Design Trends
    DJ orez - HipHop / R&B / Reggaeton / Dancehall / Crunk
    no votes  

Posting Permissions

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

Log in

Log in