nepateemu Posted November 10, 2011 Report Share Posted November 10, 2011 Vai kaads var paliidzeet ar include, require_once ? index failaa iekljaavu <?php include("includes/header.php"); ?>, header.php saakums izskataas shaadi: <?php require_once("includes/connection.php"); ?> <?php require_once("includes/functions.php"); ?> <!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> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> Liidziigs gljuks bija kad meigjinaaju define constants iekljaut connection.php failaa.. Probleema - <head> radas tuksh un head info iet iekshaa <body> un pirmaa liinija radas balta body tagaa. (pirmais include) Quote Link to comment Share on other sites More sharing options...
draugz Posted November 10, 2011 Report Share Posted November 10, 2011 es peļauju, ka tev ir nepareiza html struktūra un gudrais pārlūks visu uzdara kā nākas, varbūt iepostē ko tad īsti tev atgriež tas pārlūks kad palaid skriptu :) Quote Link to comment Share on other sites More sharing options...
nepateemu Posted November 10, 2011 Author Report Share Posted November 10, 2011 (edited) no firebug: html xmlns="http://www.w3.org/1999/xhtml"> <head></head> <body> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> <title>titles</title> <link media="screen" type="text/css" href="css/main.css" rel="stylesheet"> <link type="image/x-icon" href="favicon.ico" rel="icon"> <link type="image/x-icon" href="favicon.ico" rel="shortcut"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.5.3/jquery-ui.min.js" type="text/javascript"> <script src="js/jquery.droppy.js" type="text/javascript"> <div id="navDiv"> <div id="wrapper"><---------------------- visi html tagi iekljauti te --------------> <script type="text/javascript"> <script type="text/javascript"> <script type="text/javascript"> <div id="ui-datepicker-div" style="display: none;"></div> </body> </html> kaa iznjemu <?php require_once("includes/functions.php"); ?> rindinju taa viss html pareizi raadas. Edited November 10, 2011 by nepateemu Quote Link to comment Share on other sites More sharing options...
briedis Posted November 10, 2011 Report Share Posted November 10, 2011 Un ko satur functions? Quote Link to comment Share on other sites More sharing options...
nepateemu Posted November 10, 2011 Author Report Share Posted November 10, 2011 taka es vel tikai spelejos ar php un paredzu tur nakotnee likt pareejas funkcijas tad pashlaik tur ir tikai: <?php function hello(){ echo "hello"; } ?> Quote Link to comment Share on other sites More sharing options...
draugz Posted November 10, 2011 Report Share Posted November 10, 2011 pamēģini to <?php require_once("includes/functions.php"); ?> ielikt kaut kur starp body tagiem un paskaties kas notiek. Izskatās, ka sintakse ir pareiza functions.php saturam, bet varbūt izlec kāds cits paziņojums :) Quote Link to comment Share on other sites More sharing options...
nepateemu Posted November 10, 2011 Author Report Share Posted November 10, 2011 (edited) Jau meigjinaaju ielikt citur starp tagiem / apvienot vienaa require_one | include / komentaaru ielikt pirms funkcijas php tagaa. Ja uztaisu kljuudu, tad baltaas rindinjas vietaa raadas errora teksts un pareejais viss ielaadeejas (liekot iekshaa visu body tagaa) Edited November 10, 2011 by nepateemu Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted November 10, 2011 Report Share Posted November 10, 2011 Firebugā tu jau redzi html kā to pārveidojis firefox, skaties iekš View Page Source(ctrl + u). Ja tur viss ir pareizā secībā, tad pieļauju, ka functions.php veic kaut kādu izvadi (tukšas rindas, space, BOM), kā dēļ lapa tiek attiecīgi pārveidota. Quote Link to comment Share on other sites More sharing options...
Mr.Key Posted November 10, 2011 Report Share Posted November 10, 2011 Novāc php failos ?> Quote Link to comment Share on other sites More sharing options...
nepateemu Posted November 10, 2011 Author Report Share Posted November 10, 2011 (edited) Novacot iekļautajos failos ?> nedeva rezultātu. Ja nonjemu beigu ?> tad velarvien lapa ielaadeejas nepareizi, ja php failos iznjemu php saturu un atstaaju tikai html tad viss ielaadeejas pareizi, tachu php arii nodereetu... Connection.php saturs: <?php require("constants.php"); $connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS); if(!$connection) { die("Database connection failed: " . mysql_error()); } $db_select = mysql_select_db(DB_NAME,$connection ); if(!$db_select){ die("Database selection failed: " . mysql_error()); } ?> Edited November 10, 2011 by nepateemu Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 10, 2011 Report Share Posted November 10, 2011 Ja failā ir tikai PHP (lasi: nav HTML), tad aizverošo (?>) PHP tagu atstāšana tur ir slikta prakse, jā. Tā bija rakstīts PHP manuālī! :) Quote Link to comment Share on other sites More sharing options...
vitao.web Posted November 10, 2011 Report Share Posted November 10, 2011 Tev nav gadījumā saglabāts kaut kā ar utf - 8 without BOM vai kaut kā tā? TAs maybe var būt par iemeslu Quote Link to comment Share on other sites More sharing options...
nepateemu Posted November 11, 2011 Author Report Share Posted November 11, 2011 peec traumas ar lv garumziimem visur liku utf-8, nezinaaju ka tas php gadiijumaa vareeja radiit shaadas probleemas.. index failam atstaaju utf-8, bet visiem include failiem uzliku ANSI kodeejumu un tagad gan head, gan viss pārējais rādās pareizi.. Quote Link to comment Share on other sites More sharing options...
Mr.Key Posted November 11, 2011 Report Share Posted November 11, 2011 UTF-8 without BOM (tukšs fails ir 0B, nevis 3B) Quote Link to comment Share on other sites More sharing options...
daGrevis Posted November 11, 2011 Report Share Posted November 11, 2011 Vai tad nav tā, ka UTF-8 with BOM ir 3 baiti? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.