0

I have this simple code:

<?php
    if(isset($_POST['test'])) {
        echo $_POST['test'];
    }
?> 
 <form action="testing.php" method="post"> 
 <table> 
 <tr><td>Fill Out:</td><td><input type="text" name="test" /></td></tr>
 <tr><td colspan="2" align="center"><input type="submit" /></td></tr>  
 </table> 
 </form>

Whenever I put "http://www.google.com" and click "submit", I get this error:

Image: i.stack.imgur.com/mCrRb.png

If I put "google.com" and click "submit", it echo's the result perfectly fine:

Image: i.stack.imgur.com/5WakC.png

Now, this only happens on one of my hosting providers. If I put the script on another hosting provider, it works perfectly fine.

I'm wondering if there is anything I can possibly do to fix this problem. I have tried changing the file's permissions to 777, but it still gets the same error.

Could it be a setting in the "php.ini" file that is causing this error?

  • Have you tried it with GET? It's sometime easier to see the error... – jacktheripper Jul 06 '13 at 19:09
  • @jacktheripper I get the same error when trying "GET". When I visit "testing.php?test=[http://www.google.com](http://www.google.com)", I get the error: i.stack.imgur.com/mCrRb.png. When I visit "testing.php?test=google.com", it echo's "google.com" perfectly fine. – user2556844 Jul 06 '13 at 19:15
  • @user2556844: add this to the top of your script `ini_set('display_errors',1); error_reporting(E_ALL);` and tell us what error you got. – Amal Murali Jul 06 '13 at 19:27
  • @AmalMurali I added the code in and it wont even display an error when I put http:// www.google.com it just goes to the 404/403 error. When I put "google.com", it echo's it correctly. – user2556844 Jul 06 '13 at 19:39
  • @user2556844: where's your `testing.php` code? – Amal Murali Jul 06 '13 at 19:48
  • @AmalMurali It's displayed in my question. When I added your code, it changed to this: `` – user2556844 Jul 06 '13 at 19:51
  • @AmalMurali When I changed it to GET: `` And of course I changed the "method" to "get" in the HTML code. – user2556844 Jul 06 '13 at 19:52
  • Your code is perfectly fine and it works here. It's something else. Have a look here: http://stackoverflow.com/questions/10873295/ – Amal Murali Jul 06 '13 at 20:03
  • @AmalMurali I would think it would be Apache, but it only gives me this error when submitting a URL. Anything that doesn't have "http:// www.", works perfectly fine. Have any other ideas of what could possibly be the problem? – user2556844 Jul 06 '13 at 21:19

0 Answers0