Jump to content

Magic Quotes What the $%^


Zeradin

Recommended Posts

Ok I have a very similar, just more complex system in a folder parallel to this one and I solved it by putting

#php_flag magic_quotes_gpc off

in .htaccess but for some reason I'm still getting the old problem in this form.

 

upload page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>News Upload Form</title>
</head>
<body>
		<!-- Upload Form -->
		  <strong><u>News Item</u><br /><br />
		    <form method="POST" action="newstory.php">
				<strong>News Title</strong><br />
				<input type="text" name="title" size="20"><br />
				<br />
				<strong>Posted By</strong><br />
				<input type="text" name="poster" size="20"><br />
				<br />
				<strong>Message</strong><br />
				<textarea rows="30" name="message" cols="80"></textarea>
				<br />
				<br />
				<input type="submit" value="Submit" name="newssubmit">
			</form><br />
<!-- End Upload Form -->
<br /><hr><br />
</body>
</html>

 

the text file it writes into has the magic quotes and I can't figure out how to get rid of them. I've been trying any script i can find to remove them and it's not working.

Link to comment
Share on other sites

forgot to include probably the most important part... the processing page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Uploaded! Redirecting to Index...</title>
<link href="css	.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function delayedRedirect(){
    window.location = "home.php"
}
</script>--></head><BODY>
<body onLoad="setTimeout('delayedRedirect()', 3000)" text="#000000"><br />
<?php
// set file to write
$file = "newslog.txt";
// open file
$fh = fopen($file, 'a') or die('Could not open file!');
// write to file
fwrite($fh, "$poster'[END]'$story'[END]'\n$date'[END]'\n$title'[END]'\n\n\n") or die('Could not write to file');
// close file
fclose($fh);

echo "   You have uploaded news! You will be re-directed to the news page in one moment.";
}
else
{
echo "error";
}
?>
</body>
</html>

Link to comment
Share on other sites

Ok I have a very similar, just more complex system in a folder parallel to this one and I solved it by putting

#php_flag magic_quotes_gpc off

in .htaccess but for some reason I'm still getting the old problem in this form.

First of you'll need to remove the # at the start of line in order for Apache to read the line, otherwise it'll be ignored. Secondly the php_flag and php_value directives are only available if PHP is configured as an Apache Module only.

Link to comment
Share on other sites

Internal Server Error

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

 

Please contact the server administrator, webmaster@hypboard.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7a mod_bwlimited/1.4 Server at hypboard.com Port 80

 

i don't understand how i didn't add any script to the other form, but it works and this one doesn't

Link to comment
Share on other sites

like i have html_public/thehyp/uploadform.php and html_public/thehyp/newstory.php

 

and html_public/TEST/upload.php and html_public/TEST/newstory.php

 

I made the ones in TEST by basically cutting out tons of code and making the ones in TEST really really simplistic

the .htaccess file is in html_public and if the # makes it not get read I don't understand why thehyp one doesn't have the magic quotes and the TEST one does

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.