Jetzt kostenlos Anmelden!

moon

unregistriert

1

Dienstag, 17. Februar 2009, 02:43

Includen geht nicht, aber wieso

EDIT://
Jetzt habe ich das wohl geschafft und dann kommt dieser Fehler:

Quellcode

1
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/www/html/web574/html/mix/left_header.php:71) in /var/www/html/web574/html/mix/gb/index.php on line 100


Ich habe den Code in der "gb/index.php":

PHP-Quelltext

1
$script_root  './';

Mit diesem ersetzt:

PHP-Quelltext

1
$script_root  './gb/';


So liegen die Dateien:

Quellcode

1
2
3
4
5
6
HTML (MEIST HTDOCS)
- ordner 1
- ......
- mix (das ist der ordner in dem alles liegt)
gb.php
gb/index.php


Zitat

Hallo zusammen,

ich versuche gerade etwas zu includen, was aber irgendwie nicht klappt, warum das weis ich nicht aber ich habe alles ausprobiert, ich möchte mir das iFrame ersparen.

Meine gb.php sieht so aus:

PHP-Quelltext

1
2
3
4
5
6
7
8
9
10
11
12
<?php include "left_header.php"?>
<div class="mainHeadline">
<img src="img/gb.png" alt="">
<div class="headlineContainer">
<h2>Mein pers&ouml;nliches G&auml;stebuch</h2>
</div>
</div>
<fieldset>
<legend>Lasse doch einen Gru&szlig; da</legend>
<!--<iframe src="gb/index.php" name="pframe" class="iframeHTML" marginwidth="0" allowtransparecy="true" marginheight="0" scrolling="no" width="100%" frameborder="0" height="1000"></iframe> -->
<? include ("gb/index.php"); ?>
</fieldset>


