Toon posts:

[HTML/PHP] include werkt niet /nogmaals

Pagina: 1
Acties:
  • 48 views sinds 30-01-2008

Verwijderd

Topicstarter
Oke mensen nogmaals dan (misschien nu wat meer geluk)

Ik heb van de .html een .php gemaakt en dan in de td-sectie de volgende code gebruikt:

<?php
include('4images/index.php');
?>

Maar dan krijg ik de volgende foutmelding:

Fatal error: Failed opening required './includes/sessions.php' (include_path='.:/data/apache/php/mmp_lib') in index.php on line 31

Hopelijk kan ik een beetje in de goede richting gestuurd worden.

  • D2k
  • Registratie: Januari 2001
  • Laatst online: 31-08 10:19

D2k

kijk nou eens naar je error en naar wat voor code je geeft
dat kan geen verband hebben volgens mij

Doet iets met Cloud (MS/IBM)


Verwijderd

Op zondag 14 juli 2002 15:50 schreef D2k het volgende:
kijk nou eens naar je error en naar wat voor code je geeft
dat kan geen verband hebben volgens mij
maybe wel.. waarschijnlijk de server fout geconfigureerd

Verwijderd

Jeps, kijk eens in je httpd.conf

  • Grum
  • Registratie: Juni 2001
  • Niet online
Op zondag 14 juli 2002 15:47 schreef peterbuyk het volgende:
<?php
include('[b][u]4images/index.php[/b][/u]');
?>

[...]

Fatal error: Failed opening required '[b][u]./includes/sessions.php[/b][/u]' (include_path='.:/data/apache/php/mmp_lib') in index.php on line 31
:? :D

  • ^Mo^
  • Registratie: Januari 2001
  • Laatst online: 04-11-2025
Op zondag 14 juli 2002 17:16 schreef Grum het volgende:

[..]

:? :D
Wat is daar zo vreemd aan? Je kan toch een directory 4images hebben met daarin een directory includes die vervolgens sessions.php huist? (Dat het niet zo is is een ander verhaal ;))

"There are 10 kinds of people in the world, those who understand binary and those who don't" | Werkbak specs


Verwijderd

Op zondag 14 juli 2002 17:22 schreef _Mo_ het volgende:

[..]

Wat is daar zo vreemd aan? Je kan toch een directory 4images hebben met daarin een directory includes die vervolgens sessions.php huist?
Dat kan ja, maar dan zit daar toch de fout en niet op de regel die hij geeft...

Verwijderd

Nee, dat is het niet,
include_path='.:/data/apache/php/mmp_lib' wil zeggen dat php iets van z'n eigen library niet kan vinden.

Die library heeft hij dus nodig op regel 31 in index.php.

Verwijderd

lijkt op een niet goed geinstalleerde PHP :?

  • ^Mo^
  • Registratie: Januari 2001
  • Laatst online: 04-11-2025
Op zondag 14 juli 2002 17:45 schreef Tw^st3D het volgende:
lijkt op een niet goed geinstalleerde PHP :?
Is wel goed geinstalleerd, alleen het include path staat fout. Of de regel die sessions.php moet includen is fout, 'tis maar hoe je het bekijkt ;)

"There are 10 kinds of people in the world, those who understand binary and those who don't" | Werkbak specs


Verwijderd

code:
1
2
3
Fatal error: Failed opening required './includes/sessions.php' 
(include_path='.:/data/apache/php/mmp_lib')
 in index.php on line 31

Volgens mij is dit inderdaad een fout path
Post de code eens van index.php.
En kijk eens of .:/data/apache/php/mmp_lib' wel bestaat op de server.

  • ^Mo^
  • Registratie: Januari 2001
  • Laatst online: 04-11-2025
Op zondag 14 juli 2002 19:17 schreef Zenith4ever het volgende:
code:
1
2
3
Fatal error: Failed opening required './includes/sessions.php' 
(include_path='.:/data/apache/php/mmp_lib')
 in index.php on line 31

Volgens mij is dit inderdaad een fout path
Post de code eens van index.php.
En kijk eens of .:/data/apache/php/mmp_lib' wel bestaat op de server.
Wat daar nu staat is correct. Het maakt niet uit wat er in je include path staat, of dat nu bestaat of niet. Maar als jij opschrijft include "blaat.php"; gaat de parser eerst in . zoeken, huidige directory dus (staat namelijk in include path), daarna in /data/apache/php/mmp_lib en als ie de file in beide paden niet kan vinden krijg je een error. Oplossing is of de includes directory samen met inhoud verplaatsten naar de huidige directory, of volledige pad aangeven in de include of het include path aanpassen en aangeven waar deze includes directory staat.

"There are 10 kinds of people in the world, those who understand binary and those who don't" | Werkbak specs


Verwijderd

Topicstarter
Even hoe de "structuur" er uit ziet:

/pagina met "include"

/4images/includes/session.php

Dus de pagina met "include" staat in dezelfde directory als de map 4images.

Ligt hier misschien het probleem ?

Verwijderd

Topicstarter
Op zondag 14 juli 2002 19:17 schreef Zenith4ever het volgende:
code:
1
2
3
Fatal error: Failed opening required './includes/sessions.php' 
(include_path='.:/data/apache/php/mmp_lib')
 in index.php on line 31

Volgens mij is dit inderdaad een fout path
Post de code eens van index.php.
En kijk eens of .:/data/apache/php/mmp_lib' wel bestaat op de server.
Dit is de code van index.php
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<?php
/**************************************************************************
 *                                              *
 *    4images - A Web Based Image Gallery Management System        *
 *    ----------------------------------------------------------------    *
 *                                              *
 *       File: index.php                              *
 *    Copyright: (C) 2002 Jan Sorgalla                    *
 *      Email: jan@4homepages.de                        *
 *        Web: http://www.4homepages.de                  *
 *    Scriptversion: 1.6.1                              *
 *                                              *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                              *
 **************************************************************************
 *                                              *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-  *
 *    bedingungen (Lizenz.txt) für weitere Informationen.            *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice  *
 *    (Licence.txt) for further information.                    *
 *                                              *
 *************************************************************************/
