PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPHP Development
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today.

ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Download and Activate to enter!

Intel® Graphics Performance Analyzers is a powerful tool suite for analyzing and optimizing your games, media, and graphics-intensive applications. Used by some of the best developers on the planet, Intel GPA lets you maximize your app’s performance.


Tutorials
| Forums

Download to Enter
| Contest Rules

DOWNLOAD INTEL® GPA FOR FREE

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, 06: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, 07:11 PM
requinix's Avatar
requinix requinix is offline
Good morning!
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 10,252 requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 3 Weeks 6 Days 17 h 52 m 19 sec
Reputation Power: 7602
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo 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.
__________________
#306770: Always accept input, but have a good regex.
Site rules and FAQ | Project Suggestions | mod_rewrite guide | PHP Guide and FAQ | Regex Resources

Reply With Quote
  #3  
Old September 20th, 2008, 07: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, 08:01 PM
requinix's Avatar
requinix requinix is offline
Good morning!
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 10,252 requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 3 Weeks 6 Days 17 h 52 m 19 sec
Reputation Power: 7602
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix
Use htmlentities() instead of htmlspecialchars().

Reply With Quote
  #5  
Old September 20th, 2008, 08: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, 08:15 PM
requinix's Avatar
requinix requinix is offline
Good morning!
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 10,252 requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 3 Weeks 6 Days 17 h 52 m 19 sec
Reputation Power: 7602
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix
Quote:
Originally Posted by Anoole
but it did nothing!

Why do you say that?

Reply With Quote
  #7  
Old September 20th, 2008, 08: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, 08:28 PM
ryon420's Avatar
ryon420 ryon420 is offline
Permanently Banned
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2006
Location: The place next to the place next to me
Posts: 4,147 ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)  Folding Points: 1496 Folding Title: Novice Folder
Time spent in forums: 9 Months 2 Days 9 h 9 m 11 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Send a message via MSN to ryon420 Send a message via Google Talk to ryon420
What were you expecting? The Spanish Inquisition?

Reply With Quote
  #9  
Old September 20th, 2008, 08:33 PM
requinix's Avatar
requinix requinix is offline
Good morning!
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 10,252 requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 3 Weeks 6 Days 17 h 52 m 19 sec
Reputation Power: 7602
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo 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, 08: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, 08:43 PM
ryon420's Avatar
ryon420 ryon420 is offline
Permanently Banned
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jun 2006
Location: The place next to the place next to me
Posts: 4,147 ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)ryon420 User rank is General 35th Grade (Above 100000 Reputation Level)  Folding Points: 1496 Folding Title: Novice Folder
Time spent in forums: 9 Months 2 Days 9 h 9 m 11 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Send a message via MSN to ryon420 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, 08: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, 10:02 PM
requinix's Avatar
requinix requinix is offline
Good morning!
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 10,252 requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)requinix User rank is General 99th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 3 Weeks 6 Days 17 h 52 m 19 sec
Reputation Power: 7602
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo 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

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


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

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 5 - Follow our Sitemap