Mr. Osis Posted May 16, 2007 Report Share Posted May 16, 2007 XML failaa <?xml version="1.0" encoding="Windows-1257"?> <menu> <menuItems> <menuItem1> <mItext1>IK "Zemgales Poniji»</mItext1> <mIlink1>../index_tmp.htm</mIlink1> </menuItem1> <menuItem> <mItext>Mērķi un uzdevumi</mItext> <mIlink>merki.htm</mIlink> </menuItem> browserii: IK "Zemgales PonijiĀ» MÄ“rÄ·i un uzdevumi php failaa nekaads encoding nav noraadiits... cik stulbs es esmu? ;) kaads var paliidzeet ar padomu? Link to comment Share on other sites More sharing options...
andrisp Posted May 16, 2007 Report Share Posted May 16, 2007 Nosūti browseri pareizo headeri. (Vai nu ar meta vai ar http, bet visideālāk abejādi). Link to comment Share on other sites More sharing options...
Mr. Osis Posted May 16, 2007 Author Report Share Posted May 16, 2007 ja vari - uzmet code sample Link to comment Share on other sites More sharing options...
Mr. Osis Posted May 16, 2007 Author Report Share Posted May 16, 2007 anybody - plz help!!! Link to comment Share on other sites More sharing options...
andrisp Posted May 16, 2007 Report Share Posted May 16, 2007 Tu to xml apstrādā un sūti kā HTML ? <?php header('Content-Type: text/html; charset=windows-1257); ?> <head> <meta http-equiv="content-type" content="text/html; charset=windows-1257" /> </head> Link to comment Share on other sites More sharing options...
Mr. Osis Posted May 16, 2007 Author Report Share Posted May 16, 2007 nee - datus savaac php fails un izvada laukaa freimotaa lapaa iisaak sakot: http://www.poniji.lv/TEMP/PMZAA/index.htm pats php: http://www.poniji.lv/TEMP/PMZAA/parse.php Link to comment Share on other sites More sharing options...
andrisp Posted May 16, 2007 Report Share Posted May 16, 2007 Bet rezultāts taču ir HTML jebkurā gadijumā. Pieliec klāt headerus kā jau norādīju. Link to comment Share on other sites More sharing options...
Mr. Osis Posted May 16, 2007 Author Report Share Posted May 16, 2007 (edited) ja to pievieno php failam - errors panesas php code (full): <?php header('Content-Type: text/html; charset=windows-1257); <head> <meta http-equiv="content-type" content="text/html; charset=windows-1257" /> </head> // Load the XML file containing layout and items int the variable $menu $menu = simplexml_load_file("menu.xml"); // Making an array of words to replace $search = array ( 'LT', 'GT', 'REPLACE_LINK', 'REPLACE_TEXT' ); // The words to replace them with $replace_with = array ( '<', '>'); $pre = str_replace($search, $replace_with, $menu->layout->pre); echo $pre; // Print one line for every item foreach ($menu->menuItems->menuItem1 as $menuItem1) { $replace_with = array('<', '>', $menuItem1->mIlink1, $menuItem1->mItext1); $line1 = str_replace($search, $replace_with, $menu->layout->line1); echo $line1; } // Print one line for every item foreach ($menu->menuItems->menuItem as $menuItem) { $replace_with = array('<', '>', $menuItem->mIlink, $menuItem->mItext); $line = str_replace($search, $replace_with, $menu->layout->line); echo $line; } $replace_with = array ( '<', '>'); $post = str_replace($search, $replace_with, $menu->layout->post); echo $post; ?> XML code (full): <?xml version="1.0" encoding="windows-1257"?> <menu> <menuItems> <menuItem1> <mItext1>IK "Zemgales Poniji»</mItext1> <mIlink1>../index_tmp.htm</mIlink1> </menuItem1> <menuItem> <mItext>Mērķi un uzdevumi</mItext> <mIlink>merki.htm</mIlink> </menuItem> </menuItems> <layout> <!-- Some layout information LT will be replaced with < GT will be replaced with > REPLACE_LINK will be replaced with the link (mIlink) REPLACE_TEXT will be replaced with the text (mItext) //--> <pre></pre> <line>LTp align="left"GTLTbGTLTfont size="4" face="Times New Roman"GTLTa target="main" href="REPLACE_LINK"GTREPLACE_TEXTLT/aGT LT/fontGTLT/bGTLT/pGT</line> <line1>LTp align="left"GTLTbGTLTfont size="4" face="Times New Roman"GTLTa target="_top" href="REPLACE_LINK"GTREPLACE_TEXTLT/aGT LT/fontGTLT/bGTLT/pGT</line1> <post></post> </layout> </menu> Edited May 16, 2007 by Mr. Osis Link to comment Share on other sites More sharing options...
andrisp Posted May 16, 2007 Report Share Posted May 16, 2007 Ok, šoreiz es uzreiz redzu, kas par vainu, bet parasti ja ir kļūda, tad tā ir jāiekopē šeit, ja gribi, lai tev palīdz. Tātad - html tagi nedrīkst tā vienkārši parādīties iekš php. "Izkāp" ārā no php: ... // php kods ?> <html> <?php // php kods turpinās ... Link to comment Share on other sites More sharing options...
Mr. Osis Posted May 16, 2007 Author Report Share Posted May 16, 2007 (edited) piedo, bet tas nepaliidz - veelaizvien errors... ja novaac header - err pazuud, bet vienalga nav lv burtu Edited May 16, 2007 by Mr. Osis Link to comment Share on other sites More sharing options...
andrisp Posted May 16, 2007 Report Share Posted May 16, 2007 Nu i gan - es taču tikko tev teicu, ka ja tev skripts izmet kādu erroru, tad iekopē šeit, lai var redzēt. Un man šķiet tev headeri jāliek iekš index faila (tur kur freimi tiek definēti). Link to comment Share on other sites More sharing options...
Mr. Osis Posted May 16, 2007 Author Report Share Posted May 16, 2007 sorz.. neiebraucu uzreiz.. teitan i tas err: Parse error: syntax error, unexpected T_STRING in /webhotels/domains/www.poniji.lv/www/TEMP/PMZAA/parse.php on line 11 php code 11 rinda: $search = array ( 'LT', 'GT', 'REPLACE_LINK', 'REPLACE_TEXT' ); Link to comment Share on other sites More sharing options...
andrisp Posted May 16, 2007 Report Share Posted May 16, 2007 header('Content-Type: text/html; charset=windows-1257); Nav strings noslēgts. Vajag: header('Content-Type: text/html; charset=windows-1257'); Link to comment Share on other sites More sharing options...
Mr. Osis Posted May 16, 2007 Author Report Share Posted May 16, 2007 taga err nav, bet lv arii nav :( arii frame page ieliku... Link to comment Share on other sites More sharing options...
Kristabs Posted May 17, 2007 Report Share Posted May 17, 2007 Moš Tu mēģini utf-8 datus izvadīt kā win1257? Link to comment Share on other sites More sharing options...
Recommended Posts