Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Required_once...dziwny problem
IMP
post
Post #1





Grupa: Zarejestrowani
Postów: 45
Pomógł: 0
Dołączył: 20.08.2007

Ostrzeżenie: (0%)
-----


Krótka piłka... mam takie oto kod w pliku index.php

  1. <?php
  2.  require_once('engine/database.php');
  3.  require_once('class/master.php');
  4.  require_once('class/content.php');
  5.  
  6.  $class_db = new database();
  7.  $class_db->connect_db();
  8.  
  9.  $master = new master();
  10.  $master->display();
  11.  
  12.  
  13. ?>


A to kod kliku engine/database.php:

  1. <?php
  2. class database
  3. {
  4.  public $result;
  5.  
  6.  function connect_db()
  7.  {
  8.   if(!mysql_connect('localhost', 'root', ''))
  9.   return false;
  10.   mysql_query("SET NAMES 'UTF-8' ");
  11.   return mysql_selectdb('CMS');
  12.  }
  13.  
  14.  function select($query)
  15.  {
  16.   return mysql_query($query);
  17.  }
  18.  
  19.  function insert($query)
  20.  {
  21.   return mysql_query($query);
  22.  }
  23. }
  24. ?>


problem polega na tym iz funkcje "require_once();" zwracaja mi jakies dziwne znaczki na poczatku pliku. Opera je ignoruje ale juz FF i IE przesuwa tresc strony nizej.

Oto przykladowy kod wynikowy:

  1. ...<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1—strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>wpd cms v.0.1</title>
  2. <meta name="keywords" content="skrypt"/><meta http-equiv="content-type" content="text/html" charset="UTF-8" /><link rel="stylesheet" href="template/blue/style.css" type="text/css" media="all" /></head><body><div id="container">
  3. <img src="template/blue/images/blue_04.jpg" />




na dobra sprawe te kropki w przykladzie musialem dodac recznie bo by ich tutaj nie bylo widac...



Prosze o pomoc:) Będe naprawede wdzięczny:)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 05:08