TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 09-20-2009, 02:32 PM   #1 (permalink)
The Acquainted
 
Peuplarchie's Avatar
 
Join Date: May 2008
Location: Québec
Posts: 104
Thanks: 10
Peuplarchie is on a distinguished road
Application Replace special chars not tags, php trigered by html

Good day to you all,
I working on a code which take a txt file and display it through php, but this thing is triggered by ajax.

in the txt files there is html tags and html special chars.


What I'm trying to do is encode only the special chars.
ex : é è ì

Php read those character not a problem, it when I pass it by ajax that i get some weird chars like squares with a question mark.

Does anybody have an idea on how I can fix this ?


Here is the code that get triggered when i click on a ajax link :
PHP Code:

<?php
$textsectb 
file_get_contents('dep_en_tb.txt');
$textsechttb htmlentities($textsectb);
echo 
$textsechttb;
?>
I only need to replace the special char not the html tags.

Thanks!
__________________
That's why we are not alone on earth... let's build !
Peuplarchie is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Tags Issue.. skv Absolute Beginners 9 06-22-2009 02:42 PM
file_get_contents with PHP tags hello-world Absolute Beginners 4 03-30-2009 08:32 PM
HTML tags xenon Advanced PHP Programming 3 02-02-2008 04:30 PM
Embeding PHP inside HTML documents Orc General 8 01-18-2008 08:10 PM
Make html pages work like php sam Tips & Tricks 2 02-09-2007 01:00 PM


All times are GMT. The time now is 05:13 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design