Jump to content

This line gives me an Internal Server Error


play_

Recommended Posts

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 error

but [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)
Link to comment
Share on other sites

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 ---dev
if 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
Link to comment
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.