play_ Posted September 16, 2006 Share Posted September 16, 2006 I cannot figure out what is wrong.Problem:Made a typical blog entry thing. I type the message and submit.However, when i enter this line:[b]# /dev/input/event[/b] i get a 500 Internal Server error.[b]"/dev/input/mice"[/b] also gives me the same errorbut [b]"ZAxisMapping" "4 5"[/b] works. so it's not quotes. it's got something to do with the slashes, i would assume.Another thing: it only happens on my rented server(redhat). on my localhost(windows), it works fine.Here is the function i use to sanitize input data:[code]//function for escaping and trimming data function escape_data($data) { global $dbc; if (ini_get('magic_quotes_gpc')) { $data = stripslashes($data); } return mysql_real_escape_string(trim($data), $dbc); }[/code]Any thoughts?Thanks :)ps: just to kill the curiosity, those lines are in my xorg.conf file. i want to post my xorg.conf in my site in case i need it in the future. (but obviously can't post because i get that error) Quote Link to comment Share on other sites More sharing options...
play_ Posted September 16, 2006 Author Share Posted September 16, 2006 On further testing, even if i just post:/dev/input/eventi get the error. So, perhaps the server thinks i am trying to access that directory? Quote Link to comment Share on other sites More sharing options...
play_ Posted September 16, 2006 Author Share Posted September 16, 2006 K.the problem is this: /dev/for the rest of this post, let's assume $str = '/dev/'so i try replacing the / with --- for testing purposes.it wont work still. before i even send $str to the database, i replace the / with --- and i still get errors.[code]function escape_data($data) { global $dbc; $data = preg_replace('"/"', '----', $data); if (ini_get('magic_quotes_gpc')) { $data = stripslashes($data); } return mysql_real_escape_string(trim($data), $dbc); }[/code]thats what i use to sanitize data. i put every input in the escape_data function you see above.so if i submit /dev, it will show up as ---devif i submit dev/, it will show up as dev--but if i submit /dev/ i get the internal server error. even though it changes / to --- before even putting it on the db Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.