| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Apr 2004 Location: IL
Posts: 348
![]() | Another PHP problem I'm writing my first major site using a database and php. Of course I keep running into things I don't know yet. So here is my latest problem. I'm working on an article submission and get an error anytime there is a ' , " : ; and other common punction. I know I need to do something in the processing part of the code. Help please? |
| |
| | #2 (permalink) |
| Senior Member Join Date: Nov 2005 Location: Hong Kong
Posts: 1,154
![]() ![]() ![]() | put a \ infront of each special character.
__________________ If you're as bored as I am, join me in Fallensword! (I swear, this game is actually pretty fun :P) |
| |
| | #3 (permalink) |
| NamePros Expert Join Date: Nov 2003 Location: Scotland
Posts: 5,069
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | if the error is occuring when you try and input them into the database you can use mysql_real_escape_string() if you are using mysql (there are similar functions for other databases) In addition if the string is to be displayed on a web page then you could also run it through htmlentities() which will stop the browser processing any html instead of displaying it. |
| |
| | THREAD STARTER #4 (permalink) | ||||||||
| NamePros Regular Join Date: Apr 2004 Location: IL
Posts: 348
![]() |
| ||||||||
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Annual Christmas Sale @ Erudnet | Hot Deals | PHP 5 HOSTING! | iNod | Web Hosting Offers | 0 | 12-01-2005 08:51 PM |
| Problem with PHP | monRa | Programming | 15 | 09-12-2005 05:28 AM |
| local server installations, urgent help needed. | Porte | Web Hosting Discussion | 1 | 06-23-2005 04:05 PM |
| PHP Problem on a website? | aal814 | Web Design Discussion | 1 | 12-29-2004 11:53 AM |