Jump to content

Stuff is working on PHP 5.3.1 but not 5.3.6?


mastercjb

Recommended Posts

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';
?>

Link to comment
https://forums.phpfreaks.com/topic/260655-stuff-is-working-on-php-531-but-not-536/
Share on other sites

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...

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.