Jump to content

Archived

This topic is now archived and is closed to further replies.

play_

This line gives me an Internal Server Error

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)

Share this post


Link to post
Share on other sites
On further testing, even if i just post:

/dev/input/event

i get the error. So, perhaps the server thinks i am trying to access that directory?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

×

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.