Jump to content


Photo

This line gives me an Internal Server Error


  • Please log in to reply
2 replies to this topic

#1 play_

play_
  • Staff Alumni
  • Advanced Member
  • 717 posts

Posted 16 September 2006 - 05:47 PM

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:
# /dev/input/event i get a 500 Internal Server error.
"/dev/input/mice"  also gives me the same error

but "ZAxisMapping" "4 5" 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:
//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);
		}

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)
regex.kat.sh --- regex library
u.kat.sh ---- url shortener
tabbit.org ---- tabbed pastebin

#2 play_

play_
  • Staff Alumni
  • Advanced Member
  • 717 posts

Posted 16 September 2006 - 05:52 PM

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?
regex.kat.sh --- regex library
u.kat.sh ---- url shortener
tabbit.org ---- tabbed pastebin

#3 play_

play_
  • Staff Alumni
  • Advanced Member
  • 717 posts

Posted 16 September 2006 - 08:09 PM

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.


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);
		}

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
regex.kat.sh --- regex library
u.kat.sh ---- url shortener
tabbit.org ---- tabbed pastebin




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users