Dort wie man sieht, versuche ich die "gb/index.php" Datei zu includen, aber raus kommen diese Fehler:

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
Warning:  include(./inc/common.inc.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/web574/html/mix/gb/index.php on line 55
 
 Warning:  include(./inc/common.inc.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/web574/html/mix/gb/index.php on line 55
 
 Warning:  include() [function.include]: Failed opening './inc/common.inc.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/web574/html/mix/gb/index.php on line 55
 
 Warning:  include(./inc/table_check.inc.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/web574/html/mix/gb/index.php on line 56
 
 Warning:  include(./inc/table_check.inc.php) [function.include]: failed to open stream: No such file or directory in /var/www/html/web574/html/mix/gb/index.php on line 56
 
 Warning:  include() [function.include]: Failed opening './inc/table_check.inc.php' for inclusion (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/web574/html/mix/gb/index.php on line 56
 
 Fatal error:  Class 'Formfields' not found in /var/www/html/web574/html/mix/gb/index.php on line 73


So sieht die index.php aus:

PHP-Quelltext

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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
<?php

  /*****************************************************
  ** Title........: Guestbook Script
  ** Filename.....: index.php
  ** Author.......: Ralf Stadtaus
  ** Homepage.....: http://www.stadtaus.com/
  ** Contact......: http://www.stadtaus.com/forum/
  ** Version......: 0.9
  ** Notes........:               
  ** Last changed.: 2004-04-04
  ** Last change..: 
  *****************************************************/

  /*****************************************************
  **
  ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY
  ** OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
  ** LIMITED   TO  THE WARRANTIES  OF  MERCHANTABILITY,
  ** FITNESSFORAPARTICULARPURPOSE   AND
  ** NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR
  ** COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
  ** OR  OTHER  LIABILITY,  WHETHER  IN  AN  ACTION  OF
  ** CONTRACT,  TORT OR OTHERWISE, ARISING FROM, OUT OF
  ** OR  IN  CONNECTION WITH THE SOFTWARE OR THE USE OR
  ** OTHER DEALINGS IN THE SOFTWARE.
  **
  *****************************************************/





  /*****************************************************
  ** Settings
  *****************************************************/
      $script_root  './';
      $script_title '';
      $query_string '?';




  /*****************************************************
  ** Send safety signal to included files
  *****************************************************/
      define('IN_SCRIPT''true');




  /*****************************************************
  ** Include files
  *****************************************************/
      include($script_root 'inc/common.inc.php');
      include($script_root 'inc/table_check.inc.php');




  /*****************************************************
  ** Set file name
  *****************************************************/
      $file_namebasename($_SERVER['PHP_SELF']);





  /*****************************************************
  ** Initialyze form field class
  *****************************************************/
      $form = new Formfields;




  /*****************************************************
  ** Load form field templates into object
  *****************************************************/
      $form->define_form('sign'$new_form_fields);

      


  /*****************************************************
  ** Initialyze template class
  *****************************************************/
      $tpl = new my_template;




  /*****************************************************
  ** Prevent appending session id
  *****************************************************/
      $sid_name session_name();
      
      if ((isset($_GET[$sid_name]) and $trans_sid != 'no') or isset($_COOKIE[$sid_name])) {
          session_start();
      }
      



  /*****************************************************
  ** Load admin html template
  *****************************************************/
      if (isset($_SESSION['login_status']) and $_SESSION['login_status'] == 'IN') {
          $tpl->load_file('admin'$script_root $path['templates'] . $file['admin_details']);

          $admin_template $tpl->files['admin'];
          $logged_in  'true';
      } else {
          $admin_template '';
      }




  /*****************************************************
  ** Validate query string and set offset value.
  *****************************************************/
      if (isset($_GET['offset']) and !empty($_GET['offset']) and preg_match("/^[0-9]*$/"$_GET['offset'])) {
          $currentpage $_GET['offset'];
      } else {
          $currentpage 1;
      }




  /*****************************************************
  ** Initialyze database class
  *****************************************************/
      $db = new Database;




  /*****************************************************
  ** Connect and select database
  *****************************************************/
      if (!isset($message) and $db->db_connect($database)) {
          
          if ($db->db_select($database)) {




              /*****************************************************
              ** Count results
              *****************************************************/
                      $sql "SELECT COUNT(entry_id) FROM " ENTRY_TABLE;
            
                      if ($result_number $db->db_count_result($sql)) {
                          $result_true   'true';
                          $entries   $result_number;
            
            
                          if (!isset($results_per_page) or empty($results_per_page)) {
                              $limit $result_number;
                          } else {
                              $limit $results_per_page;
                          }
            
                          $allpages ceil($result_number $limit);
            
            
                          if (isset($currentpage) and !empty($currentpage)) {
                              $start $result_number $currentpage $limit;
                          } else {
                              $start $result_number;
                          }
            
                          if ($start 0) {
                              $limit   $result_number - ($allpages 1) * $limit;
                              $start   0;
                              $currentpage $allpages;
                          }
            
            
            
            
                  /*****************************************************
                  ** Set offset value for template (mainly for delete
                  ** and edit entry link in admin template
                  *****************************************************/
                          $offset $currentpage;
            
            
            
            
            
                  /*****************************************************
                  ** Browse pages - next - previous link
                  *****************************************************/
                          if ($start $result_number $limit) {
                              $previous_start $currentpage 1;
                              $previous_result_page 'true ';
                          } else {
                              $previous_result_page '';
                          }
            
            
                          if ($start 0) {
                              $next_start $currentpage 1;
                              $next_result_page 'true';
                          } else {
                              $next_result_page '';
                          }
            
            
            
                  /*****************************************************
                  ** Pre-select results
                  *****************************************************/
                          $sql "SELECT entry_id FROM " ENTRY_TABLE " LIMIT " $start ", " $limit;
            
            
                          if ($result_range $db->db_search_entries($sql)) {
            
                              $between_start $result_range[0]['entry_id'];
                              $between_end   $result_range[count($result_range)-1]['entry_id'];
            
                              $id_range " AND t1.entry_id BETWEEN " $between_start " AND " $between_end;
            
                          } else {
                              $id_range '';
                          }
            
            
            
            
                  /*****************************************************
                  ** Select content
                  *****************************************************/
                          $sql "  SELECT  t1.entry_id, t1.full_text, 
                                                t2.data_id, t2.entry_id, t2.data_name, t2.data_content
                          
                                    FROM    " ENTRY_TABLE " AS t1, 
                                                " DATA_TABLE "  AS t2 
                          
                                    WHERE   t2.entry_id = t1.entry_id " $id_range " 
                                    ORDER BYt1.entry_id DESC";
            
                          if ($search_result $db->db_search_entries($sql)) {
            
                              $new_search_result data_loop($search_result'entry_id''true');
                              $guestbook_entries array_values($new_search_result);
            
                          }
            
            
            
            
                  /*****************************************************
                  ** Apply row class
                  *****************************************************/
                          while (list($key$val) = each($guestbook_entries))
                          {
                              if (!isset($rowclass) or $rowclass == 'lightrow') {
                                  $rowclass 'darkrow';
                              } else {
                                  $rowclass 'lightrow';
                              }
            
                              $guestbook_entries[$key]['rowclass'] = $rowclass;
                          }
            
            
            
            
                  /*****************************************************
                  ** Page statistics
                  *****************************************************/
                          // $currentpage = ceil($start / $results_per_page) + 1;
            
            
            
            
                  /*****************************************************
                  ** Generate direct page link menu
                  *****************************************************/
                          $pagelink 0;
                          $i    1;
            
                          if ($allpages 1) {
            
                              while ($i <= $allpages) {
            
                                  if ($i == $currentpage) {
                                      $link_class 'currentpage';
                                  } else {
                                      $link_class 'allpages';
                                  }
            
                                  $page_direct[] = array('page'   => $i++,
                                                         'link'   => $pagelink,
                                                         'file_name'  => $file_name,
                                                         'link_class' => $link_class);
            
                                  $pagelink += $results_per_page;
                              }
                          }
            
                          $start_link 1;
                          $end_link   $allpages;
            
            
            
            
                  /*****************************************************
                  ** Cut off oversized direct page links
                  *****************************************************/
                          if (isset($direct_page_links) and !empty($direct_page_links) and isset($page_direct) and count($page_direct) > $direct_page_links) {
            
                              $half_offset ceil($direct_page_links );
                              $offset_end  $allpages $direct_page_links;
            
                              if ($currentpage <= $half_offset) {
                                  $start_element 0;
                              }
            
                              if (!isset($start_element) and $currentpage $half_offset and ($currentpage $half_offset) < $offset_end) {
                                  $start_element $currentpage $half_offset;
                                  $page_link_start 'true';
                              }
            
                              if (!isset($start_element) and $currentpage >= $offset_end) {
                                  $start_element $offset_end;
                                  $page_link_start 'true';
                              } else {
                                  $page_link_end 'true';
                              }
            
                              if (isset($start_element)) {
                                  $page_direct array_slice($page_direct$start_element$direct_page_links);
                              }
                          }
            
            
            
                      } else {
                          $result_number 0;
                      }




          /*****************************************************
          ** End database connect select if
          *****************************************************/      
          }
      }




  /*****************************************************
  ** Load part html template
  *****************************************************/
      $tpl->load_file('guest'$script_root $path['templates'] . $file['entries']);

      $main_content $tpl->return_file('guest');




  /*****************************************************
  ** Load main layout html template
  *****************************************************/
      $tpl->load_file('main'$script_root $path['templates'] . $file['main_layout']);
      $tpl->register('main''main_content');
      $tpl->parse('main');
      
      $tpl->files['guest'] = $tpl->return_file('main');




  /*****************************************************
  ** Load entry detail html template
  *****************************************************/
      $tpl->load_file('detail'$script_root $path['templates'] . $file['entry_detail']);
      $tpl->parse_loop('detail''guestbook_entries');

      $entry_detail $tpl->return_file('detail');

      $tpl->register('guest''entry_detail');




  /*****************************************************
  ** Register language file and additional text array
  *****************************************************/
      if (isset ($include_files) and is_array ($include_files)) {
          reset ($include_files);
          while(list($key$val) = each($include_files))
          {
              if ($file_content include_content($val)) {
                  $$key $file_content;
              } else {
                  $$key '<pre>[' $txt['txt_file_not_found'] . ': ' $val ']</pre>';
              }
              $tpl->register('guest'$key);
          }
      } 
      
      if (isset ($txt) and is_array ($txt)) {
          reset ($txt);
          while(list($key$val) = each($txt))
          {
              $$key $val;
              $tpl->register('guest'$key);
          }
      }


      if (isset($add_text) and is_array($add_text)) {
          reset ($add_text);
          while(list($key$val) = each($add_text))
          {
              $$key $val;
              $tpl->register('guest'$key);
          }
      }




  /*****************************************************
  ** Parse template
  *****************************************************/
      $tpl->register('guest', array('query_string',
                                     'previous_start',
                                     'next_start',
                                     'file_name',
                                     'allpages',
                                     'currentpage',
                                     'start_link',
                                     'end_link',
                                     'offset',
                                     'entries'
                                     ));

      $tpl->parse_loop('guest''message');

      $tpl->parse_if('guest''previous_result_page');
      $tpl->parse_if('guest''next_result_page');
      $tpl->parse_if('guest''page_link_end');
      $tpl->parse_if('guest''page_link_start');
      $tpl->parse_if('guest''logged_in');
      $tpl->parse_loop('guest''page_direct'); @eval($conf_var);

      debug_mode(script_runtime($runtime_start), 'Script Runtime');




?>


Kann mir da jemand helfen? Ich habe keine Ahnung was das sein soll.

Dieser Beitrag wurde bereits 4 mal editiert, zuletzt von »moon« (17. Februar 2009, 03:02)

  • Zum Seitenanfang
  • Zum Seitenende

Dirk Kántor Männlich

aká Dooki

Beiträge: 2 074

Geschlecht: Männlich

PHPKIT Version: keine

2

Dienstag, 17. Februar 2009, 12:40

die mix/left_header.php an zeile 71 muckt rum..

was steht da drin?
:thumbsup:    :thumbsup:       *tc*       :thumbsup:    :thumbsup:
8o           Achtung: Dirk Kántor ist unterwegs!           8o
Er verteilt gerne Verwarnungen ohne vorher darüber diskutiert zu haben.
  • Zum Seitenanfang
  • Zum Seitenende

moon

unregistriert

3

Donnerstag, 19. Februar 2009, 13:41

Danke für die Hilfe, konnte es aber selber lösen!
Habe aber ein anderes Problem

Meine index.php sieht so aus:

PHP-Quelltext

1
2
<?xml version="1.0" encoding="UTF-8"?>
<?php include "index.html"?>


Wenn ich die aufrufe, dann kommt dieser Fehler:

Quellcode

1
Parse error:  syntax error, unexpected T_STRING in /var/www/html/web574/html/mix/index.php on line 1


Egal, ob ich das

PHP-Quelltext

1
<?xml version="1.0" encoding="UTF-8"?>
in der index.php oder in der index.html schreibe, der Fehler kommt immer!
  • Zum Seitenanfang
  • Zum Seitenende

Dirk Kántor Männlich

aká Dooki

Beiträge: 2 074

Geschlecht: Männlich

PHPKIT Version: keine

4

Samstag, 21. Februar 2009, 03:44

wenn deine index.php allein so aussieht:

PHP-Quelltext

1
<?php include "index.html"?>


kommt der fehler auch?
:thumbsup:    :thumbsup:       *tc*       :thumbsup:    :thumbsup:
8o           Achtung: Dirk Kántor ist unterwegs!           8o
Er verteilt gerne Verwarnungen ohne vorher darüber diskutiert zu haben.
  • Zum Seitenanfang
  • Zum Seitenende

moon

unregistriert

5

Samstag, 21. Februar 2009, 15:39

Ne, dass klappt dann wunderbar!
Sobald ich das:

PHP-Quelltext

1
<?xml version="1.0" encoding="UTF-8"?>

dazuschreibe, kommt der Fehler. Auch wenn ich das in die left_header.php oder index.html schreibe, immer wieder kommt der Fehler dann und ich weis nicht woran das liegt.

Ich möchte halt einfach das der Zeichensatz auf UTF-8 kodiert wird, denn sonst muss ich alle Umlaute immer selber umschreiben!
  • Zum Seitenanfang
  • Zum Seitenende

2Bad4You Männlich

findet sich zurecht

Beiträge: 103

Geschlecht: Männlich

Wohnort: Neustadt/Wied

PHPKIT Version: keine

6

Samstag, 21. Februar 2009, 17:45

Hi,

hast du in deiner php.ini den Wert "short_open_tag" auf On stehen? Wenn ja stelle diesen mal auf Off, danach sollte es gehen.
  • Zum Seitenanfang
  • Zum Seitenende

moon

unregistriert

7

Samstag, 21. Februar 2009, 19:07

Das ist ein Code aus dem Wbb3 in meiner WBB3 Software wird dieser Wert ja auch genutzt und es kommen keine Fehler, nur wenn ich diesen so verwende.

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »moon« (21. Februar 2009, 20:00)

  • Zum Seitenanfang
  • Zum Seitenende

Dirk Kántor Männlich

aká Dooki

Beiträge: 2 074

Geschlecht: Männlich

PHPKIT Version: keine

8

Sonntag, 22. Februar 2009, 04:40

und wenn du in die index.php einfach mal folgendes schreibst:

PHP-Quelltext

1
echo '<?xml version="1.0" encoding="UTF-8"?>';


was is dann?
:thumbsup:    :thumbsup:       *tc*       :thumbsup:    :thumbsup:
8o           Achtung: Dirk Kántor ist unterwegs!           8o
Er verteilt gerne Verwarnungen ohne vorher darüber diskutiert zu haben.
  • Zum Seitenanfang
  • Zum Seitenende

moon

unregistriert

9

Sonntag, 22. Februar 2009, 09:45

Danke für deine Hilfe, doch dennoch kommt dieser Fehler:

Quellcode

1
Parse error:  syntax error, unexpected T_STRING in /var/www/html/web574/html/mix/index.php on line 1
  • Zum Seitenanfang
  • Zum Seitenende