mastercjb Posted April 10, 2012 Share Posted April 10, 2012 This script is working fine on PHP 5.3.1 but i got a new host that uses 5.3.6 and now its no longer working? What can i change to make it work, and does anyone know where i can learn the different coding between the 2 updates? <? include 'cpheader.php'; if (isset($_POST['submit'])) { $error = ($_POST['title'] == "") ? "You need to have a title!" : $error; $error = ($_POST['message'] == "") ? "You need to have a message!" : $error; if($error == ""){ $time = time(); $result= mysql_query("INSERT INTO `ads` VALUES('".$time."', '$user_class->id', '".$_POST['title']."', '".$_POST['message']."')"); echo Message("You have posted a news update.); } else { echo Message($error); } } ?> <tr><td class="contenthead">Post News</td></tr> <tr><td class="contentcontent"> This is the news that posts on the main page after you log in. HTML is turned on and you may use it to make your posts look a bit better than normal text, as well as add images. </td></tr> <tr><td class="contentcontent"> <form method='post'> <table width='100%'> <tr> <td width='25%'>Title:</td> <td width='25%'> <input type='text' name='title' size='40' maxlength='100'> </td> </tr> <tr> <td width='25%'>Message:</td> <td width='25%'> <textarea name='message' cols='60' rows='4' ></textarea> </td> </tr> <tr> <td width='25%'>Submit:</td> <td width='25%'> <input type='submit' name='submit' value='Post'> </td> </tr> </table> </form> </td></tr> <? include 'footer.php'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/ Share on other sites More sharing options...
litebearer Posted April 10, 2012 Share Posted April 10, 2012 define NO LONGER WORKING. Nothing at all, some errors, etc Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/#findComment-1335902 Share on other sites More sharing options...
PFMaBiSmAd Posted April 10, 2012 Share Posted April 10, 2012 its no longer working Your forgot to tell us what exactly it is doing, to narrow down the half-dozen different possibilities. Also, what does a 'view source' of the output in your browser show? Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/#findComment-1335903 Share on other sites More sharing options...
dcro2 Posted April 10, 2012 Share Posted April 10, 2012 It probably has nothing to do with the version, but with their settings. Like if short_open_tag is enabled for instance. Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/#findComment-1335904 Share on other sites More sharing options...
mastercjb Posted April 10, 2012 Author Share Posted April 10, 2012 HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request. It was working fine, then i got switched to 5.3.6 and BAM, error..... "view source" is showing nothing, its blank... Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/#findComment-1335906 Share on other sites More sharing options...
dcro2 Posted April 10, 2012 Share Posted April 10, 2012 error_reporting(0); ini_set('display_errors', 1); Put it at the top and try again. Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/#findComment-1335909 Share on other sites More sharing options...
mastercjb Posted April 10, 2012 Author Share Posted April 10, 2012 Nothing changed Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/#findComment-1335910 Share on other sites More sharing options...
dcro2 Posted April 10, 2012 Share Posted April 10, 2012 Then start commenting things out until it works. Change those short open tags (<?) to <?php to start. Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/#findComment-1335913 Share on other sites More sharing options...
xyph Posted April 10, 2012 Share Posted April 10, 2012 Do you have a bad htaccess file in the directory, or directories above it? You should check Apache's error log. It will help you pinpoint the issue. Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/#findComment-1335916 Share on other sites More sharing options...
PFMaBiSmAd Posted April 10, 2012 Share Posted April 10, 2012 Setting error_reporting to E_ALL would probably help. Setting it to zero will prevent the reporting of all errors. Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/#findComment-1335918 Share on other sites More sharing options...
mastercjb Posted April 10, 2012 Author Share Posted April 10, 2012 it was this line echo Message("You have posted a news update.); did they change something in 5.3.6 with the echo code? Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/#findComment-1335919 Share on other sites More sharing options...
PFMaBiSmAd Posted April 10, 2012 Share Posted April 10, 2012 It's more likely that your message() function is not defined. Have you set error_reporting to E_ALL as suggested along with display_errors to a 1 or ON value? Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/#findComment-1335924 Share on other sites More sharing options...
xyph Posted April 10, 2012 Share Posted April 10, 2012 He's getting an Apache error. Even if PHP was compiled, I'm not sure Apache would send anything PHP tried to output. Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/#findComment-1335925 Share on other sites More sharing options...
dcro2 Posted April 10, 2012 Share Posted April 10, 2012 Setting error_reporting to E_ALL would probably help. Setting it to zero will prevent the reporting of all errors. Whoops, meant -1. Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/#findComment-1335927 Share on other sites More sharing options...
requinix Posted April 10, 2012 Share Posted April 10, 2012 it was this line echo Message("You have posted a news update.); did they change something in 5.3.6 with the echo code? No. But it could have something to do with that being a syntax error. Which bothers me because you said that code worked in 5.3.1. Which it couldn't possibly. Quote Link to comment https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/#findComment-1335936 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.