View Full Version : Quotation Marks
Pendragon_6
03-29-2006, 10:00 AM
Having a problem with quotation marks.
Everytime I print quotation marks I'm also getting a forward slash. Changed keyboards, but still have the problem. Any suggestions?
Thanx in advance,
Pendragon
DoctorDoom
03-29-2006, 10:16 AM
Got an example?
Pendragon_6
03-29-2006, 12:32 PM
Liberty News Forum (http://boredatschool.net/index.php?q=aHR0cDovL3d3dy5saWJlcnR5bmV3c2ZvcnVtLm NvbS9saWJlcnR5bmV3c2ZvcnVtY2dpL1lhQkIvWWFCQi5jZ2kv WWFCQi5jZ2k%2FYm9hcmQ9Z2VuZXJhbDthY3Rpb249ZGlzcGxh eTtudW09MTE0MzY1MTExMQ%3D%3D)
============================================
Doc:
It seems to happen mostly on this board. I changed keyboards and notified the admin at this site but got no response. I wonder if the editor there is screwy.
==================================================
Ex.
That’s not news. That’s a fact. Liberals have hijacked America’s cultural, social and educational institutions since the 1960s wild Cultural and Sexual Revolution. The self-indulgent \"Me Generation.\"
Bush is a traditionalist. So are most Americans. Liberals want to rewrite the American Constitution. They are anti-military, anti-war, anti-America. That’s not news either.
What’s news is that Bush led the charge in the global War on Terror and is gradually winning the fight for freedom and liberty for all human beings.
Notice I didn’t use the word \"democracy.\" America was not founded as a \"democracy.\" It was founded as a Constitutional Republic (\"Rule of Law\").
Democracy, according to Greek philosopher Plato, is anarchy (\"Mob Rule\"). And that’s what the liberals want – Mob Rule!
For those who don’t know history, they will go on repeating the mistakes of the past, as the liberals have been doing the past half-century. They just don’t get it. Our culture is not about self-indulgence; it’s about the \"Golden Mean\" – everything in moderation.
Politicians have yet to learn that lessen. They believe that government is the solution to all of our problems – meaning more taxes and more oppressive government suppressing freedom, liberty and opportunity.
BEST45CAL
03-29-2006, 02:31 PM
Did you clean the food out of your keyboard? Is there a sandwich in there or something?
Sounds like you've got some keys sticking.
Try holding it upside down and shaking it. I'll bet a couple of people come falling out, too.
Wolfcounsel
03-29-2006, 02:37 PM
Slow down the repeating speed of the keyboard, and try to lift your finger off the quotes before you release the Shift key.
Rhino
03-29-2006, 02:42 PM
I see the same slashes when I visit that site, so it is likely their problem. However, your link doesn't actually go to libertynewsforum.com. It goes to boredatschool.net. I still see the slash marks either way though. BTW, I edited your "Bush has kept..." thread and removed the slashes, so it looks better.
DoctorDoom
03-29-2006, 08:41 PM
From what I've found, a backslash is used in strings as an escape character to identify a quotation mark as text rather than as a code.
Magic Quotes
The other issue I mentioned would be covered later was the use of backslashes to escape quotation marks in form data. To restate the problem, PHP uses backslashes to escape quote marks in form data when it is submitted. What that means is that, if you have a text input field in a form, and the user enters a string that includes quotation marks, PHP will "escape" those quotation marks with backslashes. All that really means is that PHP will insert a backslash character immediately before the quote mark to indicate that it is part of the data and not an actual string delimiter. Consider this input:
[Doc "Hollywood" Jones]
If the quote marks were not escaped, your string would include the quote marks and PHP would not be able to tell that they were not intended to delimit the string. It would look like this:
$_POST['var']="Doc "Hollywood" Jones";
See the problem? Here, you have $var="Doc " which makes a complete PHP assignment. However, you still have more on the line: Hollywood" Jones";. PHP will not be able to parse that because it's a nonsense command. PHP will generate a compiler error and the command will not execute. If you want to embed quotation marks in a string, they must be escaped with the backslash character. A properly formed command would then look like this:
$_POST['var']="Doc \"Hollywood\" Jones";
The backslash tells PHP that the following character is not a delimiter, but is instead, just part of the value. PHP, in a "normal" installation will default to automatically including the backslash character in any form data that is passed to it. This is handled by the setting of the magic_quotes_gpc configuration setting. When this is turned on, any double quote, single quote, backslash, or null value in the user input will be escaped with the backslash character. The "gpc" simply means GET, POST, and COOKIE.Form Handling with PHP (http://www.apptools.com/phptools/forms/forms7.php)
vBulletin uses PHP, as noted in the URL of the pages. The slashes shouldn't appear. The site itself may have some bad coding.
Pendragon_6
03-30-2006, 09:19 AM
Thanks to all for your good suggestions.
Doc: Is this the format to use when posting quotation marks then:
$_POST['var']="Doc \"Hollywood\" Jones"?
DoctorDoom
03-30-2006, 11:15 PM
That's PHP code. It should be done automatically by the board software and be transparent to the user. It may be flaky.
jayson
03-30-2006, 11:19 PM
These boards us MySQL databases. Due to their design and how you retrieve information from them requires you to execute some commands that direct the "who what and where" with quotation marks. When you enter text into a field "like this" or 'like this', it can hang up the program and screw everything up.
Sooo, good programmers escape all the users input (escape means add a forward slash in front of the quotes) so as to not allow programs to hang up. Bad programmers escape the users input and then fail to reformat the input on the other end.
So basically what I am saying is that you put in this:
Whats up "homey".
The program processes the text and escapes it to not hang in the MySQL database. It is now this:
Whats up \"homey\".
On the other end, the program SHOULD reformat all your text and go back to the original:
Whats up "homey".
Unfortunately, due to bad design or someone changing something they shouldn't have, it will continually and forever display the forward slashes in front of your quotes because the program never was directed to un-escape the text.
It's not your problem, no way to get around it. Just going to have to live with it.
DoctorDoom
03-30-2006, 11:51 PM
An alternative is to use these quotes: “quoted text”. The program uses the straight quote " and shouldn't escape those two.
To get left single quotation mark, press Alt and type 0145 - ‘
To get right single quotation mark, press Alt and type 0146 - ’
To get left double quotation mark, press Alt and type 0147 - “
To get right double quotation mark, press Alt and type 0148 - ”
Pendragon_6
04-02-2006, 02:33 PM
Thanks everyone. It's become a challenge now. I'll fix it or smash the computer.
DoctorDoom
04-02-2006, 06:53 PM
'Tain't your puter.
Pendragon_6
04-03-2006, 09:12 AM
I know Doc, just kidding.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.