Single quote error in comments

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Single quote error in comments

Postby alebulo » 01. October 2016 15:52

HI, I want to make an inquiry ... can configure the Xampp, specifically the version 1.8.2, to directly take the single quotes and all symbols "forbidden" without changing the .php? because I have a loading site in Italian notes and comments carry the load simple no tittle and gives me error .....
alebulo
 
Posts: 3
Joined: 01. October 2016 15:47
XAMPP version: 1.8.2
Operating System: Windows 2003 server SP1

Re: Single quote error in comments

Postby Nobbie » 01. October 2016 19:35

Sorry, but your error "description" is chaotic and i dont understand a single word.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Single quote error in comments

Postby Altrea » 01. October 2016 20:04

Hi,

I don't have any idea if i understand your description.
Don't output any user generated input without escaping => http://php.net/manual/en/function.htmlspecialchars.php

best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Single quote error in comments

Postby alebulo » 02. October 2016 02:38

Sorry for that, use Google traslator.... Can i configurate the xampp, specially the 1.8.2 version for take it simple quotes without changing .php files? when i make an entry in a imput form, like "Dell'Studente " don´t work for a quote. Form is for upload Student comments for a school .
alebulo
 
Posts: 3
Joined: 01. October 2016 15:47
XAMPP version: 1.8.2
Operating System: Windows 2003 server SP1

Re: Single quote error in comments

Postby Altrea » 02. October 2016 10:58

Take a look at my reply. The problem is not the input, the problem is the output. Use php's htmlspecialchars
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Single quote error in comments

Postby Nobbie » 02. October 2016 11:20

alebulo wrote:when i make an entry in a imput form, like "Dell'Studente " don´t work for a quote.


"Dont work" is still not a proper description. Single quotes in forms of course "work" and are no problem for PHP, but maybe you have an error in your PHP Script, that the input is used in a query or in another form (or similar) and your script does not handle (i.e. escape) the quotes correctly. Anyway, this is NOT a PHP issue, it is a programming issue. Everything depends on your PHP script and the data, but not on PHP itself.

Altrea already gave you a hint to a PHP function, which may be usefull in certain cases (but we cannot determine if this already fixes your problem), for MySQL Data Access there is also a very usefull function (or method) mysqli_real_escape_string() (see the documentation on http://php.net/manual/en/mysqli.real-escape-string.php) and finally there is a function addslashes() which escapes quote characters in strings: http://php.net/manual/en/function.addslashes.php

It depends on your script and your data flow, which function might be helpfull for you.

The old function magic_quotes_runtime() has been deprecated since PHP 5.3 and removed since PHP 7. If your PHP version is older than 5.3, you might try to use the runtime option magic_quotes_gpc (set it to "On" or 1 in php.ini), but keep in mind, that this feature will disappear when you are doing an upgrade.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Single quote error in comments

Postby alebulo » 02. October 2016 15:27

Ok, thank you!!
alebulo
 
Posts: 3
Joined: 01. October 2016 15:47
XAMPP version: 1.8.2
Operating System: Windows 2003 server SP1


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 59 guests