I don't understand why I'm getting this error...I just uploaded a complete website from my test server (hosted by SiteGround) to the main server (hosted by GoDaddy), and I never got this error on the test server. What do I do?
I submitted a ticket to GoDaddy and they said it was my coding, but I dont think so...the same page worked fine on my server hosted by siteground. But anyways heres my coding.
I think the case statements need to be in quotes. PHP on your old server was just nice in translating them for you. Try it with quotes and see what happens.
I havn't looked too deeply at the code, but it might be a security issue:
If your host has error reporting turned off to keep possible hackers from retrieving info you may be getting the generic server error as a substitute for error reporting. Some trouble shooting steps:
1. Set error reporting in the file:
PHP Code:
ini_set('error_reporting',E_ALL);
2. If your host gives Logging, check the logs and see what code is returned on POST
3. Create a simple test page with only a mail function and see if that works. It will let you know if the problem is in that config.
Ok, so I set the error reporting in the file like hastx suggested, so then the page actually loaded but there was a whole list of errors at the top concerning the case statements so then I did what bluestars suggested, and that got rid of all the errors concerning the switch statements. But there are still some errors, click the link below to see them. http://www.ccgulfbreeze.com/contact/
"Undefined index" is normally an informational message -- which can get logged but normally doesn't prevent the page from loading. One server can have this configured differently from another. This would explain the differences you're seeing between hosts.
To fix such an "error" instead of doing this (just an example):
PHP Code:
$name = $_GET[name];
or this:
PHP Code:
$name = $_GET['name'];
Always do this, instead:
PHP Code:
$name = '';
if (isset($_GET['name'])):
$name = $_GET['name'];
endif;
or this:
PHP Code:
if (isset($_GET['name'])):
$name = $_GET['name'];
else:
$name = '';
endif;
Alternative syntax shown is my style.
You can use braces if that is your style.
Last edited by temp.user123; 07-04-2007 at 02:07 PM.
Would there be a way that I can simply change the PHP configuration? So I don't have to go through and recode my script.
Not on a paid host. their configs are usally global. Only ini variables which are allowed by script-override(such as error reporting) you have control over.
I would just take care of the case issues and then you might be able to turn off the error reporting and be cool.
As was mentioned earlier, "Notices" should not constitute "errors" or "warnings" and therefor your page should load ok ....even though the notices would be there, they wouldn't be seen.
edit:
chances are the notices were there on your old host too, you just didn't see them with how their reporting was set up. I've never seen server errors result from only notices.
Bookmarks