RaitisC Posted May 9, 2007 Report Share Posted May 9, 2007 Tas ir chatam. Ir mysql tabula ar laukiem ID, user_name.., Nepiecieshams uztaisiit vaicaajumu peedeejam tabulas ierakstam, un uz xml paarveidot katru lauku. Ar FF viss darbojas perfekti, bet ie taisa briinumus. Teiksim njem ierakstus kas sen jau izdzeesti. Varbuut jaaizmanto veel kaadi "special" headeri?? <?php header("Expires: Mon, 26 Jul 1997 05:00:00 GMT" ); header("Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . "GMT" ); header("Cache-Control: cache, must-revalidate"); header("Pragma: public"); header("Content-Type: text/xml; charset=utf-8"); $connection = mysql_pconnect($hostname, $username, $password) or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db($database, $connection); //atrod peedeejo ierakstu $result = mysql_query("SELECT ID, user_name, message, post_time FROM chat ORDER BY ID DESC LIMIT 1 "); $last = mysql_fetch_assoc($result); $xml = '<?xml version="1.0" ?><root>'; $xml .= '<message>'; $xml .= '<ID>' . htmlspecialchars($last['ID']) . '</ID>'; $xml .= '<user>' . htmlspecialchars($last['user_name']) . '</user>'; $xml .= '<text>' . htmlspecialchars($last['message']) . '</text>'; $xml .= '<time>' . $last['post_time'] . '</time>'; $xml .= '</message>'; $xml .= '</root>'; echo $xml; ?> Link to comment Share on other sites More sharing options...
andrisp Posted May 9, 2007 Report Share Posted May 9, 2007 Nu droši vien no keša ņemās. Palabo to Cache-Control headeri. Link to comment Share on other sites More sharing options...
v3rb0 Posted May 9, 2007 Report Share Posted May 9, 2007 <ID> ar mazajiem burtiem. http://www.w3.org/TR/xhtml1/#h-4.2 un nava man kristāla bumba līdz, nezinu kādus brīnmus šis taisa.. varbūt vaina vispār nav nemaz xmlā Link to comment Share on other sites More sharing options...
RaitisC Posted May 9, 2007 Author Report Share Posted May 9, 2007 ID uz lower case nomainiiju, diemzheel nepaliidz. Ir taa ka IE njem kautkaadu ieraksotu no tabulas vidus.(ar FF un Operu viss straadaa OK. ) Izdzeesu vinju - taapat njem to pashu ierakstu :) Es arii domaaju par cache. Nomainiiju header uz no-cache - tas pats, nepaliidz. id lauks tabulai ir primary key, auto incriment. Varbuut ir veelkaadi varianti? Link to comment Share on other sites More sharing options...
andrisp Posted May 9, 2007 Report Share Posted May 9, 2007 Nu serverpusē problēma nebūs. Pamēģini iztīrīt kešu ar rokām un paskaties kas notiek. Link to comment Share on other sites More sharing options...
v3rb0 Posted May 9, 2007 Report Share Posted May 9, 2007 kad prasi xmlu tad prasi viņu nevis ar getxml.php bet ar getxml.php?random_key=2345356567678 tb. katru reizi ar unikālu urli - browserim/proxy vai kas nu tur viņu sakešojis vajadzētu saprast, ka ir citāds urlis un dot svaigāko. Link to comment Share on other sites More sharing options...
RaitisC Posted May 10, 2007 Author Report Share Posted May 10, 2007 jaa, paldies, ar random mainiigo viss dsrbojas! :) Link to comment Share on other sites More sharing options...
Recommended Posts