Jump to content
php.lv forumi

xml -> darbojas uz FFox, neiet uz ie


RaitisC

Recommended Posts

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

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

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

×
×
  • Create New...