0

Hi,

I have the following code in test.php file

<form name=f1 method=get action="test.php">
<textarea name="question"></textarea>
<input type="submit" value="Submit">
</form>

If I enter "sample text" its working fine with http://www.example.com/test.php?question=sample+text

But if I enter "Create a view that does not contain the" its throwing the following error message with http://www.example.com/test.php?question=Create+a+view+that+does+not+contain+the


Internal Server Error

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

Please contact the server administrator, webmaster@example.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 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

8
Contributors
19
Replies
20
Views
6 Years
Discussion Span
Last Post by rrlogu
0

Thanks for you reply, actually I posted here after searching in google only.

0

Can you be more specific, I am new to PHP, let me know if you need any other information from my files.

0

check your web files folder for .htaccess named file, open it with note pad
and post here that code.. This also raises error.

0

There is no PHP in "test.php" so it is definitely not a PHP error. In fact, when you enter a question into the form and submit, it should just display a blank form again.

0

There are no .htaccess files created in the folder.

0

.htaccess file is usually hidden . . . you have to unhide it first. .the option comes when you click to open the root folder. .

0

If you're using Linux, the URLs are all case sensitive. Make sure the case of the filename is what you're typing in as well.

0

Is it a wamp installation?

if yes and you are on Win OS. turn on hiddend files .
on xp. got to mycomputer -> menu list ->look for Tools -> folder Option and you will get a pop up. look for turn hidden file on.

Its a radio button.

Go back to your Wamp and look for .htaccess file. Just remove it.

2. If its not there...
Do you realize also that your url extension got encoding of foo+bar+spam... its eg.

question. Did you encoded that yourself or the file input did.?
If you did... Then you must make sure you decode that before you parse the url looking for the said link.

2. If your file name is spaced eg.. hello world.php ..., make sure you put them together like hello_world.php or anyway you like.
But they must be together.


If this trouble shooting does not help you. remove and install the server again.

;)

0

it may be because of the url that you are passing.
make sure your query string should be lowercase it will cause problem in Linux server and also check the condition inside your code is correct also if you redirecting to any where else.

0

Hi all,

I tried all the possibilities from internet, but none of them solved this error. I am giving more details here, hope I will get this error resolved soon.

File Name - TEST.PHP
File Content
<form name=f1 method=get action="test.php">
<textarea name="question"></textarea>
<input type="submit" value="Submit">
</form>

> I don't have any .htaccess file in the folder, also no .htaccess file created after getting the 500 Internal Server Error message.

If I access the above PHP via www.example.com/test.php and enter some text its working, but if I enter "Create a view that does not contain the" (or) some text which contains Create (or) database related words, its throwing the following 500 Internal Server error message.

Internal Server Error

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

Please contact the server administrator, webmaster@example.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 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

> Server Error Log is showing the following message.
"[Tue Apr 26 17:54:12 2011] [error] [client 98.14.201.129] File does not exist: /home/example/public_html/500.shtml, referer: http://www.example.com/post.html"


Additional Details

Operating system linux
PHP version 5.2.17
Apache version 2.0.63


Thanks,

0

What do you expect to happen? In other words, what does "working" mean for this test? I don't think you have posted the whole of the "test.php" file, because the bit posted will do nothing.

0

Thanks for your reply, following is my full content. All I need is to display the textarea content after submitting the form.

File Name - TEST.PHP
File Content

<?php
       echo "Question = ".$_POST['question'];
     ?>

     <form name=f1 method=post action="test.php">
           <textarea name="question"></textarea> 
           <input type="submit" value="Submit">
     </form>

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

0

Thanks for your reply, following is my full content. All I need is to display the textarea content after submitting the form.

File Name - TEST.PHP
File Content

<?php
echo "Question = ".$_POST;
?>

<form name=f1 method=post action="test.php">
<textarea name="question"></textarea>
<input type="submit" value="Submit">
</form>

You have an internal error because your php code is wrong.

<?php
       echo "Question = ".$_POST['question'];
     ?>

should be

<?php
       echo "Question = "$_POST['question']; // $_GET['question'] depending on post/get
     ?>

pay attention to $_POST[] global var.
not .$_POST[].....
Take away the dot ok?

0

Thanks for your reply, I changed like below, but still the error is same.

<?php
echo $_POST['question'];
?>

<form name=f1 method=post action="test.php">
      <textarea name="question"></textarea> 
      <input type="submit" value="Submit">
</form>

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

0

Hello All,

This issue is fixed now !!! The error was coming because mod security was enabled in server and it was considering it sql injection attack. I have now disabled the rule of sql injection attack in mod security configuration and its working.

Thanks to every one for your valuable responses... !!!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.