Jump to content

Recommended Posts

Hello Everyone,

I've been working with XAMPP 1.7.3 and have a general question. I've always read (and been told) to use addslashes() for any MySQL input to protect the database. My PHP.ini file has magic quotes off and the system automatically produces a caret symbol "^" in front of every control character I upload to the database. I can't find anything in the PHP.ini file relating to the caret symbols and control characters, nor can I find anything in the My.ini file.

 

In testing, it the system behaves just as it would if I had magic quotes on, except that the system uses the carets instead of slashes. I have no problem removing the carets (and any slashes that a user might upload) but would like to know what is going on. I've done google searches on this and have only found content regarding regular expressions. Could someone clue me in? Thank in advance.

Cheers,

Rick

Link to comment
https://forums.phpfreaks.com/topic/254737-caret-not-slashes/
Share on other sites

Hello Laffin and ManiacDan,

Thank you for the reply. I have XAMPP 1.7.3 on my development machine (XP Pro) which has PHP version 5.3.1, Apache version 2.2.14  and MySQL version 5.1.41 all slightly behind the latest available. But they are certainly not old systems; the behavior seems pretty odd to me though. This has bothered me for some time, but I had so much development work to do, I didn't take the time to search for an answer until now. I suspect that when I place the code on a production server, the behavior will change.

 

As far as "mysql_real_escape_string" we did cover that in class as well and I should have mentioned it. I guess I'll try to look around some more for the answer (cause it bugs me), but it may become a non-issue when the web app is up on a production server. Thanks again for you time!

Cheers,

Rick

Link to comment
https://forums.phpfreaks.com/topic/254737-caret-not-slashes/#findComment-1306640
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.