|
| |
|
|
emtohio
Posts: 116 Joined: 2/23/2006 From: Dave Stevens Status: offline
|
PHP Question - 6/8/2009 19:45:45
I operate an EMS Job Website and had someone build a database for me. When posting a job to our website; http://www.fieldmedicsjobs.com/forms/postjob.htm In the text area to describe the job I guess the employers are just cut and pasting from another document. I get all kinds of crazy symbols when its posted to the site; example A dispatcher’s responsibility and • Experience in ambulance dispatching. • Knowledge of medical terminology. • Experience with customer service. I am assuming they were suposeed to be bullets but not sure, as for the first example I have no idea what caused it. I am not very good with PHP yet so what I have come up with so far is just to disable the HTML in the text area I have found this code <textarea onchange="this.disabled = true"></textarea> But it does not seem to work. Where ever I put it it knocks out my drop down menu for my States in the form. Can anyone help me or tell me what I should do or what I am doing wrong?
_____________________________
Dave Stevens President FIELDMEDICS.COM
|
|
|
|
ppruck
Posts: 3 Joined: 6/9/2009 Status: offline
|
RE: PHP Question - 6/9/2009 2:00:30
this should remove non ascii chars from a string : <?php $string = "place the string you need to clear here"; $string = preg_replace('/[^(\x20-\x7F)]*/','', $string); ?> i did test it on the examples you gave and it removed the unwanted ones no problem.
|
|
|
|
Giomanach
Posts: 6187 Joined: 11/19/2003 From: England Status: offline
|
RE: PHP Question - 6/9/2009 13:56:27
I'll explain on ppruck's answer a little more. PHP uses non-ascii characters to parse information, to perform certain actions. If these are found in query criteria, it will change them to something it understands better - not always what is wanted. Using the code ppruck provided you remove that problem by "replacing" it with something else, meaning the PHP won't produce funky characters ;)
_____________________________
|
|
|
|
emtohio
Posts: 116 Joined: 2/23/2006 From: Dave Stevens Status: offline
|
RE: PHP Question - 6/11/2009 11:12:35
Where do I add this in the code. I added it to the page and it still get this on a test post. ----------------- Rrrrrrrrrrrrrrrr Rrrrrrrrrrrrrrrrrr Rrrrrrrrrrrrrrrrrrrrrrr • Rrrrrrrrrrr • Tttttttttttt • Yyyyyyyyyyyy • Uuuuuuuuuuuu • Iiiiiiiiiiiiiiiii /> Uuuuuuuuugfh Gf Hfgh f --------------------------- this is what I posted Rrrrrrrrrrrrrrrr Rrrrrrrrrrrrrrrrrr Rrrrrrrrrrrrrrrrrrrrrrr • Rrrrrrrrrrr • Tttttttttttt • Yyyyyyyyyyyy • Uuuuuuuuuuuu • Iiiiiiiiiiiiiiiii Uuuuuuuuugfh Gf Hfgh f thanks for the help.
_____________________________
Dave Stevens President FIELDMEDICS.COM
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|