PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 20th, 2008, 05:48 PM
Anoole Anoole is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 16 Anoole User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 4 m 6 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Reverse htmlspecialchars or something

I have a project that gets from mysql the data that i search.
Until 10 minutes ago, the results could not display me correctly the Greek characters from mysql.
The search system searches the title of the item which contains English and Greek characters.

I solve this problem with this :
I use notepad for any encoding i do between ansi, unicode and utf8.
I wrote into notepad the title in English and for the Greek letters i wrote them in HTML encoded characters and i saved it as ANSI.

On phpmyadmin I uploaded the file choosing utf8 for Character set of the file and ANSI for sql compatibility.

i searched for that English word i wrote in the title and displayed to me the result WITH GREEK LETTERS correctly.
This is the only way to display Greek letters. I tried everything.

The problem is :
When i searched using that Greek letters that i wrote in the title the result showed me nothing. Then i searched again using the HTML encoded characters i used for that title and i got the result with Greek letters!

Having in mind that with HTML encoded characters the system found me the result, I guess there must be a line that it will convert the Greek characters to HTML encoded characters before it gives me the results.

Anyone knows anything about this?

Reply With Quote
  #2  
Old September 20th, 2008, 06:11 PM
requinix's Avatar
requinix requinix is online now
永琳! 永琳! 助けて, 永琳!
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 7,482 requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)  Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 1 Week 6 Days 23 h 45 m
Reputation Power: 5807
Send a message via MSN to requinix
Quote:
Originally Posted by Anoole
Anyone knows anything about this?

Considering that I have absolutely no experience with your system: no.

Are you looking for a way to reverse htmlspecialchars? Read.
__________________
How to ask a PHP question | Project Suggestions | It's okay to report stuff

Reply With Quote
  #3  
Old September 20th, 2008, 06:53 PM
Anoole Anoole is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 16 Anoole User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 4 m 6 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
I want special characters, like Greek letters are to be encoded to Html encoded characters.

Reply With Quote
  #4  
Old September 20th, 2008, 07:01 PM
requinix's Avatar
requinix requinix is online now
永琳! 永琳! 助けて, 永琳!
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 7,482 requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)  Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 1 Week 6 Days 23 h 45 m
Reputation Power: 5807
Send a message via MSN to requinix
Use htmlentities() instead of htmlspecialchars().

Reply With Quote
  #5  
Old September 20th, 2008, 07:12 PM
Anoole Anoole is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 16 Anoole User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 4 m 6 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Quote:
Originally Posted by requinix
Use htmlentities() instead of htmlspecialchars().


PHP Code:
<?php
$str 
'< p > & & < /  >';

echo 
htmlentities($str);
?>


This should get me a result right? but it did nothing!
I do not know why

Reply With Quote
  #6  
Old September 20th, 2008, 07:15 PM
requinix's Avatar
requinix requinix is online now
永琳! 永琳! 助けて, 永琳!
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 7,482 requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)  Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 1 Week 6 Days 23 h 45 m
Reputation Power: 5807
Send a message via MSN to requinix
Quote:
Originally Posted by Anoole
but it did nothing!

Why do you say that?

Reply With Quote
  #7  
Old September 20th, 2008, 07:18 PM
Anoole Anoole is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 16 Anoole User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 4 m 6 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Quote:
Originally Posted by requinix
Why do you say that?


because it didnt give the correct result!

PHP Code:
<?php
$str 
"A 'quote' is <b>bold</b>";

// Outputs: A 'quote' is <b>bold</b>
echo htmlentities($str);

// Outputs: A 'quote' is <b>bold</b>
echo htmlentities($strENT_QUOTES);
?>


this code does not work for me.

Reply With Quote
  #8  
Old September 20th, 2008, 07:28 PM
ryon420's Avatar
ryon420 ryon420 is offline
YOUR MOM
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2006
Location: The place next to the place next to me
Posts: 4,031 ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)  Folding Points: 1496 Folding Title: Novice Folder
Time spent in forums: 8 Months 3 Weeks 5 Days 13 h 39 m 51 sec
Reputation Power: 3159
Send a message via Google Talk to ryon420
What were you expecting? The Spanish Inquisition?
__________________
Quote:
Originally Posted by requinix
why does cyanide have to smell so nice?

Reply With Quote
  #9  
Old September 20th, 2008, 07:33 PM
requinix's Avatar
requinix requinix is online now
永琳! 永琳! 助けて, 永琳!
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 7,482 requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)  Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 1 Week 6 Days 23 h 45 m
Reputation Power: 5807
Send a message via MSN to requinix
Quote:
Originally Posted by Anoole
because it didnt give the correct result!

PHP Code:
<?php
$str 
"A 'quote' is <b>bold</b>";

// Outputs: A 'quote' is <b>bold</b>
echo htmlentities($str);

// Outputs: A 'quote' is <b>bold</b>
echo htmlentities($strENT_QUOTES);
?>


this code does not work for me.

It's working perfectly fine so stop complaining.

When you echo "A 'quote' is <b>bold</b>" you expect to see the word "bold" in bold, right? Because of the <b>.
Yet somehow after using htmlentities it's not bold.
So... it's magic?

Reply With Quote
  #10  
Old September 20th, 2008, 07:39 PM
Anoole Anoole is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 16 Anoole User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 4 m 6 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Yes you are right. But, you missed something.
I expect to give me the &#039 ;quote &#039 ; is &lt ;b&gt ;bold&lt ;/b&gt ;

something that i do not get.

Reply With Quote
  #11  
Old September 20th, 2008, 07:43 PM
ryon420's Avatar
ryon420 ryon420 is offline
YOUR MOM
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2006
Location: The place next to the place next to me
Posts: 4,031 ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)ryon420 User rank is General 33rd Grade (Above 100000 Reputation Level)  Folding Points: 1496 Folding Title: Novice Folder
Time spent in forums: 8 Months 3 Weeks 5 Days 13 h 39 m 51 sec
Reputation Power: 3159
Send a message via Google Talk to ryon420
Follow me...

1) Right click

2) View Source

3) ???

4) PROFIT!!!

If you don't want to do that every bloody time then you double htmlentities.

Reply With Quote
  #12  
Old September 20th, 2008, 07:49 PM
Anoole Anoole is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 16 Anoole User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 4 m 6 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Ok thank you for that. I have another question.
I use Greek letters as I said. When I write Greek letters and click save they are converted to Html chars. Is this will still work ?

and what you suggest me to use. htmlentities or htmlspecialchars ?

Reply With Quote
  #13  
Old September 20th, 2008, 09:02 PM
requinix's Avatar
requinix requinix is online now
永琳! 永琳! 助けて, 永琳!
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 7,482 requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)requinix User rank is General 72nd Grade (Above 100000 Reputation Level)  Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1Folding Points: 278759 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 1 Week 6 Days 23 h 45 m
Reputation Power: 5807
Send a message via MSN to requinix
You don't need to start a new thread when you already have one.

Remember what I said about reversing htmlspecialchars? Kinda, but try this one instead.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Reverse htmlspecialchars or something


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.


© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek