Find Jobs
Hire Freelancers

Cyrillic Characters RSS PHP MySQL

$10-15 USD

Em Andamento
Publicado há mais de 13 anos

$10-15 USD

Pago na entrega
I need an RSS feed made for a site built in php and mysql. the website is in russian and I believe the database stores articles in latin1 encoding. You'll have to make sure the title and descrition of the rss feed, and individual items display properly across all major browsers (ie, sefari, firefox, opera). ## Deliverables I will include the php code I've written so far exept for the db connection info: The problem I was having originally was that the article text and title looked like this: ?????? ?1 ?? ????? "??????? ? ??" Then I put this in the header: header("Content-Type: text/xml; charset=windows-1251");. most importantly was the "charset=windows-1251". This made the articles look almost fine, but the russian text that I hardcoded ended up looking like the articles looked before. In addition, whenever there are double quotes in the body of the article, it looks like so: \". A backslash to escape the quote. Not good. I give up, Somebody fix this darn thing. let me know what else you need (export of the db etc...) <?php // PHP file that renders perfect Dynamic XML for MySQL Database result sets // Script written by Adam Khoury @ [login to view URL] - April 05, 2010 // View the video that is tied to this script for maximum understanding // ------------------------------------------------------------------- header("Content-Type: text/xml; charset=windows-1251"); //set the content type to xml header("Content-Language: 'ru'"); // Initialize the xmlOutput variable $xmlBody = ' <rss version="2.0"> <channel> <title>????????? ???</title> <description>$desc</description> <link>[login to view URL]</link> <copyright>???? ????? ????????. ??????????? ?????????? ?????? ?? ???????????? ? ?????????.</copyright>'; // Connect to your MySQL database whatever way you like to here mysql_connect("localhost","db_user","db_pass") or die (mysql_error()); mysql_select_db("sinaius2_em") or die ("no database"); // Execute the Query on the database to select items(20 in this example) mysql_query("SET NAMES latin1"); $sql = mysql_query("SELECT `id`, `title`, `article_text`, `article_date` FROM `articles`ORDER BY `article_date` DESC LIMIT 0 , 15"); while($row = mysql_fetch_array($sql)){ // Set DB variables into local variables for easier use $id = $row["id"]; $title = $row["title"] ; $date_time = strftime("%b %d, %Y", strtotime($row["article_date"])); $description = $row["article_text"]; // Start filling the $xmlBody variable with looping content here inside the while loop // It will loop through 20 items from the database and render into XML format $xmlBody .= " <item> <title>$title</title> <description><![CDATA[$description]]></description> <pubDate>$date_time</pubDate> <link>[login to view URL]$id</link> </item> "; } // End while loop mysql_close(); // close the mysql database connection_aborted $xmlBody .= "</channel> </rss>"; print "<"; print "?xml version=\"1.0\" encoding=\"UTF-8\"?>"; echo $xmlBody; // output the gallery data as XML file for flash ?>
ID do Projeto: 3839434

Sobre o projeto

3 propostas
Projeto remoto
Ativo há 14 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos
Concedido a:
Avatar do Usuário
See private message.
$7 USD em 14 dias
5,0 (17 avaliações)
3,4
3,4
3 freelancers estão ofertando em média $11 USD for esse trabalho
Avatar do Usuário
See private message.
$12,75 USD em 14 dias
4,9 (26 avaliações)
4,3
4,3
Avatar do Usuário
See private message.
$12,75 USD em 14 dias
5,0 (12 avaliações)
3,8
3,8

Sobre o cliente

Bandeira do(a) UNITED STATES
New York, United States
5,0
1
Membro desde nov. 2, 2010

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.