Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
inputing into text area turns weird
Old 08-05-2009, 04:56 PM inputing into text area turns weird
orionoreo's Avatar
Ultra Talker

Posts: 335
Name: Jerry
Trades: 0
somehow contents posted from.. say a word document or another website turns into weird symbols for me. I have traced it down to the storing part which fails. But I'm not sure how...

symbols of quotes turns out like:



my input script

PHP Code:

    
function format_input($input$html_entities=1) {
        
//Escape Codes
        
$input mysql_real_escape_string($input);
        
        
//Trim
        
$input trim($input);
        
        
//If Html Entities
        
if ($html_entities==1$input htmlentities($input);
        
        return 
$input;
    } 
mind you that if you type the quotes directly in the textarea it turns out ok.

I think somehow there's two quotes: ” vs "

any experiences with this?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
orionoreo is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-05-2009, 07:08 PM Re: inputing into text area turns weird
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Why Responsive Design?
Posts: 10,815
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
It's the way Word displays certain characters. There's all sorts of markup in the background that you don't see.

I'm not sure if there's a quick and easy way to remove the characters. I could be wrong, but I think you'll have to write a function in your php to clean the text. I found this post which shows you how to clean the Word text using regular expressions. Hopefully it helps.
__________________
l Search Engine Friendly Web Design |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Old 08-06-2009, 05:17 AM Re: inputing into text area turns weird
Novice Talker

Posts: 13
Trades: 0
Weird, you can try this but I'm not sure if it'll help..

PHP Code:
if ($html_entities==1$input htmlentities($inputENT_QUOTES);
if (
$html_entities==1$input htmlentities($inputENT_QUOTES'UTF-8');
if (
$html_entities==1$input htmlentities($inputENT_NOQUOTES);
if (
$html_entities==1$input htmlentities($inputENT_NOQUOTES'UTF-8'); 
premiumscripts is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to inputing into text area turns weird
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12118 seconds with 12 queries