$templates_used = 'home,category_bit,whos_online,thumbnail_bit';
$main_template = 'home';

define('GET_CACHES', 1);
define('ROOT_PATH', './');
define('GET_USER_ONLINE', 1);
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();

if (isset($HTTP_GET_VARS['template']) || isset($HTTP_POST_VARS['template'])) {
  $template = (isset($HTTP_GET_VARS['template'])) ? stripslashes(trim($HTTP_GET_VARS['template'])) : stripslashes(trim($HTTP_POST_VARS['template']));
  if (!file_exists(TEMPLATE_PATH."/".$template.".".$site_template->template_extension)) {
    $template = "";
  }
  else {
    $main_template = $template;
  }
}
else {
  $template = "";
}
include(ROOT_PATH.'includes/page_header.php');

if (!empty($template)) {
  $clickstream = "<a href=\"".$site_sess->url(ROOT_PATH."index.php")."\">".$lang['home']."</a>".$config['category_separator'].str_replace("_", " ", ucfirst($template));
  $site_template->register_vars("clickstream", $clickstream);
  $site_template->print_template($site_template->parse_template($main_template));
  include(ROOT_PATH.'includes/page_footer.php');
}

//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
$categories = get_categories(0);
if (!$categories)  {
  $categories = $lang['no_categories'];
}
$site_template->register_vars("categories", $categories);
unset($categories);

//-----------------------------------------------------
//--- Show New Images ---------------------------------
//-----------------------------------------------------
$imgtable_width = ceil(intval($config['image_table_width']) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
  $imgtable_width .= "%";
}

$cat_id_sql = 0;
foreach ($cat_cache as $key => $val) {
  if (!check_permission("auth_viewcat", $key)) {
    $cat_id_sql .= ", ".$key;
  }
}

$additional_sql = "";
if (!empty($additional_image_fields)) {
  foreach ($additional_image_fields as $key => $val) {
    $additional_sql .= ", i.".$key;
  }
}

$num_new_images = $config['image_cells'];
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", u.user_name, c.cat_name 
      FROM ".IMAGES_TABLE." i,  ".USERS_TABLE." u,  ".CATEGORIES_TABLE." c 
      WHERE i.image_active = 1 AND u.user_id = i.user_id AND c.cat_id = i.cat_id AND i.cat_id NOT IN ($cat_id_sql) 
      ORDER BY i.image_date DESC 
      LIMIT $num_new_images";
$result = $site_db->query($sql);
$num_rows = $site_db->get_numrows($result);

if (!$num_rows)  {
  $new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  $new_images .= $lang['no_new_images'];
  $new_images .= "</td></tr></table>";
}
else  {
  $new_images = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  $count = 0;
  $bgcounter = 0;
  while ($image_row = $site_db->fetch_array($result)){
    if ($count == 0) {
    $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
    $new_images .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    $new_images .= "<td width=\"".$imgtable_width."\" valign=\"bottom\">\n";

    show_image($image_row);
    $new_images .= $site_template->parse_template("thumbnail_bit");
    $new_images .= "\n</td>\n";
    $count++;
    if ($count == $config['image_cells']) {
    $new_images .= "</tr>\n";
    $count = 0;
    }
  } // end while

  if ($count > 0)  {
    $leftover = ($config['image_cells'] - $count);
    if ($leftover >= 1) {
    for ($f = 0; $f < $leftover; $f++) {
      $new_images .= "<td width=\"".$imgtable_width."\">\n&nbsp;</td>\n";
    }
    $new_images .= "</tr>\n";
    }
  }
  $new_images .= "</table>\n";
} // end else

$site_template->register_vars("new_images", $new_images);
unset($new_images);

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  "msg" => $msg,
  "clickstream" => $clickstream
));
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>

  • Elroy
  • Registratie: April 2000
  • Laatst online: 29-05 21:33

Elroy

Zelda!!!

Op maandag 15 juli 2002 17:46 schreef peterbuyk het volgende:
Even hoe de "structuur" er uit ziet:

/pagina met "include"

/4images/includes/session.php

Dus de pagina met "include" staat in dezelfde directory als de map 4images.

Ligt hier misschien het probleem ?
Zet het een daar neer /includes/session.php, dus niet in de map 4images

Specs Computer


Verwijderd

Topicstarter
Op maandag 15 juli 2002 18:09 schreef Elroy het volgende:

[..]

Zet het een daar neer /includes/session.php, dus niet in de map 4images
Dat gaat volgens mij niet want in de map 4images zit ook een index.php en mijn index.html moet ook omgezet worden naar index.php en je kunt geen twee index.php,s in dezelfde directory plaatsen want dan gaan ze elkaar overschrijven.

  • ^Mo^
  • Registratie: Januari 2001
  • Laatst online: 04-11-2025
wat wil je nou includen en wat staat er? In de code include je sessions.php maar in de paar vorige posts heb je het over session.php (zonder S!) ... dus wat is het nou?

"There are 10 kinds of people in the world, those who understand binary and those who don't" | Werkbak specs


  • dusty
  • Registratie: Mei 2000
  • Laatst online: 21-02 00:06

dusty

Celebrate Life!

In mijn mening gaat dit te ver richting "Helpdesk/Script request".

Back In Black!
"Je moet haar alleen aan de ketting leggen" - MueR

Pagina: 1

Dit topic is gesloten.